Package net.jini.core.constraint
Class DelegationAbsoluteTime
java.lang.Object
net.jini.core.constraint.DelegationAbsoluteTime
- All Implemented Interfaces:
Serializable,InvocationConstraint
public final class DelegationAbsoluteTime
extends Object
implements InvocationConstraint, Serializable
Represents a constraint on delegation, such that if delegation is permitted, it be permitted only
for a range of absolute times. The mechanisms and credentials used to support this are not
specified by this constraint. 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:
minStart- delegation must not be permitted any earlier than this timemaxStart- delegation must be permitted from this time onwardsminStop- delegation must be permitted up until at least this timemaxStop- delegation must not be permitted after this time
The use of an instance of this class 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. Because this constraint is conditional on delegation, it does not conflict with
ClientAuthentication.NO or Delegation.NO.
- Since:
- 2.0
- Author:
- Sun Microsystems, Inc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDelegationAbsoluteTime(long minStart, long maxStart, long minStop, long maxStop) Creates a constraint with the specified absolute times.DelegationAbsoluteTime(Date minStart, Date maxStart, Date minStop, Date maxStop) Creates a constraint with the specified dates. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo 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.longReturns the maximum start time in milliseconds from midnight, January 1, 1970 UTC.longReturns the maximum stop time in milliseconds from midnight, January 1, 1970 UTC.longReturns the minimum start time in milliseconds from midnight, January 1, 1970 UTC.longReturns the minimum stop time in milliseconds from midnight, January 1, 1970 UTC.inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this object.
-
Constructor Details
-
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 UTCmaxStart- the maximum start time in milliseconds from midnight, January 1, 1970 UTCminStop- the minimum stop time in milliseconds from midnight, January 1, 1970 UTCmaxStop- the maximum stop time in milliseconds from midnight, January 1, 1970 UTC- Throws:
IllegalArgumentException- ifminStartis greater thanmaxStart, ormaxStartis greater thanminStop, orminStopis greater thanmaxStop
-
DelegationAbsoluteTime
Creates a constraint with the specified dates. The arguments passed to the constructor are neither modified nor retained; subsequent changes to those arguments have no effect on the instance created.- Parameters:
minStart- the minimum start datemaxStart- the maximum start dateminStop- the minimum stop datemaxStop- the maximum stop date- Throws:
NullPointerException- if any argument isnullIllegalArgumentException- ifminStartis later thanmaxStart, ormaxStartis later thanminStop, orminStopis later thanmaxStop
-
-
Method Details
-
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
-
hashCode
public int hashCode()Returns a hash code value for this object. -
equals
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. -
toString
Returns a string representation of this object.
-