Package com.iizix.server.oauth
Class AccessToken
java.lang.Object
com.iizix.server.oauth.AccessToken
The access token wrapper for OAuth 2.0 and OAuth 1.0a access tokens.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescription- AccessToken- (com.github.scribejava.core.model.OAuth1AccessToken accessToken1, com.github.scribejava.core.model.OAuth1RequestToken requestToken) Constructs the access token for OAuth 1.0a.- AccessToken- (com.github.scribejava.core.model.OAuth2AccessToken accessToken2) Constructs the access token for OAuth 2.0.
- Method SummaryModifier and TypeMethodDescription- booleanReturns if two access tokens are equal.Returns the access token.- longGets the expiry date.- int- hashCode()Gets the hash code.- boolean- isValid- (long additionalTime) Checks if the access token would expire within the requested additional time, e.g.- toString()Gets a String.
- Constructor Details- AccessTokenpublic AccessToken- (com.github.scribejava.core.model.OAuth2AccessToken accessToken2) Constructs the access token for OAuth 2.0.- Parameters:
- accessToken2- The access token.
- Throws:
- NullPointerException- If the {code accessToken2} parameter is null.
 
- AccessTokenpublic AccessToken- (com.github.scribejava.core.model.OAuth1AccessToken accessToken1, com.github.scribejava.core.model.OAuth1RequestToken requestToken) Constructs the access token for OAuth 1.0a.- Parameters:
- accessToken1- The access token.
- requestToken- The request token used to get the access token.
- Throws:
- NullPointerException- If the {code accessToken1} or {code requestToken} parameter is null.
 
 
- Method Details- isValidpublic boolean isValid- (long additionalTime) Checks if the access token would expire within the requested additional time, e.g. 20_000 ms (20 seconds) that an operation would require to run.- Returns:
- true If the access token has expired or would expire, false if it's OK to use it.
 
- getExpiresTimepublic long getExpiresTime()Gets the expiry date.- Returns:
- The access token expiry time in milliseconds since the epoch, zero if unknown.
 
- getAccessTokenReturns the access token.- Returns:
- The access token String.
 
- hashCodepublic int hashCode()Gets the hash code.
- equalsReturns if two access tokens are equal.
- toStringGets a String.