Class Timestamp
- java.lang.Object
-
- org.apache.ws.security.message.token.Timestamp
-
public class Timestamp extends java.lang.Object
Timestamp according to SOAP Message Security 1.0, chapter 10 / appendix A.2- Author:
- Christof Soehngen (christof.soehngen@syracom.de)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Calendar
created
protected java.util.Vector
customElements
protected org.w3c.dom.Element
element
protected java.util.Calendar
expires
-
Constructor Summary
Constructors Constructor Description Timestamp(boolean milliseconds, org.w3c.dom.Document doc, int ttl)
Constructs aTimestamp
object according to the defined parameters.Timestamp(org.w3c.dom.Element element)
Constructs aTimestamp
object and parses thewsu:Timestamp
element to initialize it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCustomElement(org.w3c.dom.Document doc, org.w3c.dom.Element customElement)
Creates and adds a custom element to this Timestampjava.util.Calendar
getCreated()
Get the time of creation.protected java.util.Calendar
getCurrentTime()
Get the current timejava.util.Vector
getCustomElements()
Get the the custom elements from this Timestamporg.w3c.dom.Element
getElement()
Returns the dom element of thisTimestamp
object.java.util.Calendar
getExpires()
Get the time of expiration.java.lang.String
getID()
Returns the value of the wsu:Id attributevoid
setID(java.lang.String id)
Set wsu:Id attribute of this timestampjava.lang.String
toString()
Returns the string representation of the token.
-
-
-
Constructor Detail
-
Timestamp
public Timestamp(org.w3c.dom.Element element) throws WSSecurityException
Constructs aTimestamp
object and parses thewsu:Timestamp
element to initialize it.- Parameters:
element
- thewsu:Timestamp
element that contains the timestamp data- Throws:
WSSecurityException
-
Timestamp
public Timestamp(boolean milliseconds, org.w3c.dom.Document doc, int ttl)
Constructs aTimestamp
object according to the defined parameters.- Parameters:
doc
- the SOAP envelope asDocument
ttl
- the time to live (validity of the security semantics) in seconds
-
-
Method Detail
-
getCurrentTime
protected java.util.Calendar getCurrentTime()
Get the current time- Returns:
- calendar the current time
-
getElement
public org.w3c.dom.Element getElement()
Returns the dom element of thisTimestamp
object.- Returns:
- the
wsse:UsernameToken
element
-
toString
public java.lang.String toString()
Returns the string representation of the token.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a XML string representation
-
getCreated
public java.util.Calendar getCreated()
Get the time of creation.- Returns:
- the "created" time
-
getExpires
public java.util.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 java.util.Vector getCustomElements()
Get the the custom elements from this Timestamp- Returns:
- the vector containing the custom elements.
-
setID
public void setID(java.lang.String id)
Set wsu:Id attribute of this timestamp- Parameters:
id
-
-
getID
public java.lang.String getID()
Returns the value of the wsu:Id attribute- Returns:
- TODO
-
-