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:
- The validity object has all information to check by itself if it is valid (e.g. given an expires date).
- The validity object possibility needs another (newer) validity object to compare against (e.g. to test a last modification date).
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:
| 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. |
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
isValid
public int isValid()
-
Check if the component is still valid. The possible results are :
-1: invalid. The component isn't valid anymore.
0: don't know. This validity should be checked against a new validity object using isValid(SourceValidity).
1: valid. The component is still valid.
-
-
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.
Please see keelframework.org for information about new Keel releases.