Class AccessToken
- All Implemented Interfaces:
Externalizable
-
Constructor Summary
ConstructorsConstructorDescriptionSince
AccessToken(String token, String expires) Constructor with parametersAccessToken(String token, String expires, String refreshToken) Constructor with parametersAccessToken(String token, String expires, String refreshToken, String identityToken) Constructor with parameters -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessTokencreateWithExpiryDate(String token, Date expiryDate) Parameters
booleanvoidAllows us to store an object state, this method must be implemented in order to save the state of an objectSimple getterGets the expiry date of this token.Returns
The object id must be unique, it is used to identify the object when loaded even when it is obfuscated.Gets refresh token.getToken()Simple getterintReturns the version for the current persistance code, the version will be pased to internalized thus allowing the internalize method to recognize classes persisted in older revisionsinthashCode()voidinternalize(int version, DataInputStream in) Loads the object from the input stream and allows deserializationbooleanChecks to see if this token is expired.voidsetExpiryDate(Date date) Sets the expiry date of this token.voidsetIdentityToken(String identityToken) Parameters
voidsetRefreshToken(String refreshToken) Sets refresh token.toString()
-
Constructor Details
-
AccessToken
-
AccessToken
-
AccessToken
-
AccessToken
public AccessToken()Since
7.0
-
-
Method Details
-
createWithExpiryDate
Parameters
-
Token: The token. -
expiryDate: The expiry date.
Since
7.0
-
-
getToken
Simple getter
Returns
the token string
-
getExpires
Simple getter
Returns
the expires date
-
getVersion
public int getVersion()Description copied from interface:ExternalizableReturns the version for the current persistance code, the version will be pased to internalized thus allowing the internalize method to recognize classes persisted in older revisions
Returns
version number for the persistant code
- Specified by:
getVersionin interfaceExternalizable
-
externalize
Description copied from interface:ExternalizableAllows us to store an object state, this method must be implemented in order to save the state of an object
Parameters
out: the stream into which the object must be serialized
Throws
java.io.IOException: the method may throw an exception
- Specified by:
externalizein interfaceExternalizable- Throws:
IOException
-
internalize
Description copied from interface:ExternalizableLoads the object from the input stream and allows deserialization
Parameters
-
version: the version the class returned during the externalization processs -
in: the input stream used to load the class
Throws
java.io.IOException: the method may throw an exception
- Specified by:
internalizein interfaceExternalizable- Throws:
IOException
-
-
getRefreshToken
Gets refresh token.
Returns
Refresh token.
Since
7.0
-
setRefreshToken
Sets refresh token.
Parameters
refreshToken: The refresh token.
Since
7.0
-
getObjectId
Description copied from interface:ExternalizableThe object id must be unique, it is used to identify the object when loaded even when it is obfuscated.
Returns
a unique id
- Specified by:
getObjectIdin interfaceExternalizable
-
equals
-
hashCode
-
toString
-
getExpiryDate
Gets the expiry date of this token.
Returns
The expiry date of this token or null.
Since
7.0
-
setExpiryDate
Sets the expiry date of this token.
Parameters
date: The expiry date of this token.
Since
7.0
-
isExpired
public boolean isExpired()Checks to see if this token is expired.
Returns
False if no expiry date is set or the expiryDate is before the current time.
Since
7.0
-
getIdentityToken
Returns
the identityToken
Since
7.0
-
setIdentityToken
Parameters
identityToken: the identityToken to set
Since
7.0
-