org.apache.excalibur.source.impl.validity
Class ExpiresValidity
java.lang.Object
org.apache.excalibur.source.impl.validity.ExpiresValidity
- All Implemented Interfaces:
- Serializable, SourceValidity
public final class ExpiresValidity
- extends Object
- implements SourceValidity
A validation object that holds an expiration date.
When the defined time/date has arrived, this validity object is
not valid any more.
- Version:
- CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:17 $
- Author:
- Avalon Development Team
- See Also:
- Serialized Form
ExpiresValidity
public ExpiresValidity(long expires)
- Constructor
- Parameters:
expires
- The delta from now when this validity object gets invalid.
isValid
public int isValid()
- Checks if the expires date is already reached.
- Specified by:
isValid
in interface SourceValidity
- See Also:
SourceValidity.isValid()
isValid
public int isValid(SourceValidity newValidity)
- This method is never invoked as
isValid()
can always perform
the complete check.
- Specified by:
isValid
in interface SourceValidity
- Returns:
- -1 is returned, if the validity object is not valid anymore
+1 is returned, if the validity object is still valid
0 is returned, if the validity check could not be performed.
In this case, the new validity object is not usable. Examples
for this are: when the validity objects have different types,
or when one validity object for any reason is not able to
get the required information.
- See Also:
SourceValidity.isValid(SourceValidity)
toString
public String toString()
- Overrides:
toString
in class Object
- See Also:
Object.toString()
Copyright © 1997-2012 The Apache Software Foundation. All Rights Reserved.