Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.security.provider
Class PersonImpl

    java.lang.Object
      org.jasig.portal.security.provider.PersonImpl

All Implemented Interfaces:
  java.io.Serializable, IBasicEntity, IAdditionalDescriptor, IPerson

    public class PersonImpl

extends java.lang.Object
implements IPerson

This is a reference IPerson implementation.

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

Field Summary
`protected java.util.Hashtable` | `m_Attributes`
`protected EntityIdentifier` | `m_eid`
`protected java.lang.String` | `m_FullName`
`protected int` | `m_ID`
`protected ISecurityContext` | `m_securityContext`

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` | `setAttributes(java.util.Map attrs)` Sets the specified attributes.
`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
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### m_Attributes

    protected java.util.Hashtable m_Attributes

### m_FullName

    protected java.lang.String m_FullName

### m_ID

    protected int m_ID

### m_securityContext

    protected ISecurityContext m_securityContext

### m_eid

    protected EntityIdentifier m_eid

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`

### 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

### setAttributes

    public void setAttributes(java.util.Map attrs)

  Sets the specified attributes. Uses `setAttribute(String, Object)` to set each.

  Specified by:
    `setAttributes` in interface `IPerson`
  See Also:
    `IPerson.setAttributes(java.util.Map)`

### 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.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD