Class Timestamp

java.lang.Object
org.apache.ws.security.message.token.Timestamp

public class Timestamp extends Object
Timestamp according to SOAP Message Security 1.0, chapter 10 / appendix A.2

Author:
Christof Soehngen (christof.soehngen@syracom.de)
  • Field Details

    • element

      protected Element element
    • customElements

      protected Vector customElements
    • created

      protected Calendar created
    • expires

      protected Calendar expires
  • Constructor Details

    • Timestamp

      public Timestamp(Element element) throws WSSecurityException
      Constructs a Timestamp object and parses the wsu:Timestamp element to initialize it.
      Parameters:
      element - the wsu:Timestamp element that contains the timestamp data
      Throws:
      WSSecurityException
    • Timestamp

      public Timestamp(boolean milliseconds, Document doc, int ttl)
      Constructs a Timestamp object according to the defined parameters.

      Parameters:
      doc - the SOAP envelope as Document
      ttl - the time to live (validity of the security semantics) in seconds
  • Method Details

    • getCurrentTime

      protected Calendar getCurrentTime()
      Get the current time
      Returns:
      calendar the current time
    • getElement

      public Element getElement()
      Returns the dom element of this Timestamp object.
      Returns:
      the wsse:UsernameToken element
    • toString

      public String toString()
      Returns the string representation of the token.
      Overrides:
      toString in class Object
      Returns:
      a XML string representation
    • getCreated

      public Calendar getCreated()
      Get the time of creation.

      Returns:
      the "created" time
    • getExpires

      public Calendar getExpires()
      Get the time of expiration.

      Returns:
      the "expires" time
    • addCustomElement

      public void addCustomElement(Document doc, Element customElement)
      Creates and adds a custom element to this Timestamp
    • getCustomElements

      public Vector getCustomElements()
      Get the the custom elements from this Timestamp
      Returns:
      the vector containing the custom elements.
    • setID

      public void setID(String id)
      Set wsu:Id attribute of this timestamp
      Parameters:
      id -
    • getID

      public String getID()
      Returns the value of the wsu:Id attribute
      Returns:
      TODO