Package com.highdeal.hci
Class JWTMessageAuthentication
java.lang.Object
com.highdeal.hci.JWTMessageAuthentication
- All Implemented Interfaces:
MessageAuthentication,XMLMarshallable
This class represents the authentication data used for the "jwt" schema, that is a token.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="authToken">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="scheme" type="xs:string" default="jwt"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.highdeal.hci.MessageAuthentication
MessageAuthentication.MessageAuthScheme -
Constructor Summary
ConstructorsConstructorDescriptionInitializes an empty JWTMessageAuthentication.
The methodsetJwtToken(String)must be invoked to be valid.JWTMessageAuthentication(String jwtToken) Initializes a JWT Message Authentication with a JWT token. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the objects, thechildrepresents the marshallable object to be added into the content tree.Returns a jwt token as authentication data.Returns the authentication scheme defined in this class: MessageAuthScheme.JWT.voidmarshal(XMLOutputter output) Gives an XML representation of this object, and of its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the tag being processed.voidsetJwtToken(String jwtToken) Sets the JWT token for this message authentication.
-
Constructor Details
-
JWTMessageAuthentication
public JWTMessageAuthentication()Initializes an empty JWTMessageAuthentication.
The methodsetJwtToken(String)must be invoked to be valid. -
JWTMessageAuthentication
Initializes a JWT Message Authentication with a JWT token.- Parameters:
jwtToken- The jwt token used to be authenticated
-
-
Method Details
-
getScheme
Returns the authentication scheme defined in this class: MessageAuthScheme.JWT.- Specified by:
getSchemein interfaceMessageAuthentication- Returns:
- MessageAuthScheme.JWT
-
getJwtToken
Returns a jwt token as authentication data.- Returns:
- A jwt token for authentication
-
setJwtToken
Sets the JWT token for this message authentication.- Parameters:
jwtToken- The JWT token for this message authentication
-
setAttributes
Sets the attributes of the XML representation of the tag being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- The XML attributes of the current tag
-
addChild
Adds a child to the objects, thechildrepresents the marshallable object to be added into the content tree.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
addCharacterData
Adds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Gives an XML representation of this object, and of its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- The XML output to marshall the object into
-