Class 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
    • 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 the Created and the Expires in Timestamp.

        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 calling prepare() the parameter such as timeToLive can 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 after prepare(). This allows to insert the Timestamp element at any position in the Security header.
      • build

        public Document build()
        Adds a new Timestamp to a soap envelope. A complete Timestamp is constructed and added to the wsse:Security header.
        Document with Timestamp added
      • getId

        public String getId()
        Get the id generated during prepare(). Returns the the value of wsu:Id attribute of this Timestamp.
        Return the wsu:Id of this token or null if prepareToken() was not called before.
      • setWsTimeSource

        public void setWsTimeSource​(WSTimeSource wsTimeSource)
      • getElement

        public Element getElement()
        Get the timestamp element generated during prepare().
      • isPrecisionInMilliSeconds

        public boolean isPrecisionInMilliSeconds()
      • setPrecisionInMilliSeconds

        public void setPrecisionInMilliSeconds​(boolean precisionInMilliSeconds)