public final class DelegationRelativeTime extends Object implements RelativeTimeConstraint, Serializable
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 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
.
ClientAuthentication
,
Delegation
,
DelegationAbsoluteTime
,
Serialized FormModifier and Type | Field and Description |
---|---|
private long |
maxStart
The maximum start duration in milliseconds.
|
private long |
maxStop
The maximum stop duration in milliseconds.
|
private long |
minStart
The minimum start duration in milliseconds.
|
private long |
minStop
The minimum stop duration in milliseconds.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
DelegationRelativeTime(long minStart,
long maxStart,
long minStop,
long maxStop)
Creates a constraint with the specified durations.
|
Modifier and Type | Method and Description |
---|---|
private static long |
add(long dur,
long time) |
boolean |
equals(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.
|
InvocationConstraint |
makeAbsolute(long baseTime)
Returns a
DelegationAbsoluteTime instance with times obtained
by adding the specified base time argument to the duration values
from this instance. |
private void |
readObject(ObjectInputStream s)
Verifies that
minStart is less than or equal to
maxStart , maxStart is less than or equal to
minStop , minStop is less than or equal to
maxStop , and minStop is greater than or equal
to zero. |
String |
toString()
Returns a string representation of this object.
|
private static final long serialVersionUID
private final long minStart
private final long maxStart
private final long minStop
private final long maxStop
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 millisecondsIllegalArgumentException
- if minStart
is greater
than maxStart
, or maxStart
is greater than
minStop
, or minStop
is greater than
maxStop
, or minStop
is less than zeropublic long getMinStart()
public long getMaxStart()
public long getMinStop()
public long getMaxStop()
public InvocationConstraint makeAbsolute(long baseTime)
DelegationAbsoluteTime
instance with times obtained
by adding the specified base time argument 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
baseTime
- an absolute time, specified in milliseconds from
midnight, January 1, 1970 UTCprivate static long add(long dur, long time)
public int hashCode()
public boolean equals(Object obj)
public String toString()
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
minStart
is less than or equal to
maxStart
, maxStart
is less than or equal to
minStop
, minStop
is less than or equal to
maxStop
, and minStop
is greater than or equal
to zero.InvalidObjectException
- if minStart
is greater
than maxStart
, or maxStart
is greater than
minStop
, or minStop
is greater than
maxStop
, or minStop
is less than zeroIOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.