com.sun.xml.wss.impl.policy.mls
Class TimestampPolicy

java.lang.Object
  extended by com.sun.xml.wss.impl.policy.MLSPolicy
      extended by com.sun.xml.wss.impl.policy.mls.WSSPolicy
          extended by com.sun.xml.wss.impl.policy.mls.TimestampPolicy
All Implemented Interfaces:
SecurityPolicy, java.lang.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 Summary
TimestampPolicy()
          Default constructor
 
Method Summary
 java.lang.Object clone()
          Clone operator
 boolean equals(WSSPolicy policy)
          equals operator
 boolean equalsIgnoreTargets(WSSPolicy policy)
           
 java.lang.String getCreationTime()
           
 java.lang.String getExpirationTime()
           
 long getMaxClockSkew()
           
 long getTimeout()
           
 long getTimestampFreshness()
           
 java.lang.String getType()
          Get the type of the policy.
 void setCreationTime(java.lang.String creationTime)
          set the CreationTime for the timestamp in this TimestampPolicy
 void setExpirationTime(java.lang.String expirationTime)
           
 void setMaxClockSkew(long maxClockSkew)
          set the maximum clock skew adjustment value (in milliseconds)
 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.
 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.
 
Methods inherited from class com.sun.xml.wss.impl.policy.mls.WSSPolicy
getFeatureBinding, getKeyBinding, getPolicyIdentifier, getUUID, isBSP, isBSP, isOptional, isOptional, setFeatureBinding, setKeyBinding, setPolicyIdentifier, setUUID
 
Methods inherited from class com.sun.xml.wss.impl.policy.MLSPolicy
isReadOnly, isReadOnly
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimestampPolicy

public TimestampPolicy()
Default constructor

Method Detail

setCreationTime

public void setCreationTime(java.lang.String creationTime)
set the CreationTime for the timestamp in this TimestampPolicy

Parameters:
creationTime -

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 java.lang.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 java.lang.String getExpirationTime()
                                   throws java.lang.Exception
Returns:
expirationTime the expiration time if set for this Timestamp, empty string otherwise
Throws:
java.lang.Exception

setExpirationTime

public void setExpirationTime(java.lang.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:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy, PrivateKeyBinding, SymmetricKeyBinding

equalsIgnoreTargets

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

clone

public java.lang.Object clone()
Clone operator

Specified by:
clone in class WSSPolicy
Returns:
clone of this policy
See Also:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy

getType

public java.lang.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


Copyright ? 2005 Sun Microsystems, Inc. All Rights Reserved.