001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/ogcwebservices/wass/saml/Statement.java $
002    /*----------------    FILE HEADER  ------------------------------------------
003    
004     This file is part of deegree.
005     Copyright (C) 2001-2008 by:
006     EXSE, Department of Geography, University of Bonn
007     http://www.giub.uni-bonn.de/deegree/
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     Aennchenstr. 19
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    
045    package org.deegree.ogcwebservices.wass.saml;
046    
047    import java.net.URI;
048    import java.util.ArrayList;
049    import java.util.Date;
050    
051    import org.deegree.datatypes.QualifiedName;
052    
053    /**
054     * Encapsulated data: Statement elements
055     * 
056     * Namespace: http://urn:oasis:names:tc.SAML:1.0:assertion
057     * 
058     * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
059     * @author last edited by: $Author: apoth $
060     * 
061     * @version 2.0, $Revision: 9345 $, $Date: 2007-12-27 17:22:25 +0100 (Do, 27 Dez 2007) $
062     * 
063     * @since 2.0
064     */
065    public class Statement {
066    
067        private Subject subject = null;
068    
069        private URI authenticationMethod = null;
070    
071        private Date authenticationInstant = null;
072    
073        private String ip = null;
074    
075        private String dns = null;
076    
077        private QualifiedName kind = null;
078    
079        private URI location = null;
080    
081        private URI binding = null;
082    
083        private ArrayList<String> actions = null;
084    
085        private ArrayList<URI> actionNamespaces = null;
086    
087        private ArrayList<Assertion> assertions = null;
088    
089        private String[] assertionIDs = null;
090    
091        private URI resource = null;
092    
093        private String decision = null;
094    
095        private ArrayList<String> attributeNames = null;
096    
097        private ArrayList<URI> attributeNamespaces = null;
098    
099        private ArrayList<String[]> attributeValues = null;
100    
101        /**
102         * @param subject
103         * @param authenticationMethod
104         * @param authenticationInstant
105         */
106        public Statement( Subject subject, URI authenticationMethod, Date authenticationInstant ) {
107            this.subject = subject;
108            this.authenticationMethod = authenticationMethod;
109            this.authenticationInstant = authenticationInstant;
110        }
111    
112        /**
113         * @param subject
114         * @param actions
115         * @param actionNamespaces
116         * @param assertions
117         * @param assertionIDs
118         * @param resource
119         * @param decision
120         */
121        public Statement( Subject subject, ArrayList<String> actions, ArrayList<URI> actionNamespaces,
122                         ArrayList<Assertion> assertions, String[] assertionIDs, URI resource,
123                         String decision ) {
124            this.subject = subject;
125            this.actions = actions;
126            this.actionNamespaces = actionNamespaces;
127            this.assertions = assertions;
128            this.assertionIDs = assertionIDs;
129            this.resource = resource;
130            this.decision = decision;
131        }
132    
133        /**
134         * @param subject
135         * @param attributeNames
136         * @param attributeNamespaces
137         * @param attributeValues
138         */
139        public Statement( Subject subject, ArrayList<String> attributeNames,
140                         ArrayList<URI> attributeNamespaces, ArrayList<String[]> attributeValues ) {
141            this.subject = subject;
142            this.attributeNames = attributeNames;
143            this.attributeNamespaces = attributeNamespaces;
144            this.attributeValues = attributeValues;
145        }
146    
147        /**
148         * @return true, if the encapsulated data is an AuthenticationStatement
149         */
150        public boolean isAuthenticationStatement() {
151            return ( authenticationMethod != null ) && ( authenticationInstant != null );
152        }
153    
154        /**
155         * @return true, if the encapsulated data is an AuthorizationDecisionStatement
156         */
157        public boolean isAuthorizationDecisionStatement() {
158            return ( actions != null ) && ( actionNamespaces != null ) && ( assertions != null )
159                   && ( assertionIDs != null ) && ( resource != null ) && ( decision != null );
160        }
161    
162        /**
163         * @return true, if the encapsulated data is an AttributeStatement
164         */
165        public boolean isAttributeStatement() {
166            return ( attributeNames != null ) && ( attributeNamespaces != null )
167                   && ( attributeValues != null );
168        }
169    
170        /**
171         * @param ip
172         */
173        public void setIP( String ip ) {
174            this.ip = ip;
175        }
176    
177        /**
178         * @param dns
179         */
180        public void setDNS( String dns ) {
181            this.dns = dns;
182        }
183    
184        /**
185         * @param kind
186         * @param location
187         * @param binding
188         */
189        public void setAuthorityBinding( QualifiedName kind, URI location, URI binding ) {
190            this.kind = kind;
191            this.location = location;
192            this.binding = binding;
193        }
194    
195        /**
196         * @return Returns the actionNamespaces.
197         */
198        public ArrayList<URI> getActionNamespaces() {
199            return actionNamespaces;
200        }
201    
202        /**
203         * @return Returns the actions.
204         */
205        public ArrayList<String> getActions() {
206            return actions;
207        }
208    
209        /**
210         * @return Returns the assertionIDs.
211         */
212        public String[] getAssertionIDs() {
213            return assertionIDs;
214        }
215    
216        /**
217         * @return Returns the assertions.
218         */
219        public ArrayList<Assertion> getAssertions() {
220            return assertions;
221        }
222    
223        /**
224         * @return Returns the attributeNames.
225         */
226        public ArrayList<String> getAttributeNames() {
227            return attributeNames;
228        }
229    
230        /**
231         * @return Returns the attributeNamespaces.
232         */
233        public ArrayList<URI> getAttributeNamespaces() {
234            return attributeNamespaces;
235        }
236    
237        /**
238         * @return Returns the attributeValues.
239         */
240        public ArrayList<String[]> getAttributeValues() {
241            return attributeValues;
242        }
243    
244        /**
245         * @return Returns the authenticationInstant.
246         */
247        public Date getAuthenticationInstant() {
248            return authenticationInstant;
249        }
250    
251        /**
252         * @return Returns the authenticationMethod.
253         */
254        public URI getAuthenticationMethod() {
255            return authenticationMethod;
256        }
257    
258        /**
259         * @return Returns the binding.
260         */
261        public URI getBinding() {
262            return binding;
263        }
264    
265        /**
266         * @return Returns the decision.
267         */
268        public String getDecision() {
269            return decision;
270        }
271    
272        /**
273         * @return Returns the dns.
274         */
275        public String getDns() {
276            return dns;
277        }
278    
279        /**
280         * @return Returns the ip.
281         */
282        public String getIp() {
283            return ip;
284        }
285    
286        /**
287         * @return Returns the kind.
288         */
289        public QualifiedName getKind() {
290            return kind;
291        }
292    
293        /**
294         * @return Returns the location.
295         */
296        public URI getLocation() {
297            return location;
298        }
299    
300        /**
301         * @return Returns the resource.
302         */
303        public URI getResource() {
304            return resource;
305        }
306    
307        /**
308         * @return Returns the subject.
309         */
310        public Subject getSubject() {
311            return subject;
312        }
313    
314    }