org.apache.ws.security.message
Class WSSecTimestamp

java.lang.Object
  extended byorg.apache.ws.security.message.WSSecBase
      extended byorg.apache.ws.security.message.WSSecTimestamp

public class WSSecTimestamp
extends WSSecBase

Builds a WS Timestamp and inserts it into the SOAP Envelope. Refer to the WS specification 1.0. chapter 10 / appendix A.2

Author:
Christof Soehngen (Christof.Soehngen@syracom.de)., Werner Dittmann (werner@apache.org).

Field Summary
 
Fields inherited from class org.apache.ws.security.message.WSSecBase
doDebug, keyIdentifierType, parts, password, user, wssConfig
 
Constructor Summary
WSSecTimestamp()
          Constructor.
 
Method Summary
 org.w3c.dom.Document build(org.w3c.dom.Document doc, WSSecHeader secHeader)
          Adds a new Timestamp to a soap envelope.
 org.w3c.dom.Element getElement()
          Get the timestamp element generated during prepare().
 java.lang.String getId()
          Get the id generated during prepare().
 void prepare(org.w3c.dom.Document doc)
          Creates a Timestamp element.
 void prependToHeader(WSSecHeader secHeader)
          Prepends the Timestamp element to the elements already in the Security header.
 void setTimeToLive(int ttl)
          Set the time to live.
 
Methods inherited from class org.apache.ws.security.message.WSSecBase
getKeyIdentifierType, setBodyID, setKeyIdentifierType, setParts, setUserInfo, setWsConfig, setWsuId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSSecTimestamp

public WSSecTimestamp()
Constructor.

Method Detail

setTimeToLive

public void setTimeToLive(int ttl)
Set the time to live. This is the time difference in seconds between the Created and the Expires in Timestamp.

Parameters:
ttl - The time to live in second

prepare

public void prepare(org.w3c.dom.Document doc)
Creates a Timestamp element. The method prepares and initializes a WSSec Timestamp structure after the relevant information was set. Before calling prepare() the parameter such as timeToLive can be set if the deafult value is not suitable.

Parameters:
doc - The SOAP enevlope as W3C document

prependToHeader

public void prependToHeader(WSSecHeader secHeader)
Prepends the Timestamp element to the elements already in the Security header. The method can be called any time after prepare(). This allows to insert the Timestamp element at any position in the Security header.

Parameters:
secHeader - The security header that holds the Signature element.

build

public org.w3c.dom.Document build(org.w3c.dom.Document doc,
                                  WSSecHeader secHeader)
Adds a new Timestamp to a soap envelope. A complete Timestamp is constructed and added to the wsse:Security header.

Parameters:
doc - The SOAP envelope as W3C document
secHeader - The security header that hold this Timestamp
Returns:
Document with Timestamp added
Throws:
java.lang.Exception

getId

public java.lang.String getId()
Get the id generated during prepare(). Returns the the value of wsu:Id attribute of this Timestamp.

Returns:
Return the wsu:Id of this token or null if prepareToken() was not called before.

getElement

public org.w3c.dom.Element getElement()
Get the timestamp element generated during prepare().



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