public class OCSClient extends Object implements org.mule.runtime.api.lifecycle.Stoppable
This client uses the Client Credentials grant type to OAuth into the Anypoint Platform in order to access the OCS API.
| Modifier and Type | Class and Description |
|---|---|
static class |
OCSClient.OCSClientFactory |
| Modifier and Type | Field and Description |
|---|---|
static String |
REVISION_TOKEN_QUERY_PARAM |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<org.mule.runtime.http.api.domain.message.response.HttpResponse> |
getAccessToken(String connectionUri)
Gets the access token for the given
connectionUri |
CompletableFuture<org.mule.runtime.oauth.api.PlatformManagedConnectionDescriptor> |
getConnectionDescriptor(String connectionUri)
Obtains a
PlatformManagedConnectionDescriptor describing the connection of the given connectionUri |
static OCSClient.OCSClientFactory |
getFactory() |
CompletableFuture<org.mule.runtime.http.api.domain.message.response.HttpResponse> |
refreshToken(String connectionUri,
String revisionToken)
Refreshes the token for the given
connectionUri |
void |
stop() |
public static final String REVISION_TOKEN_QUERY_PARAM
public static OCSClient.OCSClientFactory getFactory()
public void stop()
throws org.mule.runtime.api.exception.MuleException
stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleExceptionpublic CompletableFuture<org.mule.runtime.http.api.domain.message.response.HttpResponse> getAccessToken(String connectionUri) throws org.mule.runtime.oauth.api.exception.RequestAuthenticationException
connectionUriconnectionUri - the uri of the connection which token we wantCompletableFuture with the obtained HttpResponseorg.mule.runtime.oauth.api.exception.RequestAuthenticationException - in case of failure to OAuth into the Anypoint Platformpublic CompletableFuture<org.mule.runtime.http.api.domain.message.response.HttpResponse> refreshToken(String connectionUri, String revisionToken) throws org.mule.runtime.oauth.api.exception.RequestAuthenticationException
connectionUriconnectionUri - the uri of the connection which token we want to refreshrevisionToken - the revision token of the token being refreshedCompletableFuture with the obtained HttpResponseorg.mule.runtime.oauth.api.exception.RequestAuthenticationException - in case of failure to OAuth into the Anypoint Platformpublic CompletableFuture<org.mule.runtime.oauth.api.PlatformManagedConnectionDescriptor> getConnectionDescriptor(String connectionUri) throws org.mule.runtime.oauth.api.exception.RequestAuthenticationException
PlatformManagedConnectionDescriptor describing the connection of the given connectionUriconnectionUri - the uri of the connection which informatiton we seekCompletableFuture with the obtained RequestAuthenticationExceptionorg.mule.runtime.oauth.api.exception.RequestAuthenticationException - in case of failure to OAuth into the Anypoint PlatformCopyright © 2003–2024 MuleSoft, Inc.. All rights reserved.