001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_testing/src/org/deegree/ogcwebservices/csw/capabilities/CatalogueOperationsMetadata.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.csw.capabilities;
037    
038    import java.util.ArrayList;
039    import java.util.List;
040    
041    import org.deegree.ogcwebservices.csw.discovery.GetRepositoryItem;
042    import org.deegree.ogcwebservices.getcapabilities.Operation;
043    import org.deegree.ogcwebservices.getcapabilities.OperationsMetadata;
044    import org.deegree.owscommon.OWSDomainType;
045    
046    /**
047     * Represents the <code>OperationMetadata</code> part in the capabilities document of an OGC-CSW
048     * according to the <code>OpenGIS�
049     * Catalogue Services Specification 2.0</code>.
050     * <p>
051     * In addition to the <code>GetCapabilities</code> operation that all <code>OWS 0.2</code>
052     * compliant services must implement, it may define some or all of the following operations: <table
053     * border="1">
054     * <tr>
055     * <th>Name</th>
056     * <th>Mandatory?</th>
057     * <th>Function</th>
058     * </tr>
059     * <tr>
060     * <td>DescribeRecord</td>
061     * <td align="center">X</td>
062     * <td>Allows a client to discover elements of the information model supported by the target
063     * catalogue service.</td>
064     * </tr>
065     * <tr>
066     * <td>GetDomain</td>
067     * <td align="center">-</td>
068     * <td>The optional GetDomain operation is used to obtain runtime information about the range of
069     * values of a metadata record element or request parameter. The runtime range of values for a
070     * property or request parameter is typically much smaller than the value space for that property or
071     * parameter based on its static type definition. For example, a property or request parameter
072     * defined as a 16bit positive integer in a database may have a value space of 65535 distinct
073     * integers but the actual number of distinct values existing in the database may be much smaller.
074     * This type of runtime information about the range of values of a property or request parameter is
075     * useful for generating user interfaces with meaningful pick lists or for generating query
076     * predicates that have a higher chance of actually identifying a result set. It should be noted
077     * that the GetDomain operation is a �best-effort� operation. That is to say that a catalogue tries
078     * to generate useful information about the specified request parameter or property if it can. It is
079     * entirely possible that a catalogue may not be able to determine anything about the values of a
080     * property or request parameter in which case an empty response should be generated.</td>
081     * </tr>
082     * <tr>
083     * <td>GetRecords</td>
084     * <td align="center">X</td>
085     * <td>The primary means of resource discovery in the general model are the two operations search
086     * and present. In the HTTP protocol binding these are combined in the form of the mandatory
087     * GetRecords operation, which does a search and a piggybacked present.</td>
088     * </tr>
089     * <tr>
090     * <td>GetRecordById</td>
091     * <td align="center">X</td>
092     * <td>The mandatory GetRecordById request retrieves the default representation of catalogue
093     * records using their identifier. The GetRecordById operation is an implementation of the Present
094     * operation from the general model. This operation presumes that a previous query has been
095     * performed in order to obtain the identifiers that may be used with this operation. For example,
096     * records returned by a GetRecords operation may contain references to other records in the
097     * catalogue that may be retrieved using the GetRecordById operation. This operation is also a
098     * subset of the GetRecords operation, and is included as a convenient short form for retrieving and
099     * linking to records in a catalogue.</td>
100     * </tr>
101     * <tr>
102     * <td>Transaction</td>
103     * <td align="center">-</td>
104     * <td>The optional Transaction operation defines an interface for creating, modifying and deleting
105     * catalogue records. The specific payload being manipulated must be defined in a profile.</td>
106     * </tr>
107     * <tr>
108     * <td>Harvest</td>
109     * <td align="center">-</td>
110     * <td>The optional Harvest operation is an operation that "pulls" data into the catalogue. That
111     * is, this operation only references the data to be inserted or updated in the catalogue, and it is
112     * the job of the catalogue service to resolve the reference, fetch that data, and process it into
113     * the catalogue. The Harvest operation has two modes of operation, controlled by a flag in the
114     * request. The first mode of operation is a synchronous mode in which the CSW receives a Harvest
115     * request from the client, processes it immediately, and sends the results to the client while the
116     * client waits. The second mode of operation is asynchronous in that the server receives a Harvest
117     * request from the client, and sends the client an immediate acknowledgement that the request has
118     * been successfully received. The server can then process the Harvest request whenever it likes,
119     * taking as much time as is required and then send the results of the processing to a URI specified
120     * in the original Harvest request. This latter mode of operation is included to support Harvest
121     * requests that could run for a period of time longer than most HTTP timeout's will allow.
122     * Processing a Harvest request means that the CSW resolves the URI pointing to the metadata
123     * resource, parses the resource, and then creates or modifies metadata records in the catalogue in
124     * order to register the resource. This operation may be performed only once or periodically
125     * depending on how the client invokes the operation.</td>
126     * </tr>
127     * </table>
128     *
129     * @see org.deegree.ogcwebservices.getcapabilities.OperationsMetadata
130     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
131     * @author last edited by: $Author: mschneider $
132     *
133     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
134     */
135    
136    public class CatalogueOperationsMetadata extends OperationsMetadata {
137    
138        private static final long serialVersionUID = -125538317075396593L;
139    
140        /**
141         *
142         */
143        public static final String DESCRIBE_RECORD_NAME = "DescribeRecord";
144    
145        /**
146         *
147         */
148        public static final String GET_DOMAIN_NAME = "GetDomain";
149    
150        /**
151         *
152         */
153        public static final String GET_RECORDS_NAME = "GetRecords";
154    
155        /**
156         *
157         */
158        public static final String GET_RECORD_BY_ID_NAME = "GetRecordById";
159    
160        /**
161         * Identifier for a {@link GetRepositoryItem} request.
162         */
163        public static final String GET_REPOSITORY_ITEM = "GetRepositoryItem";
164    
165        /**
166         *
167         */
168        public static final String TRANSACTION_NAME = "Transaction";
169    
170        /**
171         *
172         */
173        public static final String HARVEST_NAME = "Harvest";
174    
175        private Operation describeRecord;
176    
177        private Operation getDomain;
178    
179        private Operation getRecords;
180    
181        private Operation getRecordById;
182    
183        private Operation transaction;
184    
185        private Operation harvest;
186    
187        /**
188         * Constructs a new <code>CatalogOperationsMetadata</code> from the given parameters.
189         *
190         * @param getCapabilities
191         * @param describeRecord
192         * @param getDomain
193         * @param getRecords
194         * @param getRecordById
195         * @param transaction
196         * @param harvest
197         * @param parameters
198         * @param constraints
199         */
200        public CatalogueOperationsMetadata( Operation getCapabilities, Operation describeRecord, Operation getDomain,
201                                            Operation getRecords, Operation getRecordById, Operation transaction,
202                                            Operation harvest, OWSDomainType[] parameters, OWSDomainType[] constraints ) {
203            super( getCapabilities, parameters, constraints );
204            this.describeRecord = describeRecord;
205            this.getDomain = getDomain;
206            this.getRecords = getRecords;
207            this.getRecordById = getRecordById;
208            this.transaction = transaction;
209            this.harvest = harvest;
210        }
211    
212        /**
213         * Returns all <code>Operations</code>.
214         *
215         * @return all <code>Operations</code>.
216         */
217        @Override
218        public Operation[] getOperations() {
219            List<Operation> list = new ArrayList<Operation>();
220            list.add( getCapabilitiesOperation );
221            list.add( describeRecord );
222            list.add( getRecords );
223            if ( getRecordById != null ) {
224                list.add( getRecordById );
225            }
226            if ( getDomain != null ) {
227                list.add( getDomain );
228            }
229            if ( transaction != null ) {
230                list.add( transaction );
231            }
232            if ( harvest != null ) {
233                list.add( harvest );
234            }
235            return list.toArray( new Operation[list.size()] );
236        }
237    
238        /**
239         * @return the describeRecord.
240         *
241         */
242        public Operation getDescribeRecord() {
243            return describeRecord;
244        }
245    
246        /**
247         * @param describeRecord
248         *            The describeRecord to set.
249         *
250         */
251        public void setDescribeRecord( Operation describeRecord ) {
252            this.describeRecord = describeRecord;
253        }
254    
255        /**
256         * @return the getDomain.
257         *
258         */
259        public Operation getGetDomain() {
260            return getDomain;
261        }
262    
263        /**
264         * @param getDomain
265         *            The getDomain to set.
266         *
267         */
268        public void setGetDomain( Operation getDomain ) {
269            this.getDomain = getDomain;
270        }
271    
272        /**
273         * @return the getRecordById.
274         *
275         */
276        public Operation getGetRecordById() {
277            return getRecordById;
278        }
279    
280        /**
281         * @param getRecordById
282         *            The getRecordId to set.
283         *
284         */
285        public void setGetRecordById( Operation getRecordById ) {
286            this.getRecordById = getRecordById;
287        }
288    
289        /**
290         * @return the getRecords.
291         *
292         */
293        public Operation getGetRecords() {
294            return getRecords;
295        }
296    
297        /**
298         * @param getRecords
299         *            The getRecords to set.
300         *
301         */
302        public void setGetRecords( Operation getRecords ) {
303            this.getRecords = getRecords;
304        }
305    
306        /**
307         * @return the harvest.
308         *
309         */
310        public Operation getHarvest() {
311            return harvest;
312        }
313    
314        /**
315         * @param harvest
316         *            The harvest to set.
317         *
318         */
319        public void setHarvest( Operation harvest ) {
320            this.harvest = harvest;
321        }
322    
323        /**
324         * @return the transaction.
325         *
326         */
327        public Operation getTransaction() {
328            return transaction;
329        }
330    
331        /**
332         * @param transaction
333         *            The transaction to set.
334         *
335         */
336        public void setTransaction( Operation transaction ) {
337            this.transaction = transaction;
338        }
339    
340    }