@ComponentProfile(summary="Write the OAUTH token to metadata", since="3.10.1") public class MetadataAccessTokenWriter extends java.lang.Object implements AccessTokenWriter
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 and Description |
---|
MetadataAccessTokenWriter() |
Modifier and Type | Method and 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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, init, start, stop
public void apply(AccessToken token, AdaptrisMessage msg)
AccessTokenWriter
apply
in interface AccessTokenWriter
public MetadataAccessTokenWriter withTokenKey(java.lang.String b)
public java.lang.String getTokenKey()
public void setTokenKey(java.lang.String key)
key
- the key.public MetadataAccessTokenWriter withTokenExpiryKey(java.lang.String b)
public java.lang.String getTokenExpiryKey()
public void setTokenExpiryKey(java.lang.String key)
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.
key
- key.public MetadataAccessTokenWriter withRefreshTokenKey(java.lang.String refreshMetadataKey)
public java.lang.String getRefreshTokenKey()
public void setRefreshTokenKey(java.lang.String key)
In some cases, there is no refresh token, in which case, the metadata key will never be set even if configured.
key
- key.