Class TimestampPolicy

All Implemented Interfaces:
SecurityPolicy, Cloneable

public class TimestampPolicy extends WSSPolicy
A policy representing a WSS Timestamp element. Note: The TimestampPolicy is the only WSSPolicy element that does not contain a concrete FeatureBinding and/or KeyBinding.
  • Constructor Details

    • TimestampPolicy

      public TimestampPolicy()
      Default constructor
  • Method Details

    • setCreationTime

      public void setCreationTime(String creationTime)
      set the CreationTime for the timestamp in this TimestampPolicy
    • setTimeout

      public void setTimeout(long timeout)
      If the current time on a receiving system is past the CreationTime of the timestamp plus the timeout, then the timestamp is to be considered expired.
      Parameters:
      timeout - the number of milliseconds after which the Timestamp in this TimestampPolicy will expire.
    • setMaxClockSkew

      public void setMaxClockSkew(long maxClockSkew)
      set the maximum clock skew adjustment value (in milliseconds)
      Parameters:
      maxClockSkew - the Maximum Clock Skew adjustment to be used when validating received timestamps
    • setTimestampFreshness

      public void setTimestampFreshness(long timestampFreshness)
      set the Timestamp Freshness Limit (in milliseconds) for this Timestamp Timestamps received by a receiver with creation Times older than the Timestamp Freshness Limit period are supposed to be rejected by the receiver.
      Parameters:
      timestampFreshness - the Timestamp Freshness Limit (in milliseconds)
    • getCreationTime

      public String getCreationTime()
      Returns:
      creationTime the creation time of the timestamp in this TimestampPolicy if set, empty string otherwise
    • getTimeout

      public long getTimeout()
      Returns:
      timeout the Timeout in milliseconds for this Timestamp
    • getExpirationTime

      public String getExpirationTime() throws Exception
      Returns:
      expirationTime the expiration time if set for this Timestamp, empty string otherwise
      Throws:
      Exception
    • setExpirationTime

      public void setExpirationTime(String expirationTime)
      Parameters:
      expirationTime - the expiration time
    • getMaxClockSkew

      public long getMaxClockSkew()
      Returns:
      maxClockSkew the maximum Clock Skew adjustment
    • getTimestampFreshness

      public long getTimestampFreshness()
      Returns:
      timeStampFreshness limit
    • equals

      public boolean equals(WSSPolicy policy)
      Description copied from class: WSSPolicy
      equals operator
      Specified by:
      equals in class WSSPolicy
      Parameters:
      policy - the policy to be compared for equality
      Returns:
      true if the argument policy is equal to this
      See Also:
    • equalsIgnoreTargets

      public boolean equalsIgnoreTargets(WSSPolicy policy)
      Specified by:
      equalsIgnoreTargets in class WSSPolicy
    • clone

      public Object clone()
      Clone operator
      Specified by:
      clone in class WSSPolicy
      Returns:
      clone of this policy
      See Also:
    • getType

      public String getType()
      Description copied from interface: SecurityPolicy
      Get the type of the policy.

      Implementation Note: Useful to avoid instanceof checks and String.equals checks

      Returns:
      the type of the policy