Package com.adaptris.core.jwt
Class JWTEncoder
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.jwt.JWTEncoder
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Encode a header and body to a JSON Web Token", tag="jwt,encode,json,web,token", since="3.11.1") public class JWTEncoder extends ServiceImp
This service provides a way to encode data as a JSON Web Token.<jwt-encode> <unique-id>jwt-encode</unique-id> <header class="multi-payload-string-input-parameter"> <payload-id>header</payload-id> </header> <claims class="multi-payload-string-input-parameter"> <payload-id>claims</payload-id> </claims> <secret class="base64-encoded-secret"> <secret>c64975ba3cf3f9cd58459710b0a42369f34b0759c9967fb5a47eea488e8bea79</secret> </secret> <jwt-output class="multi-payload-string-output-parameter"> <payload-id>output</payload-id> </jwt-output> </jwt-encode>
In the adapter configuration file this class is aliased as jwt-encode which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description JWTEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeService()
.void
doService(AdaptrisMessage message)
.DataInputParameter<java.lang.String>
getClaims()
DataInputParameter<java.lang.String>
getHeader()
DataOutputParameter<java.lang.String>
getJwtOutput()
SecretConfigurator
getSecret()
protected void
initService()
.void
prepare()
.void
setClaims(DataInputParameter<java.lang.String> claims)
void
setHeader(DataInputParameter<java.lang.String> header)
void
setJwtOutput(DataOutputParameter<java.lang.String> jwtOutput)
void
setSecret(SecretConfigurator secret)
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage message) throws ServiceException
.- Throws:
ServiceException
-
initService
protected void initService()
.- Specified by:
initService
in classServiceImp
-
closeService
protected void closeService()
.- Specified by:
closeService
in classServiceImp
-
prepare
public void prepare()
.
-
getHeader
public DataInputParameter<java.lang.String> getHeader()
-
setHeader
public void setHeader(DataInputParameter<java.lang.String> header)
-
getClaims
public DataInputParameter<java.lang.String> getClaims()
-
setClaims
public void setClaims(DataInputParameter<java.lang.String> claims)
-
getSecret
public SecretConfigurator getSecret()
-
setSecret
public void setSecret(SecretConfigurator secret)
-
getJwtOutput
public DataOutputParameter<java.lang.String> getJwtOutput()
-
setJwtOutput
public void setJwtOutput(DataOutputParameter<java.lang.String> jwtOutput)
-
-