Module org.mule.oauth.client.api
Package org.mule.oauth.client.api.state
Interface ResourceOwnerOAuthContext
-
- All Known Implementing Classes:
ResourceOwnerOAuthContextWithRefreshState
@NoImplement public interface ResourceOwnerOAuthContextOAuth state for a particular resource owner, which typically represents an user.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_RESOURCE_OWNER_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAccessToken()DancerStategetDancerState()StringgetExpiresIn()LockgetRefreshOAuthContextLock(String lockNamePrefix, org.mule.runtime.api.lock.LockFactory lockFactory)Obtains a lock to avoid triggering a refresh of the context more than once simultaneously.StringgetRefreshToken()StringgetResourceOwnerId()StringgetState()Map<String,Object>getTokenResponseParameters()voidsetDancerState(DancerState dancerState)Updates the state of the dancer for this context.
-
-
-
Field Detail
-
DEFAULT_RESOURCE_OWNER_ID
static final String DEFAULT_RESOURCE_OWNER_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAccessToken
String getAccessToken()
- Returns:
- access token of the oauth context retrieved by the token request
-
getRefreshToken
String getRefreshToken()
- Returns:
- refresh token of the oauth context retrieved by the token request
-
getState
String getState()
- Returns:
- state of the oauth context send in the authorization request
-
getExpiresIn
String getExpiresIn()
- Returns:
- expires in value retrieved by the token request.
-
getTokenResponseParameters
Map<String,Object> getTokenResponseParameters()
- Returns:
- custom token request response parameters configured for extraction.
-
getResourceOwnerId
String getResourceOwnerId()
- Returns:
- id for the oauth state.
-
getDancerState
DancerState getDancerState()
- Returns:
- the state of the dance for the resource owner of this context.
-
setDancerState
void setDancerState(DancerState dancerState)
Updates the state of the dancer for this context.Note that calling this just updates the internal state of this object. Calling this method does not persist this change in any store. That has to be done explicitly after calling this method.
- Parameters:
dancerState- the state of the dance for the resource owner of this context.
-
getRefreshOAuthContextLock
Lock getRefreshOAuthContextLock(String lockNamePrefix, org.mule.runtime.api.lock.LockFactory lockFactory)
Obtains a lock to avoid triggering a refresh of the context more than once simultaneously.- Parameters:
lockNamePrefix- a prefix to uniquely identify the locks in the providedlockFactory.lockFactory- the object to get the locks from. This will ensure that the same lock instance is used after serialization/deserialization of this context.- Returns:
- a lock that can be used to avoid concurrency problems trying to update oauth context.
-
-