com.atlassian.crowd.model.token
Class Token

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

public class Token
extends Object
implements Serializable

Holds the token information for an authenticated entity.

See Also:
Serialized Form

Nested Class Summary
static class Token.Builder
           
 
Field Summary
static long APPLICATION_TOKEN_DIRECTORY_ID
          Tokens are used for application clients and principals.
 
Method Summary
 boolean equals(Object o)
           
 Date getCreatedDate()
           
 long getDirectoryId()
          Directory the user originated, -1 if the token is for an application.
 Long getId()
           
 String getIdentifierHash()
           
 long getLastAccessedTime()
           
 TokenLifetime getLifetime()
           
 String getName()
          Gets the name of the entity.
 String getRandomHash()
          Gets the token key.
 long getRandomNumber()
           
 int hashCode()
           
 boolean isApplicationToken()
           
 boolean isUserToken()
           
 void setLastAccessedTime(long lastAccessedTime)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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
Method Detail

getId

public Long getId()

getRandomHash

public String getRandomHash()
Gets the token key.

Returns:
The key.

getName

public 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 Date getCreatedDate()

getLastAccessedTime

public long getLastAccessedTime()

setLastAccessedTime

public void setLastAccessedTime(long lastAccessedTime)

getLifetime

public TokenLifetime getLifetime()
Returns:
requested lifetime of the token

getIdentifierHash

public String getIdentifierHash()

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Atlassian. All Rights Reserved.