org.jasig.cas.services
Class AbstractRegisteredService

java.lang.Object
  extended by org.jasig.cas.services.AbstractRegisteredService
All Implemented Interfaces:
Serializable, Cloneable, Comparable<RegisteredService>, RegisteredService
Direct Known Subclasses:
RegexRegisteredService, RegisteredServiceImpl

@Entity
public abstract class AbstractRegisteredService
extends Object
implements RegisteredService, Comparable<RegisteredService>, Serializable

Base class for mutable, persistable registered services.

Author:
Marvin S. Addison, Scott Battaglia
See Also:
Serialized Form

Field Summary
protected  String serviceId
           
 
Constructor Summary
AbstractRegisteredService()
           
 
Method Summary
 Object clone()
           
 int compareTo(RegisteredService other)
          Compares this instance with the other registered service based on evaluation order, name.
 void copyFrom(RegisteredService source)
          Copies the properties of the source service into this instance.
 boolean equals(Object o)
           
 List<String> getAllowedAttributes()
          Returns the list of allowed attributes.
 String getDescription()
          Returns the description of the service.
 int getEvaluationOrder()
          Gets the relative evaluation order of this service when determining matches.
 long getId()
          The numeric identifier for this service.
 String getName()
          Returns the name of the service.
 String getServiceId()
          The unique identifier for this service.
 String getTheme()
          Returns a short theme name.
 String getUsernameAttribute()
          Get the name of the attribute this service prefers to consume as username.
 int hashCode()
           
 boolean isAllowedToProxy()
          Is this application allowed to take part in the proxying capabilities of CAS?
 boolean isAnonymousAccess()
          Determines whether the service is allowed anonymous or privileged access to user information.
 boolean isEnabled()
          Is this application currently allowed to use CAS?
 boolean isIgnoreAttributes()
          Sets whether we should bother to read the attribute list or not.
 boolean isSsoEnabled()
          Does this application participate in the SSO session?
protected abstract  AbstractRegisteredService newInstance()
           
 void setAllowedAttributes(List<String> allowedAttributes)
           
 void setAllowedToProxy(boolean allowedToProxy)
           
 void setAnonymousAccess(boolean anonymousAccess)
           
 void setDescription(String description)
           
 void setEnabled(boolean enabled)
           
 void setEvaluationOrder(int evaluationOrder)
          Sets the relative evaluation order of this service when determining matches.
 void setId(long id)
           
 void setIgnoreAttributes(boolean ignoreAttributes)
           
 void setName(String name)
           
abstract  void setServiceId(String id)
           
 void setSsoEnabled(boolean ssoEnabled)
           
 void setTheme(String theme)
           
 void setUsernameAttribute(String username)
          Sets the name of the user attribute to use as the username when providing usernames to this registered service.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jasig.cas.services.RegisteredService
matches
 

Field Detail

serviceId

protected String serviceId
Constructor Detail

AbstractRegisteredService

public AbstractRegisteredService()
Method Detail

isAnonymousAccess

public boolean isAnonymousAccess()
Description copied from interface: RegisteredService
Determines whether the service is allowed anonymous or privileged access to user information. Anonymous access should not return any identifying information such as user id.

Specified by:
isAnonymousAccess in interface RegisteredService
Returns:
if we should use a pseudo random identifier instead of their real id

setAnonymousAccess

public void setAnonymousAccess(boolean anonymousAccess)

getAllowedAttributes

public List<String> getAllowedAttributes()
Description copied from interface: RegisteredService
Returns the list of allowed attributes.

Specified by:
getAllowedAttributes in interface RegisteredService
Returns:
the list of attributes

getId

public long getId()
Description copied from interface: RegisteredService
The numeric identifier for this service.

Specified by:
getId in interface RegisteredService
Returns:
the numeric identifier for this service.

getDescription

public String getDescription()
Description copied from interface: RegisteredService
Returns the description of the service.

Specified by:
getDescription in interface RegisteredService
Returns:
the description of the service.

getServiceId

