org.apache.excalibur.source.impl.validity
Class ExpiresValidity

java.lang.Object
  extended byorg.apache.excalibur.source.impl.validity.ExpiresValidity
All Implemented Interfaces:
java.io.Serializable, SourceValidity

public final class ExpiresValidity
extends java.lang.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

Field Summary
 
Fields inherited from interface org.apache.excalibur.source.SourceValidity
INVALID, UNKNOWN, UNKNWON, VALID
 
Constructor Summary
ExpiresValidity(long expires)
          Constructor
 
Method Summary
 int isValid()
          Checks if the expires date is already reached.
 int isValid(SourceValidity newValidity)
          This method is never invoked as isValid() can always perform the complete check.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpiresValidity

public ExpiresValidity(long expires)
Constructor

Parameters:
expires - The delta from now when this validity object gets invalid.
Method Detail

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 java.lang.String toString()
See Also:
Object.toString()


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.