org.apache.excalibur.source
Interface SourceValidity

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractAggregatedValidity, AggregatedValidity, DeferredAggregatedValidity, ExpiresValidity, FileTimeStampValidity, NOPValidity, TimeStampValidity

public interface SourceValidity
extends java.io.Serializable

A SourceValidity object contains all information to check if a Source object is still valid.

There are two possibilities:

To avoid testing what the actual implementation of the validity object supports, the invocation order is to first call isValid() and only if this result is 0 (i.e. "don't know"), then to call isValid(SourceValidity).

Remember to call isValid(SourceValidity) when isValid() returned 0 !

Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:26 $
Author:
Avalon Development Team

Field Summary
static int INVALID
           
static int UNKNOWN
           
static int UNKNWON
          Deprecated. because it has been misspelled, use UNKNOWN of course
static int VALID
           
 
Method Summary
 int isValid()
          Check if the component is still valid.
 int isValid(SourceValidity newValidity)
          Check if the component is still valid.
 

Field Detail

VALID

public static final int VALID
See Also:
Constant Field Values

INVALID

public static final int INVALID
See Also:
Constant Field Values

UNKNWON

public static final int UNKNWON
Deprecated. because it has been misspelled, use UNKNOWN of course

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values
Method Detail

isValid

public int isValid()
Check if the component is still valid. The possible results are :


isValid

public int isValid(SourceValidity newValidity)
Check if the component is still valid. This is only true if the incoming Validity is of the same type and has the "same" values.

The invocation order is that the isValid method of the old Validity object is called with the new one as a parameter.

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.


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