Package org.apache.rahas
Class Token
java.lang.Object
org.apache.rahas.Token
- All Implemented Interfaces:
Externalizable,Serializable
- Direct Known Subclasses:
EncryptedKeyToken
This represents a security token which can have either one of 4 states.
- ISSUED
- EXPIRED
- CACELLED
- RENEWED
OMElements representing the token in its
present state and the previous state.
These tokens are stored using the storage mechanism provided via the TokenStorage interface.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.axiom.om.OMElementgetId()org.apache.axiom.om.OMElementbyte[]intgetState()org.apache.axiom.om.OMElementgetToken()org.apache.axiom.om.OMElementbooleanvoidImplementing de-serialization logic in accordance with the serialization logic.voidsetAttachedReference(org.apache.axiom.om.OMElement attachedReference) voidsetChanged(boolean chnaged) voidsetExpires(Date expires) voidsetIssuerAddress(String issuerAddress) voidsetPreviousToken(org.apache.axiom.om.OMElement presivousToken) voidsetProperties(Properties properties) voidsetSecret(byte[] secret) voidsetState(int state) voidsetToken(org.apache.axiom.om.OMElement token) voidsetUnattachedReference(org.apache.axiom.om.OMElement unattachedReference) voidImplementing serialize logic according to our own protocol.
-
Field Details
-
ISSUED
public static final int ISSUED- See Also:
-
EXPIRED
public static final int EXPIRED- See Also:
-
CANCELLED
public static final int CANCELLED- See Also:
-
RENEWED
public static final int RENEWED- See Also:
-
-
Constructor Details
-
Token
public Token() -
Token
-
Token
public Token(String id, org.apache.axiom.om.OMElement tokenElem, Date created, Date expires) throws TrustException - Throws:
TrustException
-
Token
public Token(String id, org.apache.axiom.om.OMElement tokenElem, org.apache.axiom.om.OMElement lifetimeElem) throws TrustException - Throws:
TrustException
-
-
Method Details
-
isChanged
public boolean isChanged()- Returns:
- Returns the changed.
-
setChanged
public void setChanged(boolean chnaged) - Parameters:
chnaged- The changed to set.
-
getProperties
- Returns:
- Returns the properties.
-
setProperties
- Parameters:
properties- The properties to set.
-
getState
public int getState()- Returns:
- Returns the state.
-
setState
public void setState(int state) - Parameters:
state- The state to set.
-
getToken
public org.apache.axiom.om.OMElement getToken()- Returns:
- Returns the token.
-
setToken
public void setToken(org.apache.axiom.om.OMElement token) - Parameters:
token- The token to set.
-
getId
- Returns:
- Returns the id.
-
getPreviousToken
public org.apache.axiom.om.OMElement getPreviousToken()- Returns:
- Returns the presivousToken.
-
setPreviousToken
public void setPreviousToken(org.apache.axiom.om.OMElement presivousToken) - Parameters:
presivousToken- The presivousToken to set.
-
getSecret
public byte[] getSecret()- Returns:
- Returns the secret.
-
setSecret
public void setSecret(byte[] secret) - Parameters:
secret- The secret to set.
-
getAttachedReference
public org.apache.axiom.om.OMElement getAttachedReference()- Returns:
- Returns the attachedReference.
-
setAttachedReference
public void setAttachedReference(org.apache.axiom.om.OMElement attachedReference) - Parameters:
attachedReference- The attachedReference to set.
-
getUnattachedReference
public org.apache.axiom.om.OMElement getUnattachedReference()- Returns:
- Returns the unattachedReference.
-
setUnattachedReference
public void setUnattachedReference(org.apache.axiom.om.OMElement unattachedReference) - Parameters:
unattachedReference- The unattachedReference to set.
-
getCreated
- Returns:
- Returns the created.
-
getExpires
- Returns:
- Returns the expires.
-
setExpires
- Parameters:
expires- The expires to set.
-
getIssuerAddress
-
setIssuerAddress
-
writeExternal
Implementing serialize logic according to our own protocol. We had to follow this, because OMElement class is not serializable. Making OMElement serializable will have an huge impact on other components. Therefore implementing serialization logic according to a manual protocol.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- Stream which writes serialized bytes.- Throws:
IOException- If unable to serialize particular member.
-
readExternal
Implementing de-serialization logic in accordance with the serialization logic.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- Stream which used to read data.- Throws:
IOException- If unable to de-serialize particular data member.ClassNotFoundException
-