Package com.highdeal.hci
Class SimpleMessageAuthentication
java.lang.Object
com.highdeal.hci.SimpleMessageAuthentication
- All Implemented Interfaces:
MessageAuthentication,XMLMarshallable
This class represents the authentication data used for the "simple" schema, that is a password.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="auth">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="scheme" type="xs:string" default="simple"/>
</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 SimpleMessageAuthentication.
The methodsetPassword(String)must be invoked to be valid.SimpleMessageAuthentication(String password) Initializes a Simple Message Authentication with a password. -
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 an encrypted password as authentication data.Returns a password as authentication data.Returns the authentication scheme defined in this class: "simple".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.voidsetPassword(String pw) Sets the password for this message authentication.
-
Constructor Details
-
SimpleMessageAuthentication
public SimpleMessageAuthentication()Initializes an empty SimpleMessageAuthentication.
The methodsetPassword(String)must be invoked to be valid. -
SimpleMessageAuthentication
Initializes a Simple Message Authentication with a password.- Parameters:
password- The password to be authenticated
-
-
Method Details
-
getScheme
Returns the authentication scheme defined in this class: "simple".- Specified by:
getSchemein interfaceMessageAuthentication- Returns:
- "simple"
-
getPassword
Returns a password as authentication data.- Returns:
- A password for authentication
-
getEncryptedPassword
Returns an encrypted password as authentication data.- Returns:
- An encrypted password for authentication
-
setPassword
Sets the password for this message authentication.- Parameters:
pw- The password 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
-