org.apache.ws.security.message.token
Class Timestamp

java.lang.Object
  extended by 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 Summary
protected  Calendar created
           
protected  Vector customElements
           
protected  org.w3c.dom.Element element
           
protected  Calendar expires
           
 
Constructor Summary
Timestamp(boolean milliseconds, org.w3c.dom.Document doc, int ttl)
          Constructs a Timestamp object according to the defined parameters.
Timestamp(org.w3c.dom.Element element)
          Constructs a Timestamp object and parses the wsu:Timestamp element to initialize it.
 
Method Summary
 void addCustomElement(org.w3c.dom.Document doc, org.w3c.dom.Element customElement)
          Creates and adds a custom element to this Timestamp
 Calendar getCreated()
          Get the time of creation.
protected  Calendar getCurrentTime()
          Get the current time
 Vector getCustomElements()
          Get the the custom elements from this Timestamp
 org.w3c.dom.Element getElement()
          Returns the dom element of this Timestamp object.
 Calendar getExpires()
          Get the time of expiration.
 String getID()
           
 void setID(String id)
          Set wsu:Id attribute of this timestamp
 String toString()
          Returns the string representation of the token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

element

protected org.w3c.dom.Element element

customElements

protected Vector customElements

created

protected Calendar created

expires

protected Calendar expires
Constructor Detail

Timestamp

public Timestamp(org.w3c.dom.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,
                 org.w3c.dom.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 Detail

getCurrentTime

protected Calendar getCurrentTime()
Get the current time

Returns:
calendar the current time

getElement

public org.w3c.dom.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(org.w3c.dom.Document doc,
                             org.w3c.dom.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


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.