public class AccessToken extends Object implements Externalizable
Constructor and Description |
---|
AccessToken() |
AccessToken(String token,
String expires)
Constructor with parameters
|
AccessToken(String token,
String expires,
String refreshToken)
Constructor with parameters
|
AccessToken(String token,
String expires,
String refreshToken,
String identityToken)
Constructor with parameters
|
Modifier and Type | Method and Description |
---|---|
static AccessToken |
createWithExpiryDate(String token,
Date expiryDate) |
boolean |
equals(Object obj) |
void |
externalize(DataOutputStream out)
Allows us to store an object state, this method must be implemented
in order to save the state of an object
|
String |
getExpires()
Simple getter
|
Date |
getExpiryDate()
Gets the expiry date of this token.
|
String |
getIdentityToken() |
String |
getObjectId()
The object id must be unique, it is used to identify the object when loaded
even when it is obfuscated.
|
String |
getRefreshToken()
Gets refresh token.
|
String |
getToken()
Simple getter
|
int |
getVersion()
Returns 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
|
int |
hashCode() |
void |
internalize(int version,
DataInputStream in)
Loads the object from the input stream and allows deserialization
|
boolean |
isExpired()
Checks to see if this token is expired.
|
void |
setExpiryDate(Date date)
Sets the expiry date of this token.
|
void |
setIdentityToken(String identityToken) |
void |
setRefreshToken(String refreshToken)
Sets refresh token.
|
String |
toString() |
public AccessToken(String token, String expires)
token
- the token stringexpires
- the access token expires datepublic AccessToken(String token, String expires, String refreshToken)
token
- the token stringexpires
- the access token expires daterefreshToken
- The refresh token.public AccessToken(String token, String expires, String refreshToken, String identityToken)
token
- the token stringexpires
- the access token expires daterefreshToken
- The refresh token.identityToken
- The identity tokenpublic AccessToken()
public static AccessToken createWithExpiryDate(String token, Date expiryDate)
Token
- The token.expiryDate
- The expiry date.public String getToken()
public String getExpires()
public int getVersion()
Externalizable
getVersion
in interface Externalizable
public void externalize(DataOutputStream out) throws IOException
Externalizable
externalize
in interface Externalizable
out
- the stream into which the object must be serializedIOException
- the method may throw an exceptionpublic void internalize(int version, DataInputStream in) throws IOException
Externalizable
internalize
in interface Externalizable
version
- the version the class returned during the externalization processsin
- the input stream used to load the classIOException
- the method may throw an exceptionpublic String getRefreshToken()
public void setRefreshToken(String refreshToken)
refreshToken
- The refresh token.public String getObjectId()
Externalizable
getObjectId
in interface Externalizable
public Date getExpiryDate()
public void setExpiryDate(Date date)
date
- The expiry date of this token.public boolean isExpired()
public String getIdentityToken()
public void setIdentityToken(String identityToken)
identityToken
- the identityToken to setCopyright © 2022. All rights reserved.