Package org.apache.ws.security.message
Class WSSecTimestamp
java.lang.Object
org.apache.ws.security.message.WSSecBase
org.apache.ws.security.message.WSSecTimestamp
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild
(Document doc, WSSecHeader secHeader) Adds a newTimestamp
to a soap envelope.Get the timestamp element generated duringprepare()
.getId()
Get the id generated duringprepare()
.void
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
-
Constructor Details
-
WSSecTimestamp
public WSSecTimestamp()Constructor.
-
-
Method Details
-
setTimeToLive
public void setTimeToLive(int ttl) Set the time to live. This is the time difference in seconds between theCreated
and theExpires
inTimestamp
.- Parameters:
ttl
- The time to live in second
-
prepare
Creates a Timestamp element. The method prepares and initializes a WSSec Timestamp structure after the relevant information was set. Before callingprepare()
the parameter such astimeToLive
can be set if the deafult value is not suitable.- Parameters:
doc
- The SOAP enevlope as W3C document
-
prependToHeader
Prepends the Timestamp element to the elements already in the Security header. The method can be called any time afterprepare()
. 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
Adds a newTimestamp
to a soap envelope. A completeTimestamp
is constructed and added to thewsse:Security
header.- Parameters:
doc
- The SOAP enevlope as W3C documentsecHeader
- The security header that hold this Timestamp- Returns:
- Document with Timestamp added
- Throws:
Exception
-
getId
Get the id generated duringprepare()
. 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
Get the timestamp element generated duringprepare()
.
-