|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.constraint.DelegationRelativeTime
Represents a constraint on delegation, such that if delegation is permitted,
it be permitted for a range of time measured relative to the start of the
remote call. Each end of the range is itself specified as a range, yielding
four durations, all specified in milliseconds. If t
represents
the current time at the start of a remote call, then the four durations have
the following semantics:
minStart
- delegation must not be permitted any earlier
than time t + minStart
maxStart
- delegation must be permitted from time
t + maxStart
onwards
minStop
- delegation must be permitted up until at least
time t + minStop
maxStop
- delegation must not be permitted after time
t + maxStop
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.
Constructor Summary | |
DelegationRelativeTime(long minStart,
long maxStart,
long minStop,
long maxStop)
Creates a constraint with the specified durations. |
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 duration in milliseconds. |
long |
getMaxStop()
Returns the maximum stop duration in milliseconds. |
long |
getMinStart()
Returns the minimum start duration in milliseconds. |
long |
getMinStop()
Returns the minimum stop duration in milliseconds. |
int |
hashCode()
Returns a hash code value for this object. |
SecurityConstraint |
makeAbsolute(long baseTime)
Returns a DelegationAbsoluteTime
instance with times obtained by adding the specified base time
parameter to the duration values from this instance. |
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 |
public DelegationRelativeTime(long minStart, long maxStart, long minStop, long maxStop)
minStart
- the minimum start duration in millisecondsmaxStart
- the maximum start duration in millisecondsminStop
- the minimum stop duration in millisecondsmaxStop
- the maximum stop duration in millisecondsjava.lang.IllegalArgumentException
- if minStart
is greater
than maxStart
, or maxStart
is greater than
minStop
, or minStop
is greater than
maxStop
, or minStop
is less than zeroMethod Detail |
public long getMinStart()
public long getMaxStart()
public long getMinStop()
public long getMaxStop()
public SecurityConstraint reduceBy(SecurityConstraint c)
null
if there is no intersection.
For any instances c1
and c2
of this class,
c1.reduceBy(c2)
returns a
DelegationRelativeTime
instance with a minimum start
duration of
Math.max(c1.getMinStart(), c2.getMinStart())a maximum start duration of
Math.min(c1.getMaxStart(), c2.getMaxStart())a minimum stop duration of
Math.max(c1.getMinStop(), c2.getMinStop())and a maximum stop duration 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 DelegationRelativeTime
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
.
reduceBy
in interface SecurityConstraint
java.rmi.constraint.SecurityConstraint
c
- a constraintnull
if
there is no intersectionpublic SecurityConstraint makeAbsolute(long baseTime)
DelegationAbsoluteTime
instance with times obtained by adding the specified base time
parameter to the duration values from this instance. If an addition
results in underflow or overflow, a time value of
Long.MIN_VALUE
or Long.MAX_VALUE
is used,
respectively.makeAbsolute
in interface RelativeTimeConstraint
java.rmi.constraint.RelativeTimeConstraint
baseTime
- an absolute time, specified in milliseconds from
midnight, January 1, 1970 UTCpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |