Package com.sun.xml.wss.impl.policy.mls
Class TimestampPolicy
- java.lang.Object
-
- com.sun.xml.wss.impl.policy.MLSPolicy
-
- com.sun.xml.wss.impl.policy.mls.WSSPolicy
-
- com.sun.xml.wss.impl.policy.mls.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.
-
-
Field Summary
-
Fields inherited from class com.sun.xml.wss.impl.policy.mls.WSSPolicy
_featureBinding, _isOptional, _keyBinding, _policyIdentifier, bsp, UUID
-
-
Constructor Summary
Constructors Constructor Description TimestampPolicy()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Clone operatorbooleanequals(WSSPolicy policy)equals operatorbooleanequalsIgnoreTargets(WSSPolicy policy)StringgetCreationTime()StringgetExpirationTime()longgetMaxClockSkew()longgetTimeout()longgetTimestampFreshness()StringgetType()Get the type of the policy.voidsetCreationTime(String creationTime)set the CreationTime for the timestamp in this TimestampPolicyvoidsetExpirationTime(String expirationTime)voidsetMaxClockSkew(long maxClockSkew)set the maximum clock skew adjustment value (in milliseconds)voidsetTimeout(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.voidsetTimestampFreshness(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
-
-
-
-
Method Detail
-
setCreationTime
public void setCreationTime(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 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:WSSPolicyequals operator- Specified by:
equalsin classWSSPolicy- 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:
equalsIgnoreTargetsin classWSSPolicy
-
clone
public Object clone()
Clone operator- Specified by:
clonein classWSSPolicy- Returns:
- clone of this policy
- See Also:
SignaturePolicy,EncryptionPolicy,AuthenticationTokenPolicy
-
getType
public String getType()
Description copied from interface:SecurityPolicyGet the type of the policy.Implementation Note: Useful to avoid instanceof checks and String.equals checks
- Returns:
- the type of the policy
-
-