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
Direct Known Subclasses:
ClientAccessToken, ServerAccessToken

public abstract class AccessToken
extends Object

Base Access Token representation


Constructor Summary
protected AccessToken(String tokenType, String tokenKey)
           
protected AccessToken(String tokenType, String tokenKey, long expiresIn, long issuedAt)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessToken

protected AccessToken(String tokenType,
                      String tokenKey)

AccessToken

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

getTokenType

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

Returns:
the type

getTokenKey

public String getTokenKey()
Returns the token key

Returns:
the 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