com.atlassian.crowd.model.token
Class Token

java.lang.Object
  extended by com.atlassian.crowd.model.token.Token
All Implemented Interfaces:
java.io.Serializable

public class Token
extends java.lang.Object
implements java.io.Serializable

Holds the token information for an authenticated entity.

See Also:
Serialized Form

Field Summary
static long APPLICATION_TOKEN_DIRECTORY_ID
          Tokens are used for application clients and principals.
 
Constructor Summary
Token(long directoryId, java.lang.String name, java.lang.String identifierHash, long randomNumber, java.lang.String randomHash)
           
Token(long directoryId, java.lang.String name, java.lang.String identifierHash, long randomNumber, java.lang.String randomHash, java.util.Date createdDate, java.util.Date lastAccessedDate)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.Date getCreatedDate()
           
 long getDirectoryId()
          Directory the user originated, -1 if the token is for an application.
 java.lang.Long getId()
           
 java.lang.String getIdentifierHash()
           
 java.util.Date getLastAccessedDate()
           
 java.lang.String getName()
          Gets the name of the entity.
 java.lang.String getRandomHash()
          Gets the token key.
 long getRandomNumber()
           
 int hashCode()
           
 boolean isApplicationToken()
           
 boolean isUserToken()
           
 void setLastAccessedDate(java.util.Date lastAccessedDate)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_TOKEN_DIRECTORY_ID

public static final long APPLICATION_TOKEN_DIRECTORY_ID
Tokens are used for application clients and principals. If the stored token does not have a valid directory ID, the token is then for an application. The value for an invalid directory ID is the APPLICATION_TOKEN_DIRECTORY_ID value.

See Also:
Constant Field Values
Constructor Detail

Token

public Token(long directoryId,
             java.lang.String name,
             java.lang.String identifierHash,
             long randomNumber,
             java.lang.String randomHash)

Token

public Token(long directoryId,
             java.lang.String name,
             java.lang.String identifierHash,
             long randomNumber,
             java.lang.String randomHash,
             java.util.Date createdDate,
             java.util.Date lastAccessedDate)
Method Detail

getId

public java.lang.Long getId()

getRandomHash

public java.lang.String getRandomHash()
Gets the token key.

Returns:
The key.

getName

public java.lang.String getName()
Gets the name of the entity.

Returns:
The name.

getDirectoryId

public long getDirectoryId()
Directory the user originated, -1 if the token is for an application.

Returns:
The directory ID.

getRandomNumber

public long getRandomNumber()

isUserToken

public boolean isUserToken()

isApplicationToken

public boolean isApplicationToken()

getCreatedDate

public java.util.Date getCreatedDate()

getLastAccessedDate

public java.util.Date getLastAccessedDate()

setLastAccessedDate

public void setLastAccessedDate(java.util.Date lastAccessedDate)

getIdentifierHash

public java.lang.String getIdentifierHash()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2010 Atlassian. All Rights Reserved.