Apache CXF API

org.apache.cxf.rs.security.oauth2.common
Class AccessToken

java.lang.Object
  extended by org.apache.cxf.rs.security.oauth2.common.AccessToken
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ClientAccessToken, ServerAccessToken

public abstract class AccessToken
extends Object
implements Serializable

Base Access Token representation

See Also:
Serialized Form

Constructor Summary
protected AccessToken()
           
protected AccessToken(String tokenType, String tokenKey)
           
protected AccessToken(String tokenType, String tokenKey, long expiresIn, long issuedAt)
           
protected AccessToken(String tokenType, String tokenKey, long expiresIn, long issuedAt, String refreshToken, Map<String,String> parameters)
           
 
Method Summary
 long getExpiresIn()
          The token lifetime
 long getIssuedAt()
           
 Map<String,String> getParameters()
          Gets token parameters
 String getRefreshToken()
          Gets the refresh token key the client can use to obtain a new access token
 String getTokenKey()
          Returns the token key
 String getTokenType()
          Returns the token type such as bearer, mac, etc
 void setExpiresIn(long expiresIn)
           
 void setIssuedAt(long issuedAt)
           
 void setParameters(Map<String,String> parameters)
          Sets additional token parameters
 void setRefreshToken(String refreshToken)
          Sets the refresh token key the client can use to obtain a new access token
 void setTokenKey(String key)
           
 void setTokenType(String type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessToken

protected AccessToken()

AccessToken

protected AccessToken(String tokenType,
                      String tokenKey)

AccessToken

protected AccessToken(String tokenType,
                      String tokenKey,
                      long expiresIn,
                      long issuedAt)

AccessToken

protected AccessToken(String tokenType,
                      String tokenKey,
                      long expiresIn,
                      long issuedAt,
                      String refreshToken,
                      Map<String,String> parameters)
Method Detail

getTokenType

public String getTokenType()
Returns the token type such as bearer, mac, etc

Returns:
the type

setTokenType

public void setTokenType(String type)

getTokenKey

public String getTokenKey()
Returns the token key

Returns:
the key

setTokenKey

public void setTokenKey(String key)

setRefreshToken

public void setRefreshToken(String refreshToken)
Sets the refresh token key the client can use to obtain a new access token

Parameters:
refreshToken - the refresh token

getRefreshToken

public String getRefreshToken()
Gets the refresh token key the client can use to obtain a new access token

Returns:
the refresh token

getParameters

public Map<String,String> getParameters()
Gets token parameters

Returns:

getExpiresIn

public long getExpiresIn()
The token lifetime

Returns:
the lifetime, -1 means no 'expires_in' parameter was returned

setExpiresIn

public void setExpiresIn(long expiresIn)

getIssuedAt

public long getIssuedAt()

setIssuedAt

public void setIssuedAt(long issuedAt)

setParameters

public void setParameters(Map<String,String> parameters)
Sets additional token parameters

Parameters:
parameters - the token parameters

Apache CXF API

Apache CXF