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.core;
18  
19  import javax.xml.namespace.QName;
20  
21  import org.joda.time.DateTime;
22  import org.opensaml.common.xml.SAMLConstants;
23  
24  /**
25   * SAML 2.0 Core AuthnStatement.
26   */
27  public interface AuthnStatement extends Statement {
28  
29      /** Element local name. */
30      public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AuthnStatement";
31  
32      /** Default element name. */
33      public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
34              SAMLConstants.SAML20_PREFIX);
35  
36      /** Local name of the XSI type. */
37      public static final String TYPE_LOCAL_NAME = "AuthnStatementType";
38  
39      /** QName of the XSI type. */
40      public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
41              SAMLConstants.SAML20_PREFIX);
42  
43      /** AuthnInstant attribute name. */
44      public static final String AUTHN_INSTANT_ATTRIB_NAME = "AuthnInstant";
45  
46      /** SessionIndex attribute name. */
47      public static final String SESSION_INDEX_ATTRIB_NAME = "SessionIndex";
48  
49      /** SessionNoOnOrAfter attribute name. */
50      public static final String SESSION_NOT_ON_OR_AFTER_ATTRIB_NAME = "SessionNotOnOrAfter";
51  
52      /**
53       * Gets the time when the authentication took place.
54       * 
55       * @return the time when the authentication took place
56       */
57      public DateTime getAuthnInstant();
58  
59      /**
60       * Sets the time when the authentication took place.
61       * 
62       * @param newAuthnInstant the time when the authentication took place
63       */
64      public void setAuthnInstant(DateTime newAuthnInstant);
65  
66      /**
67       * Get the session index between the principal and the authenticating authority.
68       * 
69       * @return the session index between the principal and the authenticating authority
70       */
71      public String getSessionIndex();
72  
73      /**
74       * Sets the session index between the principal and the authenticating authority.
75       * 
76       * @param newIndex the session index between the principal and the authenticating authority
77       */
78      public void setSessionIndex(String newIndex);
79  
80      /**
81       * Get the time when the session between the principal and the SAML authority ends.
82       * 
83       * @return the time when the session between the principal and the SAML authority ends
84       */
85      public DateTime getSessionNotOnOrAfter();
86  
87      /**
88       * Set the time when the session between the principal and the SAML authority ends.
89       * 
90       * @param newSessionNotOnOrAfter the time when the session between the principal and the SAML authority ends
91       */
92      public void setSessionNotOnOrAfter(DateTime newSessionNotOnOrAfter);
93  
94      /**
95       * Get the DNS domain and IP address of the system where the principal was authenticated.
96       * 
97       * @return the DNS domain and IP address of the system where the principal was authenticated
98       */
99      public SubjectLocality getSubjectLocality();
100 
101     /**
102      * Set the DNS domain and IP address of the system where the principal was authenticated.
103      * 
104      * @param newLocality the DNS domain and IP address of the system where the principal was authenticated
105      */
106     public void setSubjectLocality(SubjectLocality newLocality);
107 
108     /**
109      * Gets the context used to authenticate the subject.
110      * 
111      * @return the context used to authenticate the subject
112      */
113     public AuthnContext getAuthnContext();
114 
115     /**
116      * Sets the context used to authenticate the subject.
117      * 
118      * @param newAuthnContext the context used to authenticate the subject
119      */
120     public void setAuthnContext(AuthnContext newAuthnContext);
121 }