001    //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/ogcwebservices/getcapabilities/CapabilitiesService.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    package org.deegree.ogcwebservices.getcapabilities;
045    
046    import java.net.URL;
047    import java.util.ArrayList;
048    
049    import org.deegree.ogcbase.ContactInformation;
050    
051    /**
052     * The interface provides acces to the <CapabilitiesService> element of the Capabilities XML
053     * providing general metadata for the service as a whole. It shall include a Name, Title, and Online
054     * Resource URL. Optionally, Abstract, Keyword List, Contact Information, Fees, and Access
055     * Constraints may be provided. The meaning of most of these elements is defined in [ISO 19115]. The
056     * CapabilitiesService Name shall be "ogc:WMS" in the case of a Web Map CapabilitiesService.
057     * <p>
058     * ----------------------------------------------------------------------
059     * </p>
060     * 
061     * @author <a href="mailto:k.lupp@web.de">Katharina Lupp</a>
062     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider</a>
063     * @version $Revision: 9345 $
064     */
065    
066    public class CapabilitiesService {
067    
068        private ArrayList keywordList = null;
069    
070        private ContactInformation contactInformation = null;
071    
072        private String abstract_ = null;
073    
074        private String accessConstraints = null;
075    
076        private String fees = null;
077    
078        private String name = null;
079    
080        private String title = null;
081    
082        private URL onlineResource = null;
083    
084        /**
085         * constructor initializing the class with the OGCWebServiceCapabilities
086         */
087        public CapabilitiesService( String name, String title, String abstract_, String[] keywords, URL onlineResource,
088                                    ContactInformation contactInformation, String fees, String accessConstraints ) {
089            keywordList = new ArrayList();
090            setName( name );
091            setTitle( title );
092            setAbstract( abstract_ );
093            setKeywordList( keywords );
094            setOnlineResource( onlineResource );
095            setContactInformation( contactInformation );
096            setFees( fees );
097            setAccessConstraints( accessConstraints );
098        }
099    
100        /**
101         * returns the name of the service. Typically, the Name is a single word used for
102         * machine-to-machine communication.
103         * 
104         * @return name of the service
105         * 
106         */
107        public String getName() {
108            return name;
109        }
110    
111        /**
112         * sets the name of the service. Typically, the Name is a single word used for
113         * machine-to-machine communication.
114         * 
115         */
116        public void setName( String name ) {
117            this.name = name;
118        }
119    
120        /**
121         * Returns the title of the service. The Title is for the benefit of humans. The
122         * CapabilitiesService Title is at the discretion of the provider, and should be brief yet
123         * descriptive enough to identify this server in a menu with other servers.
124         * 
125         * @see #getName()
126         * @return title of the service
127         * 
128         */
129        public String getTitle() {
130            return title;
131        }
132    
133        /**
134         * Sets the title of the service. The Title is for the benefit of humans. The
135         * CapabilitiesService Title is at the discretion of the provider, and should be brief yet
136         * descriptive enough to identify this server in a menu with other servers.
137         * 
138         * @see #getName()
139         * 
140         */
141        public void setTitle( String title ) {
142            this.title = title;
143        }
144    
145        /**
146         * The Abstract element allows a descriptive narrative providing more information about the
147         * enclosing object.
148         */
149        public String getAbstract() {
150            return abstract_;
151        }
152    
153        /**
154         * Sets the abstract element
155         */
156        public void setAbstract( String abstract_ ) {
157            this.abstract_ = abstract_;
158        }
159    
160        /**
161         * A list of keywords or keyword phrases should be included to help catalog searching.
162         * Currently, no controlled vocabulary has been defined.
163         * 
164         */
165        public String[] getKeywordList() {
166            return (String[]) keywordList.toArray( new String[keywordList.size()] );
167        }
168    
169        /**
170         * adds the keywordList
171         */
172        public void addKeyword( String keyword ) {
173            this.keywordList.add( keyword );
174        }
175    
176        /**
177         * sets the keywordList
178         */
179        public void setKeywordList( String[] keywordList ) {
180            this.keywordList.clear();
181    
182            if ( keywordList != null ) {
183                for ( int i = 0; i < keywordList.length; i++ ) {
184                    this.keywordList.add( keywordList[i] );
185                }
186            }
187        }
188    
189        /**
190         * The OnlineResource element within the CapabilitiesService element can be used, for example,
191         * to point to the web site of the service provider. There are other OnlineResource elements
192         * used for the URL prefix of each supported operation.
193         * 
194         */
195        public URL getOnlineResource() {
196            return onlineResource;
197        }
198    
199        /**
200         * sets URL prefix for get HTTP request method.
201         * 
202         */
203        public void setOnlineResource( URL onlineResource ) {
204            this.onlineResource = onlineResource;
205        }
206    
207        /**
208         * Returns informations who to contact for questions about the service. This method returns
209         * <tt>null</tt> if no contact informations are available.
210         * 
211         */
212        public ContactInformation getContactInformation() {
213            return contactInformation;
214        }
215    
216        /**
217         * Sets informations who to contact for questions about the service. This method returns
218         * <tt>null</tt> if no contact informations are available.
219         * 
220         */
221        public void setContactInformation( ContactInformation contactInformation ) {
222            this.contactInformation = contactInformation;
223        }
224    
225        /**
226         * Returns fees assigned to the service. If no fees defined "none" will be returned.
227         * 
228         */
229        public String getFees() {
230            return fees;
231        }
232    
233        /**
234         * Sets fees assigned to the service. If no fees defined "none" will be returned.
235         * 
236         */
237        public void setFees( String fees ) {
238            this.fees = fees;
239        }
240    
241        /**
242         * Returns access constraints assigned to the service. If no access constraints are defined
243         * "none" will be returned.
244         * 
245         */
246        public String getAccessConstraints() {
247            return accessConstraints;
248        }
249    
250        /**
251         * Sets access constraints assigned to the service. If no access constraints are defined "none"
252         * will be returned.
253         * 
254         */
255        public void setAccessConstraints( String accessConstraints ) {
256            this.accessConstraints = accessConstraints;
257        }
258    
259    }