public String getServiceId()
Description copied from interface: RegisteredService
The unique identifier for this service.

Specified by:
getServiceId in interface RegisteredService
Returns:
the unique identifier for this service.

getName

public String getName()
Description copied from interface: RegisteredService
Returns the name of the service.

Specified by:
getName in interface RegisteredService
Returns:
the name of the service.

getTheme

public String getTheme()
Description copied from interface: RegisteredService
Returns a short theme name. Services do not need to have unique theme names.

Specified by:
getTheme in interface RegisteredService
Returns:
the theme name associated with this service.

isAllowedToProxy

public boolean isAllowedToProxy()
Description copied from interface: RegisteredService
Is this application allowed to take part in the proxying capabilities of CAS?

Specified by:
isAllowedToProxy in interface RegisteredService
Returns:
true if it can, false otherwise.

isEnabled

public boolean isEnabled()
Description copied from interface: RegisteredService
Is this application currently allowed to use CAS?

Specified by:
isEnabled in interface RegisteredService
Returns:
true if it can use CAS, false otherwise.

isSsoEnabled

public boolean isSsoEnabled()
Description copied from interface: RegisteredService
Does this application participate in the SSO session?

Specified by:
isSsoEnabled in interface RegisteredService
Returns:
true if it does, false otherwise.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setAllowedAttributes

public void setAllowedAttributes(List<String> allowedAttributes)

setAllowedToProxy

public void setAllowedToProxy(boolean allowedToProxy)

setDescription

public void setDescription(String description)

setEnabled

public void setEnabled(boolean enabled)

setServiceId

public abstract void setServiceId(String id)

setId

public void setId(long id)

setName

public void setName(String name)

setSsoEnabled

public void setSsoEnabled(boolean ssoEnabled)

setTheme

public void setTheme(String theme)

isIgnoreAttributes

public boolean isIgnoreAttributes()
Description copied from interface: RegisteredService
Sets whether we should bother to read the attribute list or not.

Specified by:
isIgnoreAttributes in interface RegisteredService
Returns:
true if we should read it, false otherwise.

setIgnoreAttributes

public void setIgnoreAttributes(boolean ignoreAttributes)

setEvaluationOrder

public void setEvaluationOrder(int evaluationOrder)
Description copied from interface: RegisteredService
Sets the relative evaluation order of this service when determining matches.

Specified by:
setEvaluationOrder in interface RegisteredService

getEvaluationOrder

public int getEvaluationOrder()
Description copied from interface: RegisteredService
Gets the relative evaluation order of this service when determining matches.

Specified by:
getEvaluationOrder in interface RegisteredService
Returns:
Evaluation order relative to other registered services. Services with lower values will be evaluated for a match before others.

getUsernameAttribute

public String getUsernameAttribute()
Description copied from interface: RegisteredService
Get the name of the attribute this service prefers to consume as username.

Specified by:
getUsernameAttribute in interface RegisteredService
Returns:
Either of the following values:
  • String representing the name of the attribute to consume as username
  • null indicating the default username

setUsernameAttribute

public void setUsernameAttribute(String username)
Sets the name of the user attribute to use as the username when providing usernames to this registered service.

Note: The username attribute will have no affect on services that are marked for anonymous access.

Parameters:
username - attribute to release for this service that may be one of the following values:
  • name of the attribute this service prefers to consume as username
  • .
  • null to enforce default CAS behavior
See Also:
isAnonymousAccess()

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface RegisteredService
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

copyFrom

public void copyFrom(RegisteredService source)
Copies the properties of the source service into this instance.

Parameters:
source - Source service from which to copy properties.

compareTo

public int compareTo(RegisteredService other)
Compares this instance with the other registered service based on evaluation order, name. The name comparison is case insensitive.

Specified by:
compareTo in interface Comparable<RegisteredService>
See Also:
getEvaluationOrder()

toString

public String toString()
Overrides:
toString in class Object

newInstance

protected abstract AbstractRegisteredService newInstance()


Copyright © 2004-2013 Jasig. All Rights Reserved.