Package com.adaptris.core.http.oauth
Class MetadataAccessTokenWriter
- java.lang.Object
-
- com.adaptris.core.http.oauth.MetadataAccessTokenWriter
-
- All Implemented Interfaces:
ComponentLifecycle
,AccessTokenWriter
@ComponentProfile(summary="Write the OAUTH token to metadata", since="3.10.1") public class MetadataAccessTokenWriter extends java.lang.Object implements AccessTokenWriter
Write the token to metadata.In the adapter configuration file this class is aliased as oauth-access-token-to-metadata which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description MetadataAccessTokenWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(AccessToken token, AdaptrisMessage msg)
Apply the token to the message.java.lang.String
getRefreshTokenKey()
java.lang.String
getTokenExpiryKey()
java.lang.String
getTokenKey()
void
setRefreshTokenKey(java.lang.String key)
Set the metadata key for storing the refresh token.void
setTokenExpiryKey(java.lang.String key)
Set the metadata key for storing the expiry.void
setTokenKey(java.lang.String key)
Set the metadata to store the token against.MetadataAccessTokenWriter
withRefreshTokenKey(java.lang.String refreshMetadataKey)
MetadataAccessTokenWriter
withTokenExpiryKey(java.lang.String b)
MetadataAccessTokenWriter
withTokenKey(java.lang.String b)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
-
-
-
Method Detail
-
apply
public void apply(AccessToken token, AdaptrisMessage msg)
Description copied from interface:AccessTokenWriter
Apply the token to the message.- Specified by:
apply
in interfaceAccessTokenWriter
-
withTokenKey
public MetadataAccessTokenWriter withTokenKey(java.lang.String b)
-
getTokenKey
public java.lang.String getTokenKey()
-
setTokenKey
public void setTokenKey(java.lang.String key)
Set the metadata to store the token against.- Parameters:
key
- the key.
-
withTokenExpiryKey
public MetadataAccessTokenWriter withTokenExpiryKey(java.lang.String b)
-
getTokenExpiryKey
public java.lang.String getTokenExpiryKey()
-
setTokenExpiryKey
public void setTokenExpiryKey(java.lang.String key)
Set the metadata key for storing the expiry.In some cases, there is no expiry date for a token, in which case, the metadata key will never be set even if configured. Depending on how you have configured your expiry token, this might be an absolute ISO8601 date, or relative time in seconds.
- Parameters:
key
- key.
-
withRefreshTokenKey
public MetadataAccessTokenWriter withRefreshTokenKey(java.lang.String refreshMetadataKey)
-
getRefreshTokenKey
public java.lang.String getRefreshTokenKey()
-
setRefreshTokenKey
public void setRefreshTokenKey(java.lang.String key)
Set the metadata key for storing the refresh token.In some cases, there is no refresh token, in which case, the metadata key will never be set even if configured.
- Parameters:
key
- key.
-
-