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