001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wass/saml/Statement.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005       Department of Geography, University of Bonn
006     and
007       lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035    ----------------------------------------------------------------------------*/
036    
037    package org.deegree.ogcwebservices.wass.saml;
038    
039    import java.net.URI;
040    import java.util.ArrayList;
041    import java.util.Date;
042    
043    import org.deegree.datatypes.QualifiedName;
044    
045    /**
046     * Encapsulated data: Statement elements
047     *
048     * Namespace: http://urn:oasis:names:tc.SAML:1.0:assertion
049     *
050     * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
051     * @author last edited by: $Author: mschneider $
052     *
053     * @version 2.0, $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
054     *
055     * @since 2.0
056     */
057    public class Statement {
058    
059        private Subject subject = null;
060    
061        private URI authenticationMethod = null;
062    
063        private Date authenticationInstant = null;
064    
065        private String ip = null;
066    
067        private String dns = null;
068    
069        private QualifiedName kind = null;
070    
071        private URI location = null;
072    
073        private URI binding = null;
074    
075        private ArrayList<String> actions = null;
076    
077        private ArrayList<URI> actionNamespaces = null;
078    
079        private ArrayList<Assertion> assertions = null;
080    
081        private String[] assertionIDs = null;
082    
083        private URI resource = null;
084    
085        private String decision = null;
086    
087        private ArrayList<String> attributeNames = null;
088    
089        private ArrayList<URI> attributeNamespaces = null;
090    
091        private ArrayList<String[]> attributeValues = null;
092    
093        /**
094         * @param subject
095         * @param authenticationMethod
096         * @param authenticationInstant
097         */
098        public Statement( Subject subject, URI authenticationMethod, Date authenticationInstant ) {
099            this.subject = subject;
100            this.authenticationMethod = authenticationMethod;
101            this.authenticationInstant = authenticationInstant;
102        }
103    
104        /**
105         * @param subject
106         * @param actions
107         * @param actionNamespaces
108         * @param assertions
109         * @param assertionIDs
110         * @param resource
111         * @param decision
112         */
113        public Statement( Subject subject, ArrayList<String> actions, ArrayList<URI> actionNamespaces,
114                         ArrayList<Assertion> assertions, String[] assertionIDs, URI resource,
115                         String decision ) {
116            this.subject = subject;
117            this.actions = actions;
118            this.actionNamespaces = actionNamespaces;
119            this.assertions = assertions;
120            this.assertionIDs = assertionIDs;
121            this.resource = resource;
122            this.decision = decision;
123        }
124    
125        /**
126         * @param subject
127         * @param attributeNames
128         * @param attributeNamespaces
129         * @param attributeValues
130         */
131        public Statement( Subject subject, ArrayList<String> attributeNames,
132                         ArrayList<URI> attributeNamespaces, ArrayList<String[]> attributeValues ) {
133            this.subject = subject;
134            this.attributeNames = attributeNames;
135            this.attributeNamespaces = attributeNamespaces;
136            this.attributeValues = attributeValues;
137        }
138    
139        /**
140         * @return true, if the encapsulated data is an AuthenticationStatement
141         */
142        public boolean isAuthenticationStatement() {
143            return ( authenticationMethod != null ) && ( authenticationInstant != null );
144        }
145    
146        /**
147         * @return true, if the encapsulated data is an AuthorizationDecisionStatement
148         */
149        public boolean isAuthorizationDecisionStatement() {
150            return ( actions != null ) && ( actionNamespaces != null ) && ( assertions != null )
151                   && ( assertionIDs != null ) && ( resource != null ) && ( decision != null );
152        }
153    
154        /**
155         * @return true, if the encapsulated data is an AttributeStatement
156         */
157        public boolean isAttributeStatement() {
158            return ( attributeNames != null ) && ( attributeNamespaces != null )
159                   && ( attributeValues != null );
160        }
161    
162        /**
163         * @param ip
164         */
165        public void setIP( String ip ) {
166            this.ip = ip;
167        }
168    
169        /**
170         * @param dns
171         */
172        public void setDNS( String dns ) {
173            this.dns = dns;
174        }
175    
176        /**
177         * @param kind
178         * @param location
179         * @param binding
180         */
181        public void setAuthorityBinding( QualifiedName kind, URI location, URI binding ) {
182            this.kind = kind;
183            this.location = location;
184            this.binding = binding;
185        }
186    
187        /**
188         * @return Returns the actionNamespaces.
189         */
190        public ArrayList<URI> getActionNamespaces() {
191            return actionNamespaces;
192        }
193    
194        /**
195         * @return Returns the actions.
196         */
197        public ArrayList<String> getActions() {
198            return actions;
199        }
200    
201        /**
202         * @return Returns the assertionIDs.
203         */
204        public String[] getAssertionIDs() {
205            return assertionIDs;
206        }
207    
208        /**
209         * @return Returns the assertions.
210         */
211        public ArrayList<Assertion> getAssertions() {
212            return assertions;
213        }
214    
215        /**
216         * @return Returns the attributeNames.
217         */
218        public ArrayList<String> getAttributeNames() {
219            return attributeNames;
220        }
221    
222        /**
223         * @return Returns the attributeNamespaces.
224         */
225        public ArrayList<URI> getAttributeNamespaces() {
226            return attributeNamespaces;
227        }
228    
229        /**
230         * @return Returns the attributeValues.
231         */
232        public ArrayList<String[]> getAttributeValues() {
233            return attributeValues;
234        }
235    
236        /**
237         * @return Returns the authenticationInstant.
238         */
239        public Date getAuthenticationInstant() {
240            return authenticationInstant;
241        }
242    
243        /**
244         * @return Returns the authenticationMethod.
245         */
246        public URI getAuthenticationMethod() {
247            return authenticationMethod;
248        }
249    
250        /**
251         * @return Returns the binding.
252         */
253        public URI getBinding() {
254            return binding;
255        }
256    
257        /**
258         * @return Returns the decision.
259         */
260        public String getDecision() {
261            return decision;
262        }
263    
264        /**
265         * @return Returns the dns.
266         */
267        public String getDns() {
268            return dns;
269        }
270    
271        /**
272         * @return Returns the ip.
273         */
274        public String getIp() {
275            return ip;
276        }
277    
278        /**
279         * @return Returns the kind.
280         */
281        public QualifiedName getKind() {
282            return kind;
283        }
284    
285        /**
286         * @return Returns the location.
287         */
288        public URI getLocation() {
289            return location;
290        }
291    
292        /**
293         * @return Returns the resource.
294         */
295        public URI getResource() {
296            return resource;
297        }
298    
299        /**
300         * @return Returns the subject.
301         */
302        public Subject getSubject() {
303            return subject;
304        }
305    
306    }