uPortal 2.4.1
API Documentation

org.jasig.portal.security.provider
Class PersonImpl

java.lang.Object
  extended byorg.jasig.portal.security.provider.PersonImpl
All Implemented Interfaces:
IAdditionalDescriptor, IBasicEntity, IPerson, java.io.Serializable

public class PersonImpl
extends java.lang.Object
implements IPerson

This is a reference IPerson implementation.

Version:
$Revision: 1.15 $
Author:
Adam Rybicki, arybicki@unicon.net
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jasig.portal.security.IPerson
USERNAME
 
Constructor Summary
PersonImpl()
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String key)
          Returns an attribute for a key.
 java.util.Enumeration getAttributeNames()
          Returns an enumeration of all of the attribute names associated with the user
 java.util.Enumeration getAttributes()
          Returns a java.util.Enumeration of all the attribute values.
 java.lang.Object[] getAttributeValues(java.lang.String key)
          Returns multiple attributes for a key.
 EntityIdentifier getEntityIdentifier()
          Returns an EntityIdentifier for this person.
 java.lang.String getFullName()
          Returns the user's name that was established during authentication.
 int getID()
          Returns the user's ID that was used for authentication.
 ISecurityContext getSecurityContext()
          Gets the security context object associated with the user
 boolean isGuest()
          Determines whether or not this person is a "guest" user.
 void setAttribute(java.lang.String key, java.lang.Object value)
          Sets the specified attribute to a value.
 void setFullName(java.lang.String sFullName)
          Sets the user's full name.
 void setID(int sID)
          Sets the user's ID.
 void setSecurityContext(ISecurityContext securityContext)
          Associates a security context object with the user
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersonImpl

public PersonImpl()
Method Detail

getSecurityContext

public ISecurityContext getSecurityContext()
Description copied from interface: IPerson
Gets the security context object associated with the user

Specified by:
getSecurityContext in interface IPerson
Returns:
security context object associated with the user

setSecurityContext

public void setSecurityContext(ISecurityContext securityContext)
Description copied from interface: IPerson
Associates a security context object with the user

Specified by:
setSecurityContext in interface IPerson
Parameters:
securityContext -

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Returns an attribute for a key. For objects represented as strings, a java.lang.String will be returned. Binary values will be represented as byte arrays.

Specified by:
getAttribute in interface IPerson
Parameters:
key - the attribute name.
Returns:
value the attribute value identified by the key.

getAttributeValues

public java.lang.Object[] getAttributeValues(java.lang.String key)
Returns multiple attributes for a key. If only one value exists, it will be returned in an array of size one.

Specified by:
getAttributeValues in interface IPerson
Parameters:
key - the attribute name
Returns:
the array of attribute values identified by the key

getAttributes

public java.util.Enumeration getAttributes()
Returns a java.util.Enumeration of all the attribute values.

Specified by:
getAttributes in interface IPerson
Returns:
java.util.Enumeration of the attributes.

getAttributeNames

public java.util.Enumeration getAttributeNames()
Returns an enumeration of all of the attribute names associated with the user

Specified by:
getAttributeNames in interface IPerson
Returns:
enumeration of all of the attribute names associated with the user

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Sets the specified attribute to a value. Reference impementation checks for the setting of the username attribute and updates the EntityIdentifier accordingly

Specified by:
setAttribute in interface IPerson
Parameters:
key - Attribute's name
value - Attribute's value

getID

public int getID()
Returns the user's ID that was used for authentication. Does not correlate to any eduPerson attribute but is the key for user data in uPortal reference rdbms.

Specified by:
getID in interface IPerson
Returns:
User's ID.

setID

public void setID(int sID)
Sets the user's ID.

Specified by:
setID in interface IPerson
Parameters:
sID - User's ID as supplied for authentication Does not correlate to any eduPerson attribute but is the key for user data in uPortal reference rdbms.

getFullName

public java.lang.String getFullName()
Returns the user's name that was established during authentication. Correlates to cn (common name) in the eduPerson 1.0 specification.

Specified by:
getFullName in interface IPerson
Returns:
User's name.

setFullName

public void setFullName(java.lang.String sFullName)
Sets the user's full name.

Specified by:
setFullName in interface IPerson
Parameters:
sFullName - User's name as established during authentication Correlates to cn (common name) in the eduPerson 1.0 specification.

isGuest

public boolean isGuest()
Determines whether or not this person is a "guest" user.

This person is a "guest" if both of the following are true:

  1. This person has not successfully authenticated with the portal.
  2. This person's user name matches the value of the property org.jasig.portal.security.PersonImpl.guest_user_name in portal.properties.

Specified by:
isGuest in interface IPerson
Returns:
true if person is a guest, otherwise false

getEntityIdentifier

public EntityIdentifier getEntityIdentifier()
Returns an EntityIdentifier for this person. The key contains the value of the eudPerson username attribute, or null

Specified by:
getEntityIdentifier in interface IBasicEntity
Returns:
EntityIdentifier with attribute 'username' as key.

uPortal 2.4.1
API Documentation