Class SimpleMessageAuthentication

java.lang.Object
com.highdeal.hci.SimpleMessageAuthentication
All Implemented Interfaces:
MessageAuthentication, XMLMarshallable

public class SimpleMessageAuthentication extends Object implements MessageAuthentication
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>

  • Constructor Details

    • SimpleMessageAuthentication

      public SimpleMessageAuthentication()
      Initializes an empty SimpleMessageAuthentication.
      The method setPassword(String) must be invoked to be valid.
    • SimpleMessageAuthentication

      public SimpleMessageAuthentication(String password)
      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:
      getScheme in interface MessageAuthentication
      Returns:
      "simple"
    • getPassword

      public String getPassword()
      Returns a password as authentication data.
      Returns:
      A password for authentication
    • getEncryptedPassword

      public String getEncryptedPassword()
      Returns an encrypted password as authentication data.
      Returns:
      An encrypted password for authentication
    • setPassword

      public void setPassword(String pw)
      Sets the password for this message authentication.
      Parameters:
      pw - The password for this message authentication
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Sets the attributes of the XML representation of the tag being processed.
      Specified by:
      setAttributes in interface XMLMarshallable
      Parameters:
      atts - The XML attributes of the current tag
    • addChild

      public void addChild(String tagName, XMLMarshallable child)
      Adds a child to the objects, the child represents the marshallable object to be added into the content tree.
      Specified by:
      addChild in interface XMLMarshallable
      Parameters:
      tagName - The name of tag for the child
      child - The child to be added
    • addCharacterData

      public void addCharacterData(String cData)
      Adds character data to the content element.
      Specified by:
      addCharacterData in interface XMLMarshallable
      Parameters:
      cData - The character data to be added
    • marshal

      public void marshal(XMLOutputter output)
      Gives an XML representation of this object, and of its children.
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshall the object into