com.sun.slamd.realm
Class CachedUser

java.lang.Object
  extended by com.sun.slamd.realm.CachedUser

public class CachedUser
extends java.lang.Object

This class implements a data structure used to store information about users that have been authenticated using the LDAPRealm realm implementation. The information stored includes an expiration time that can be used to prevent the information in the cached entry from becoming stale.

Author:
Neil A. Wilson

Constructor Summary
CachedUser(java.lang.String userName, java.lang.String userDN, byte[] hashedPassword, java.security.Principal userPrincipal, long expirationTime)
          Creates a new cached user with the specified information.
 
Method Summary
 long getExpirationTime()
          Retrieves the time at which this cached information should be considered expired.
 byte[] getHashedPassword()
          Retrieves the SHA-1 hashed password for the user.
 java.lang.String getUserDN()
          Retrieves the DN of the user's entry in the directory.
 java.lang.String getUserName()
          Retrieves the user name provided by the user when authenticating.
 java.security.Principal getUserPrincipal()
          Retrieves the Principal object associated with the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedUser

public CachedUser(java.lang.String userName,
                  java.lang.String userDN,
                  byte[] hashedPassword,
                  java.security.Principal userPrincipal,
                  long expirationTime)
Creates a new cached user with the specified information.

Parameters:
userName - The username provided when authenticating.
userDN - The DN of the user's entry in the directory server.
hashedPassword - The password for the user as a SHA-1 hash.
userPrincipal - The Principal object associated with this user.
expirationTime - The time at which this cached user information should expire.
Method Detail

getUserName

public java.lang.String getUserName()
Retrieves the user name provided by the user when authenticating.

Returns:
The user name provided by the user when authenticating.

getUserDN

public java.lang.String getUserDN()
Retrieves the DN of the user's entry in the directory.

Returns:
The DN of the user's entry in the directory.

getHashedPassword

public byte[] getHashedPassword()
Retrieves the SHA-1 hashed password for the user.

Returns:
The SHA-1 hashed password for the user.

getUserPrincipal

public java.security.Principal getUserPrincipal()
Retrieves the Principal object associated with the user.

Returns:
The Principal object associated with the user.

getExpirationTime

public long getExpirationTime()
Retrieves the time at which this cached information should be considered expired.

Returns:
The time at which this cached information should be considered expired.