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 java.util.List;
20  
21  import javax.xml.namespace.QName;
22  
23  import org.joda.time.DateTime;
24  import org.opensaml.common.SAMLVersion;
25  import org.opensaml.common.SignableSAMLObject;
26  import org.opensaml.common.xml.SAMLConstants;
27  
28  /**
29   * SAML 2.0 Core Assertion.
30   */
31  public interface Assertion extends SignableSAMLObject, Evidentiary {
32  
33      /** Element local name. */
34      public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Assertion";
35  
36      /** Default element name. */
37      public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20_NS, DEFAULT_ELEMENT_LOCAL_NAME,
38              SAMLConstants.SAML20_PREFIX);
39  
40      /** Local name of the XSI type. */
41      public static final String TYPE_LOCAL_NAME = "AssertionType";
42  
43      /** QName of the XSI type. */
44      public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20_NS, TYPE_LOCAL_NAME,
45              SAMLConstants.SAML20_PREFIX);
46  
47      /** Version attribute name. */
48      public static final String VERSION_ATTRIB_NAME = "Version";
49  
50      /** IssueInstant attribute name. */
51      public static final String ISSUE_INSTANT_ATTRIB_NAME = "IssueInstant";
52  
53      /** ID attribute name. */
54      public static final String ID_ATTRIB_NAME = "ID";
55  
56      /**
57       * Gets the SAML Version of this assertion.
58       * 
59       * @return the SAML Version of this assertion.
60       */
61      public SAMLVersion getVersion();
62  
63      /**
64       * Sets the SAML Version of this assertion.
65       * 
66       * @param newVersion the SAML Version of this assertion
67       */
68      public void setVersion(SAMLVersion newVersion);
69  
70      /**
71       * Gets the issue instance of this assertion.
72       * 
73       * @return the issue instance of this assertion
74       */
75      public DateTime getIssueInstant();
76  
77      /**
78       * Sets the issue instance of this assertion.
79       * 
80       * @param newIssueInstance the issue instance of this assertion
81       */
82      public void setIssueInstant(DateTime newIssueInstance);
83  
84      /**
85       * Sets the ID of this assertion.
86       * 
87       * @return the ID of this assertion
88       */
89      public String getID();
90  
91      /**
92       * Sets the ID of this assertion.
93       * 
94       * @param newID the ID of this assertion
95       */
96      public void setID(String newID);
97  
98      /**
99       * Gets the Issuer of this assertion.
100      * 
101      * @return the Issuer of this assertion
102      */
103     public Issuer getIssuer();
104 
105     /**
106      * Sets the Issuer of this assertion.
107      * 
108      * @param newIssuer the Issuer of this assertion
109      */
110     public void setIssuer(Issuer newIssuer);
111 
112     /**
113      * Gets the Subject of this assertion.
114      * 
115      * @return the Subject of this assertion
116      */
117     public Subject getSubject();
118 
119     /**
120      * Sets the Subject of this assertion.
121      * 
122      * @param newSubject the Subject of this assertion
123      */
124     public void setSubject(Subject newSubject);
125 
126     /**
127      * Gets the Conditions placed on this assertion.
128      * 
129      * @return the Conditions placed on this assertion
130      */
131     public Conditions getConditions();
132 
133     /**
134      * Sets the Conditions placed on this assertion.
135      * 
136      * @param newConditions the Conditions placed on this assertion
137      */
138     public void setConditions(Conditions newConditions);
139 
140     /**
141      * Gets the Advice for this assertion.
142      * 
143      * @return the Advice for this assertion
144      */
145     public Advice getAdvice();
146 
147     /**
148      * Sets the Advice for this assertion.
149      * 
150      * @param newAdvice the Advice for this assertion
151      */
152     public void setAdvice(Advice newAdvice);
153 
154     /**
155      * Gets the list of statements attached to this assertion.
156      * 
157      * @return the list of statements attached to this assertion
158      */
159     public List<Statement> getStatements();
160 
161     /**
162      * Gets the list of statements attached to this assertion that match a particular QName.
163      * 
164      * @param typeOrName the QName of the statements to return
165      * @return the list of statements attached to this assertion
166      */
167     public List<Statement> getStatements(QName typeOrName);
168 
169     /**
170      * Gets the list of AuthnStatements attached to this assertion.
171      * 
172      * @return the list of AuthnStatements attached to this assertion
173      */
174     public List<AuthnStatement> getAuthnStatements();
175 
176     /**
177      * Gets the list of AuthzDecisionStatements attached to this assertion.
178      * 
179      * @return the list of AuthzDecisionStatements attached to this assertion
180      */
181     public List<AuthzDecisionStatement> getAuthzDecisionStatements();
182 
183     /**
184      * Gets the list of AttributeStatement attached to this assertion.
185      * 
186      * @return the list of AttributeStatement attached to this assertion
187      */
188     public List<AttributeStatement> getAttributeStatements();
189 }