001: // $HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/ogcwebservices/getcapabilities/Operation.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: package org.deegree.ogcwebservices.getcapabilities;
044:
045: import java.io.Serializable;
046:
047: import org.deegree.owscommon.OWSDomainType;
048:
049: /**
050: * Represents the definition of an <code>Operation</code> in the capabilities document of an
051: * OGC-web service according to the <code>OWS Common
052: * Implementation Specification 0.2</code> (and
053: * <code>owsOperationsMetadata.xsd</code>).
054: * <p>
055: * It consists of a mandatory <code>name</code> attribute and the following elements: <table
056: * border="1">
057: * <tr>
058: * <th>Name</th>
059: * <th>Occurences</th>
060: * <th>Function</th>
061: * </tr>
062: * <tr>
063: * <td>ows:DCP</td>
064: * <td align="center">1-*</td>
065: * <td>Unordered list of Distributed Computing Platforms (DCPs) supported for this operation. At
066: * present, only the HTTP DCP is defined, so this element will appear only once.</td>
067: * </tr>
068: * <tr>
069: * <td>Parameter</td>
070: * <td align="center">0-*</td>
071: * <td>Optional unordered list of parameter domains that each apply to this operation which this
072: * server implements. If one of these Parameter elements has the same "name" attribute as a
073: * Parameter element in the OperationsMetadata element, this Parameter element shall override the
074: * other one for this operation. The list of required and optional parameter domain limitations for
075: * this operation shall be specified in the Implementation Specification for this service.</td>
076: * </tr>
077: * <tr>
078: * <td>ows:Metadata</td>
079: * <td align="center">0-*</td>
080: * <td>Optional unordered list of additional metadata about this operation and its' implementation.
081: * A list of required and optional metadata elements for this operation should be specified in the
082: * Implementation Specification for this service. (Informative: This metadata might specify the
083: * operation request parameters or provide the XML Schemas for the operation request.)</td>
084: * </tr>
085: * </table>
086: *
087: * @author <a href="mailto:poth@lat-lon.de">Andreas Poth </a>
088: * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
089: * @author last edited by: $Author: apoth $
090: *
091: * @version 1.0. $Revision: 9345 $, $Date: 2007-12-27 08:22:25 -0800 (Thu, 27 Dec 2007) $
092: *
093: * @since 2.0
094: */
095:
096: public class Operation implements Serializable {
097:
098: private String name;
099:
100: private DCPType[] dcps;
101:
102: private OWSDomainType[] parameters;
103:
104: private Object[] metadata;
105:
106: /**
107: * Creates a new <code>Operation</code> instance that has no <code>Parameter</code>
108: * information.
109: *
110: * @param name
111: * @param dcps
112: */
113: public Operation(String name, DCPType[] dcps) {
114: this (name, dcps, new OWSDomainType[0]);
115: }
116:
117: /**
118: * Creates a new <code>Operation</code> instance with <code>Parameter</code> information.
119: *
120: * @param name
121: * @param dcpTypes
122: * @param parameters
123: */
124: public Operation(String name, DCPType[] dcpTypes,
125: OWSDomainType[] parameters) {
126: this .name = name;
127: this .dcps = dcpTypes;
128: this .parameters = parameters;
129: }
130:
131: /**
132: * Returns the name of the <code>Operation</code>.
133: *
134: * @return the name of the <code>Operation</code>.
135: */
136: public String getName() {
137: return name;
138: }
139:
140: /**
141: * Sets the name of the <code>Operation</code>.
142: *
143: * @param name
144: */
145: public void setName(String name) {
146: this .name = name;
147: }
148:
149: /**
150: * Returns the <code>DCP</code> definitions for the <code>Operation</code>.
151: *
152: * @return the <code>DCP</code> definitions for the <code>Operation</code>.
153: */
154: public DCPType[] getDCPs() {
155: return dcps;
156: }
157:
158: /**
159: * Sets the <code>DCP</code> definitions for the <code>Operation</code>.
160: *
161: * @param dcpTypes
162: */
163: public void setDCPs(DCPType[] dcpTypes) {
164: this .dcps = dcpTypes;
165: }
166:
167: /**
168: * Returns the specified <code>Parameter</code> value for the <code>Operation</code>.
169: *
170: * @param name
171: */
172: public OWSDomainType getParameter(String name) {
173: for (int i = 0; i < parameters.length; i++) {
174: if (parameters[i].getName().equals(name)) {
175: return parameters[i];
176: }
177: }
178: return null;
179: }
180:
181: /**
182: * Returns all <code>Parameters</code> of the <code>Operation</code>.
183: *
184: * @return all <code>Parameters</code> of the <code>Operation</code>.
185: */
186: public OWSDomainType[] getParameters() {
187: return parameters;
188: }
189:
190: /**
191: * Sets the <code>Parameters</code> of the <code>Operation</code>.
192: *
193: * @param parameters
194: */
195: public void setParameters(OWSDomainType[] parameters) {
196: this .parameters = parameters;
197: }
198:
199: /**
200: * @return Returns the metadata.
201: */
202: public Object[] getMetadata() {
203: return metadata;
204: }
205:
206: /**
207: * @param metadata
208: * The metadata to set.
209: */
210: public void setMetadata(Object[] metadata) {
211: this.metadata = metadata;
212: }
213:
214: }
|