minor updates to documentation, final keyword, and formatting.
This commit is contained in:
Scott Battaglia 2010-09-21 03:15:18 +00:00
parent ce46854baa
commit a1b9031416
8 changed files with 26 additions and 13 deletions

View File

@ -28,6 +28,7 @@ public interface CasRealm {
/**
* Gets the roles defined for the given principal.
*
* @param p the principal to retrieve the roles for.
* @return Roles for given principal or empty array if none exist.
*/
String[] getRoles(Principal p);

View File

@ -54,8 +54,7 @@ public class PropertiesCasRealmDelegate implements CasRealm {
}
/** {@inheritDoc} */
public void readProperties()
{
public void readProperties() {
CommonUtils.assertNotNull(propertiesFilePath, "PropertiesFilePath not set.");
File file = new File(propertiesFilePath);
if (!file.isAbsolute()) {

View File

@ -46,25 +46,37 @@ public abstract class AbstractAuthenticator extends AuthenticatorBase implements
protected abstract String getAuthenticationMethod();
/**
* Abstract method that subclasses should use to provide the name of the artifact parameter (i.e. ticket)
*
* @return the artifact parameter name. CANNOT be NULL.
*/
protected abstract String getArtifactParameterName();
/**
* Abstract method that subclasses should use to provide the name of the service parameter (i.e. service)
*
* @return the service parameter name. CANNOT be NULL.
*/
protected abstract String getServiceParameterName();
/**
* Returns the single instance of the ticket validator to use to validate tickets. Sub classes should include
* the one appropriate for the
*
* @return a fully configured ticket validator. CANNOT be NULL.
*/
protected abstract TicketValidator getTicketValidator();
protected void startInternal() throws LifecycleException {
super.startInternal();
this.log.debug("Starting...");
final Realm realm = this.context.getRealm();
if (!(realm instanceof CasRealm)) {
throw new LifecycleException("Expected CasRealm but got " + realm.getInfo());
}
try {
CommonUtils.assertTrue(realm instanceof CasRealm, "Expected CasRealm but got " + realm.getInfo());
CommonUtils.assertNotNull(this.casServerUrlPrefix, "casServerUrlPrefix cannot be null.");
CommonUtils.assertNotNull(this.delegate.getCasServerLoginUrl(), "casServerLoginUrl cannot be null.");
CommonUtils.assertTrue(
this.delegate.getServerName() != null || this.delegate.getServiceUrl() != null,
CommonUtils.assertTrue(this.delegate.getServerName() != null || this.delegate.getServiceUrl() != null,
"either serverName or serviceUrl must be set.");
this.delegate.setRealm((CasRealm) realm);
} catch (final Exception e) {

View File

@ -16,7 +16,6 @@ public abstract class AbstractCasAuthenticator extends AbstractAuthenticator {
private String proxyCallbackUrl;
protected final String getProxyCallbackUrl() {
return this.proxyCallbackUrl;
}

View File

@ -18,6 +18,7 @@ import org.jasig.cas.client.tomcat.CasRealm;
*
*/
public abstract class AbstractCasRealm extends RealmBase implements CasRealm {
/** {@inheritDoc} */
public Principal authenticate(final Principal p) {
return getDelegate().authenticate(p);
@ -54,7 +55,7 @@ public abstract class AbstractCasRealm extends RealmBase implements CasRealm {
}
/** {@inheritDoc} */
protected Principal getPrincipal(String username) {
protected Principal getPrincipal(final String username) {
throw new UnsupportedOperationException();
}

View File

@ -10,7 +10,7 @@ import org.jasig.cas.client.tomcat.CasRealm;
/**
* Tomcat <code>Realm</code> that implements {@link CasRealm} for principal and
* role data backed by the CAS {@link Assertion}.
* role data backed by the CAS {@link org.jasig.cas.client.validation.Assertion}.
* <p>
* Authentication always succeeds and simply returns the given principal.
*

View File

@ -16,7 +16,7 @@ import org.jasig.cas.client.validation.TicketValidator;
* @version $Revision$ $Date$
* @since 3.1.12
*/
public class Cas10CasAuthenticator extends AbstractCasAuthenticator {
public final class Cas10CasAuthenticator extends AbstractCasAuthenticator {
public static final String AUTH_METHOD = "CAS10";
private Cas10TicketValidator ticketValidator;

View File

@ -16,7 +16,8 @@ import org.jasig.cas.client.validation.TicketValidator;
* @version $Revision$
*
*/
public class Saml11Authenticator extends AbstractAuthenticator {
public final class Saml11Authenticator extends AbstractAuthenticator {
public static final String AUTH_METHOD = "SAML11";
private Saml11TicketValidator ticketValidator;