java.rmi.constraint
Class DelegationAbsoluteTime

java.lang.Object
  |
  +--java.rmi.constraint.DelegationAbsoluteTime
All Implemented Interfaces:
SecurityConstraint, java.io.Serializable

public final class DelegationAbsoluteTime
extends java.lang.Object
implements SecurityConstraint, java.io.Serializable

Represents a constraint on delegation, such that if delegation is permitted, it be permitted for a range of absolute times. Each end of the range is itself specified as a range, yielding four absolute times, all specified in milliseconds from midnight, January 1, 1970 UTC. The four times have the following semantics:

To accommodate clock skew between systems, start times earlier than the current time may be desirable.

The use of an instance of this constraint does not directly imply a ClientAuthentication.YES constraint or a Delegation.YES constraint; those must be specified separately to ensure that the client actually authenticates itself and that delegation is actually used.

Since:
1.4
See Also:
Serialized Form

Constructor Summary
DelegationAbsoluteTime(long minStart, long maxStart, long minStop, long maxStop)
          Creates a constraint with the specified absolute times.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Two instances of this class are equal if both have the same minimum start, the same maximum start, the same minimum stop, and the same maximum stop.
 long getMaxStart()
          Returns the maximum start time in milliseconds from midnight, January 1, 1970 UTC.
 long getMaxStop()
          Returns the maximum stop time in milliseconds from midnight, January 1, 1970 UTC.
 long getMinStart()
          Returns the minimum start time in milliseconds from midnight, January 1, 1970 UTC.
 long getMinStop()
          Returns the minimum stop time in milliseconds from midnight, January 1, 1970 UTC.
 int hashCode()
          Returns a hash code value for this object.
 SecurityConstraint reduceBy(SecurityConstraint c)
          Returns the smallest representable subset of this constraint that contains the intersection of this constraint with the specified constraint, or null if there is no intersection.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelegationAbsoluteTime

public DelegationAbsoluteTime(long minStart,
                              long maxStart,
                              long minStop,
                              long maxStop)
Creates a constraint with the specified absolute times.
Parameters:
minStart - the minimum start time in milliseconds from midnight, January 1, 1970 UTC
maxStart - the maximum start time in milliseconds from midnight, January 1, 1970 UTC
minStop - the minimum stop time in milliseconds from midnight, January 1, 1970 UTC
maxStop - the maximum stop time in milliseconds from midnight, January 1, 1970 UTC
Throws:
java.lang.IllegalArgumentException - if minStart is greater than maxStart, or maxStart is greater than minStop, or minStop is greater than maxStop
Method Detail

getMinStart

public long getMinStart()
Returns the minimum start time in milliseconds from midnight, January 1, 1970 UTC.
Returns:
the minimum start time in milliseconds from midnight, January 1, 1970 UTC

getMaxStart

public long getMaxStart()
Returns the maximum start time in milliseconds from midnight, January 1, 1970 UTC.
Returns:
the maximum start time in milliseconds from midnight, January 1, 1970 UTC

getMinStop

public long getMinStop()
Returns the minimum stop time in milliseconds from midnight, January 1, 1970 UTC.
Returns:
the minimum stop time in milliseconds from midnight, January 1, 1970 UTC

getMaxStop

public long getMaxStop()
Returns the maximum stop time in milliseconds from midnight, January 1, 1970 UTC.
Returns:
the maximum stop time in milliseconds from midnight, January 1, 1970 UTC

reduceBy

public SecurityConstraint reduceBy(SecurityConstraint c)
Returns the smallest representable subset of this constraint that contains the intersection of this constraint with the specified constraint, or null if there is no intersection.

For any instances c1 and c2 of this class, c1.reduceBy(c2) returns a DelegationAbsoluteTime instance with a minimum start time of

Math.max(c1.getMinStart(), c2.getMinStart())
a maximum start time of
Math.min(c1.getMaxStart(), c2.getMaxStart())
a minimum stop time of
Math.max(c1.getMinStop(), c2.getMinStop())
and a maximum stop time of
Math.min(c1.getMaxStop(), c2.getMaxStop())
unless the computed minimum start is greater than the computed maximum start, or the computed maximum start is greater than the computed minimum stop, or the computed minimum stop is greater than the computed maximum stop, in which cases the result is null.

For any instance c of this class, c.reduceBy(Delegation.NO) returns Delegation.NO and c.reduceBy(ClientAuthentication.NO) returns ClientAuthentication.NO.

For any instance c1 of this class and any ConstraintAlternatives instance c2 containing DelegationAbsoluteTime instances, c1.reduceBy(c2) returns the result of calling ConstraintAlternatives.create with all of the non-null values returned by c1.reduceBy(c) for each element c of c2, or null if there are no non-null values.

For any instance c1 of this class and any other constraint instance c2 not previously mentioned, c1.reduceBy(c2) returns c1.

Specified by:
reduceBy in interface SecurityConstraint
Following copied from interface: java.rmi.constraint.SecurityConstraint
Parameters:
c - a constraint
Returns:
the smallest representable subset of this constraint that intersects with the specified constraint, or null if there is no intersection

hashCode

public int hashCode()
Returns a hash code value for this object.
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Two instances of this class are equal if both have the same minimum start, the same maximum start, the same minimum stop, and the same maximum stop.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of this object.
Overrides:
toString in class java.lang.Object


Copyright © 2000 Sun Microsystems, Inc. All rights reserved