1 /* 2 * Copyright (C) The Apache Software Foundation. All rights reserved. 3 * 4 * This software is published under the terms of the Apache Software License 5 * version 1.1, a copy of which has been included with this distribution in 6 * the LICENSE.txt file. 7 */ 8 package org.apache.avalon.excalibur.source; 9 10 /** 11 * A Validity object contains all information to check if a Source object is 12 * still valid. 13 * There are two possibilities: The validity object has all information 14 * to check by itself how long it is valid (e.g. given an expires date). 15 * The other possibility needs another (newer) validity object to compare 16 * against (e.g. to test a last modification date). 17 * To avoid testing, what the actual implementation of the validity object 18 * supports, the invocation order is to first call isValid() and only if 19 * this results in <code>false</code>, then to call isValid(SourceValidity). 20 * But remember to call the second isValid(SourceValidity) when <code>false</code> 21 * is returned by the first invocation! 22 * 23 * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a> 24 * @version CVS $Revision: 1.3 $ $Date: 2002/01/08 13:43:48 $ 25 */ 26 public interface SourceValidity 27 extends java.io.Serializable { 28 29 /** 30 * Check if the component is still valid. 31 * If <code>false</code> is returned the isValid(SourceValidity) must be 32 * called afterwards! 33 */ 34 boolean isValid(); 35 36 /** 37 * Check if the component is still valid. 38 * This is only true, if the incoming Validity is of the same 39 * type and has the same values. 40 * The invocation order is that the isValid method of the 41 * old Validity object is called with the new one as a parameter 42 */ 43 boolean isValid(SourceValidity newValidity); 44 } 45