View Javadoc

1   /*
2    * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.opensaml.saml2.common;
18  
19  import javax.xml.namespace.QName;
20  
21  import org.joda.time.DateTime;
22  import org.opensaml.common.SAMLObject;
23  import org.opensaml.common.xml.SAMLConstants;
24  
25  /**
26   * A functional interface for SAMLElements that are bounded with a 
27   * "validUntil" attribute. 
28   */
29  public interface TimeBoundSAMLObject extends SAMLObject{
30  
31  	/** "validUntil" attribute's local name */
32  	public final static String VALID_UNTIL_ATTRIB_NAME = "validUntil";
33  	
34  	/** "validUntil" attribute's QName */
35  	public final static QName VALID_UNTIL_ATTRIB_QNAME = new QName(SAMLConstants.SAML20MD_NS, VALID_UNTIL_ATTRIB_NAME, SAMLConstants.SAML20MD_PREFIX);
36  	
37  	/**
38  	 * Checks to see if the current time is past the validUntil time.
39  	 * 
40  	 * @return true of this descriptor is still valid otherwise false
41  	 */
42  	public boolean isValid();
43  
44  	/**
45  	 * Gets the date until which this descriptor is valid.
46  	 * 
47  	 * @return the date until which this descriptor is valid
48  	 */
49  	public DateTime getValidUntil();
50  
51  	/**
52  	 * Sets the date until which this descriptor is valid.
53  	 * 
54  	 * @param validUntil the date until which this descriptor is valid
55  	 */
56  	public void setValidUntil(DateTime validUntil);
57  
58  }