public abstract class AbstractTokenRequestHandler extends Object implements org.mule.runtime.api.lifecycle.Initialisable, org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable, MuleContextAware
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractTokenRequestHandler.TokenResponse |
protected class |
AbstractTokenRequestHandler.TokenUrlResponseException |
| Modifier and Type | Field and Description |
|---|---|
protected MuleContext |
muleContext |
protected List<ParameterExtractor> |
parameterExtractors |
protected org.mule.runtime.extension.api.runtime.operation.ParameterResolver<String> |
responseAccessToken
MEL expression to extract the access token parameter from the response of the call to tokenUrl.
|
protected org.mule.runtime.extension.api.runtime.operation.ParameterResolver<String> |
responseExpiresIn
MEL expression to extract the expiresIn parameter from the response of the call to tokenUrl.
|
protected org.mule.runtime.extension.api.runtime.operation.ParameterResolver<String> |
responseRefreshToken |
| Constructor and Description |
|---|
AbstractTokenRequestHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected MuleContext |
getMuleContext() |
org.mule.runtime.extension.api.runtime.operation.ParameterResolver<Boolean> |
getRefreshTokenWhen() |
protected String |
getTokenUrl() |
void |
initialise() |
protected org.mule.runtime.extension.api.runtime.operation.Result<Object,HttpResponseAttributes> |
invokeTokenUrl(Map<String,String> tokenRequestFormToSend,
String authorization) |
protected boolean |
isEmpty(String value) |
AbstractTokenRequestHandler.TokenResponse |
processTokenResponse(org.mule.runtime.extension.api.runtime.operation.Result<Object,HttpResponseAttributes> tokenUrlResponse,
boolean retrieveRefreshToken) |
void |
setMuleContext(MuleContext context) |
void |
setTlsContextFactory(org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory) |
void |
setTokenUrl(String tokenUrl) |
void |
start() |
void |
stop() |
protected boolean |
tokenResponseContentIsValid(AbstractTokenRequestHandler.TokenResponse response) |
protected MuleContext muleContext
@Parameter @Optional(defaultValue="#[(payload match /.*\"access_token\"[ ]*:[ ]*\"([^\\\"]*)\".*/)[1]]") protected org.mule.runtime.extension.api.runtime.operation.ParameterResolver<String> responseAccessToken
@Parameter @Optional(defaultValue="#[(payload match /.*\"refresh_token\"[ ]*:[ ]*\"([^\\\"]*)\".*/)[1]]") protected org.mule.runtime.extension.api.runtime.operation.ParameterResolver<String> responseRefreshToken
@Parameter @Optional(defaultValue="#[(payload match /.*\"expires_in\"[ ]*:[ ]*\"([^\\\"]*)\".*/)[1]]") protected org.mule.runtime.extension.api.runtime.operation.ParameterResolver<String> responseExpiresIn
@Parameter @Alias(value="custom-parameter-extractors") @Optional protected List<ParameterExtractor> parameterExtractors
public org.mule.runtime.extension.api.runtime.operation.ParameterResolver<Boolean> getRefreshTokenWhen()
protected MuleContext getMuleContext()
public void setTokenUrl(String tokenUrl)
public void setTlsContextFactory(org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
protected org.mule.runtime.extension.api.runtime.operation.Result<Object,HttpResponseAttributes> invokeTokenUrl(Map<String,String> tokenRequestFormToSend, String authorization) throws org.mule.runtime.api.exception.MuleException, AbstractTokenRequestHandler.TokenUrlResponseException
org.mule.runtime.api.exception.MuleExceptionAbstractTokenRequestHandler.TokenUrlResponseExceptionprotected String getTokenUrl()
public AbstractTokenRequestHandler.TokenResponse processTokenResponse(org.mule.runtime.extension.api.runtime.operation.Result<Object,HttpResponseAttributes> tokenUrlResponse, boolean retrieveRefreshToken)
protected boolean tokenResponseContentIsValid(AbstractTokenRequestHandler.TokenResponse response)
protected boolean isEmpty(String value)
public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void start()
start in interface org.mule.runtime.api.lifecycle.Startablepublic void stop()
stop in interface org.mule.runtime.api.lifecycle.Stoppablepublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwareCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.