Package org.apache.wss4j.dom.message
Class WSSecTimestamp
- java.lang.Object
-
- org.apache.wss4j.dom.message.WSSecBase
-
- org.apache.wss4j.dom.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
-
-
Field Summary
-
Fields inherited from class org.apache.wss4j.dom.message.WSSecBase
addWSUNamespace, attachmentCallbackHandler, callbackLookup, expandXopInclude, keyIdentifierType, password, storeBytesInAttachment, user
-
-
Constructor Summary
Constructors Constructor Description WSSecTimestamp(WSSecHeader securityHeader)WSSecTimestamp(Document doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Documentbuild()Adds a newTimestampto a soap envelope.ElementgetElement()Get the timestamp element generated duringprepare().StringgetId()Get the id generated duringprepare().WSTimeSourcegetWsTimeSource()booleanisPrecisionInMilliSeconds()voidprepare()Creates a Timestamp element.voidprependToHeader()Prepends the Timestamp element to the elements already in the Security header.voidsetPrecisionInMilliSeconds(boolean precisionInMilliSeconds)voidsetTimeToLive(int ttl)Set the time to live.voidsetWsTimeSource(WSTimeSource wsTimeSource)-
Methods inherited from class org.apache.wss4j.dom.message.WSSecBase
clean, getDocument, getIdAllocator, getKeyIdentifierType, getParts, getSecurityHeader, getWsDocInfo, isExpandXopInclude, setAttachmentCallbackHandler, setBodyID, setCallbackLookup, setExpandXopInclude, setIdAllocator, setKeyIdentifierType, setStoreBytesInAttachment, setUserInfo, setWsDocInfo, setWsuId
-
-
-
-
Constructor Detail
-
WSSecTimestamp
public WSSecTimestamp(WSSecHeader securityHeader)
-
WSSecTimestamp
public WSSecTimestamp(Document doc)
-
-
Method Detail
-
setTimeToLive
public void setTimeToLive(int ttl)
Set the time to live. This is the time difference in seconds between theCreatedand theExpiresinTimestamp.- Parameters:
ttl- The time to live in second
-
prepare
public void 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 astimeToLivecan be set if the default value is not suitable.
-
prependToHeader
public void 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.
-
build
public Document build()
Adds a newTimestampto a soap envelope. A completeTimestampis constructed and added to thewsse:Securityheader.- Returns:
- Document with Timestamp added
- Throws:
Exception
-
getId
public String 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.
-
getWsTimeSource
public WSTimeSource getWsTimeSource()
-
setWsTimeSource
public void setWsTimeSource(WSTimeSource wsTimeSource)
-
getElement
public Element getElement()
Get the timestamp element generated duringprepare().
-
isPrecisionInMilliSeconds
public boolean isPrecisionInMilliSeconds()
-
setPrecisionInMilliSeconds
public void setPrecisionInMilliSeconds(boolean precisionInMilliSeconds)
-
-