001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/ogcwebservices/wass/saml/Statement.java $
002 /*---------------- FILE HEADER ------------------------------------------
003
004 This file is part of deegree.
005 Copyright (C) 2001-2004 by:
006 EXSE, Department of Geography, University of Bonn
007 http://www.giub.uni-bonn.de/exse/
008 lat/lon GmbH
009 http://www.lat-lon.de
010
011 This library is free software; you can redistribute it and/or
012 modify it under the terms of the GNU Lesser General Public
013 License as published by the Free Software Foundation; either
014 version 2.1 of the License, or (at your option) any later version.
015
016 This library is distributed in the hope that it will be useful,
017 but WITHOUT ANY WARRANTY; without even the implied warranty of
018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019 Lesser General Public License for more details.
020
021 You should have received a copy of the GNU Lesser General Public
022 License along with this library; if not, write to the Free Software
023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024
025 Contact:
026
027 Andreas Poth
028 lat/lon GmbH
029 Meckenheimer Allee 176
030 53115 Bonn
031 Germany
032 E-Mail: poth@lat-lon.de
033
034 Prof. Dr. Klaus Greve
035 Department of Geography
036 University of Bonn
037 Meckenheimer Allee 166
038 53115 Bonn
039 Germany
040 E-Mail: greve@giub.uni-bonn.de
041
042 ---------------------------------------------------------------------------*/
043
044 package org.deegree.ogcwebservices.wass.saml;
045
046 import java.net.URI;
047 import java.util.ArrayList;
048 import java.util.Date;
049
050 import org.deegree.datatypes.QualifiedName;
051
052 /**
053 * Encapsulated data: Statement elements
054 *
055 * Namespace: http://urn:oasis:names:tc.SAML:1.0:assertion
056 *
057 * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
058 * @author last edited by: $Author: bezema $
059 *
060 * @version 2.0, $Revision: 6259 $, $Date: 2007-03-20 10:15:15 +0100 (Di, 20 Mär 2007) $
061 *
062 * @since 2.0
063 */
064 public class Statement {
065
066 private Subject subject = null;
067
068 private URI authenticationMethod = null;
069
070 private Date authenticationInstant = null;
071
072 private String ip = null;
073
074 private String dns = null;
075
076 private QualifiedName kind = null;
077
078 private URI location = null;
079
080 private URI binding = null;
081
082 private ArrayList<String> actions = null;
083
084 private ArrayList<URI> actionNamespaces = null;
085
086 private ArrayList<Assertion> assertions = null;
087
088 private String[] assertionIDs = null;
089
090 private URI resource = null;
091
092 private String decision = null;
093
094 private ArrayList<String> attributeNames = null;
095
096 private ArrayList<URI> attributeNamespaces = null;
097
098 private ArrayList<String[]> attributeValues = null;
099
100 /**
101 * @param subject
102 * @param authenticationMethod
103 * @param authenticationInstant
104 */
105 public Statement( Subject subject, URI authenticationMethod, Date authenticationInstant ) {
106 this.subject = subject;
107 this.authenticationMethod = authenticationMethod;
108 this.authenticationInstant = authenticationInstant;
109 }
110
111 /**
112 * @param subject
113 * @param actions
114 * @param actionNamespaces
115 * @param assertions
116 * @param assertionIDs
117 * @param resource
118 * @param decision
119 */
120 public Statement( Subject subject, ArrayList<String> actions, ArrayList<URI> actionNamespaces,
121 ArrayList<Assertion> assertions, String[] assertionIDs, URI resource,
122 String decision ) {
123 this.subject = subject;
124 this.actions = actions;
125 this.actionNamespaces = actionNamespaces;
126 this.assertions = assertions;
127 this.assertionIDs = assertionIDs;
128 this.resource = resource;
129 this.decision = decision;
130 }
131
132 /**
133 * @param subject
134 * @param attributeNames
135 * @param attributeNamespaces
136 * @param attributeValues
137 */
138 public Statement( Subject subject, ArrayList<String> attributeNames,
139 ArrayList<URI> attributeNamespaces, ArrayList<String[]> attributeValues ) {
140 this.subject = subject;
141 this.attributeNames = attributeNames;
142 this.attributeNamespaces = attributeNamespaces;
143 this.attributeValues = attributeValues;
144 }
145
146 /**
147 * @return true, if the encapsulated data is an AuthenticationStatement
148 */
149 public boolean isAuthenticationStatement() {
150 return ( authenticationMethod != null ) && ( authenticationInstant != null );
151 }
152
153 /**
154 * @return true, if the encapsulated data is an AuthorizationDecisionStatement
155 */
156 public boolean isAuthorizationDecisionStatement() {
157 return ( actions != null ) && ( actionNamespaces != null ) && ( assertions != null )
158 && ( assertionIDs != null ) && ( resource != null ) && ( decision != null );
159 }
160
161 /**
162 * @return true, if the encapsulated data is an AttributeStatement
163 */
164 public boolean isAttributeStatement() {
165 return ( attributeNames != null ) && ( attributeNamespaces != null )
166 && ( attributeValues != null );
167 }
168
169 /**
170 * @param ip
171 */
172 public void setIP( String ip ) {
173 this.ip = ip;
174 }
175
176 /**
177 * @param dns
178 */
179 public void setDNS( String dns ) {
180 this.dns = dns;
181 }
182
183 /**
184 * @param kind
185 * @param location
186 * @param binding
187 */
188 public void setAuthorityBinding( QualifiedName kind, URI location, URI binding ) {
189 this.kind = kind;
190 this.location = location;
191 this.binding = binding;
192 }
193
194 /**
195 * @return Returns the actionNamespaces.
196 */
197 public ArrayList<URI> getActionNamespaces() {
198 return actionNamespaces;
199 }
200
201 /**
202 * @return Returns the actions.
203 */
204 public ArrayList<String> getActions() {
205 return actions;
206 }
207
208 /**
209 * @return Returns the assertionIDs.
210 */
211 public String[] getAssertionIDs() {
212 return assertionIDs;
213 }
214
215 /**
216 * @return Returns the assertions.
217 */
218 public ArrayList<Assertion> getAssertions() {
219 return assertions;
220 }
221
222 /**
223 * @return Returns the attributeNames.
224 */
225 public ArrayList<String> getAttributeNames() {
226 return attributeNames;
227 }
228
229 /**
230 * @return Returns the attributeNamespaces.
231 */
232 public ArrayList<URI> getAttributeNamespaces() {
233 return attributeNamespaces;
234 }
235
236 /**
237 * @return Returns the attributeValues.
238 */
239 public ArrayList<String[]> getAttributeValues() {
240 return attributeValues;
241 }
242
243 /**
244 * @return Returns the authenticationInstant.
245 */
246 public Date getAuthenticationInstant() {
247 return authenticationInstant;
248 }
249
250 /**
251 * @return Returns the authenticationMethod.
252 */
253 public URI getAuthenticationMethod() {
254 return authenticationMethod;
255 }
256
257 /**
258 * @return Returns the binding.
259 */
260 public URI getBinding() {
261 return binding;
262 }
263
264 /**
265 * @return Returns the decision.
266 */
267 public String getDecision() {
268 return decision;
269 }
270
271 /**
272 * @return Returns the dns.
273 */
274 public String getDns() {
275 return dns;
276 }
277
278 /**
279 * @return Returns the ip.
280 */
281 public String getIp() {
282 return ip;
283 }
284
285 /**
286 * @return Returns the kind.
287 */
288 public QualifiedName getKind() {
289 return kind;
290 }
291
292 /**
293 * @return Returns the location.
294 */
295 public URI getLocation() {
296 return location;
297 }
298
299 /**
300 * @return Returns the resource.
301 */
302 public URI getResource() {
303 return resource;
304 }
305
306 /**
307 * @return Returns the subject.
308 */
309 public Subject getSubject() {
310 return subject;
311 }
312
313 }
314
315 /***************************************************************************************************
316 * Changes to this class. What the people have been up to: $Log$
317 * Changes to this class. What the people have been up to: Revision 1.3 2006/06/19 12:47:09 schmitz
318 * Changes to this class. What the people have been up to: Updated the documentation, fixed the warnings and implemented logging everywhere.
319 * Changes to this class. What the people have been up to:
320 * Changes to this class. What the people have been up to: Revision 1.2 2006/05/29 16:24:59 bezema
321 * Changes to this class. What the people have been up to: Rearranging the layout of the wss and creating the doservice classes. The WSService class is implemented as well
322 * Changes to this class. What the people have been up to: Revision 1.1 2006/05/29 12:00:58
323 * bezema Refactored the security and authentication webservices into one package WASS (Web
324 * Authentication -and- Security Services), also created a common package and a saml package which
325 * could be updated to work in the future.
326 *
327 * Revision 1.2 2006/05/15 12:39:31 bezema Completed parsing the SAML Assertions spec.
328 *
329 * Revision 1.1 2006/05/15 09:54:16 bezema New approach to the nrw:gdi specs. Including ows_1_0 spec
330 * and saml spec
331 *
332 *
333 **************************************************************************************************/