001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/wps/execute/IOValue.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.wps.execute;
037    
038    import java.net.URI;
039    import java.net.URL;
040    
041    import org.deegree.datatypes.Code;
042    import org.deegree.datatypes.values.TypedLiteral;
043    import org.deegree.model.spatialschema.Envelope;
044    import org.deegree.ogcwebservices.wps.WPSDescription;
045    
046    /**
047     * IOValue.java
048     *
049     * Created on 24.03.2006. 16:33:24h
050     *
051     * Value of one input to a process or one output from a process.
052     *
053     * @author <a href="mailto:christian@kiehle.org">Christian Kiehle</a>
054     * @author <a href="mailto:christian.heier@gmx.de">Christian Heier</a>
055     * @author last edited by: $Author: mschneider $
056     *
057     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
058     */
059    public class IOValue extends WPSDescription {
060    
061        /**
062         * Identifies this input or output value as a web accessible resource, and references that
063         * resource. For an input, this element may be used by a client for any process input coded as
064         * ComplexData in the ProcessDescription. For an output, this element shall be used by a server
065         * when "store" in the Execute request is "true".
066         */
067    
068        private ComplexValueReference complexValueReference;
069    
070        /**
071         * Identifies this input or output value as a complex value data structure encoded in XML (e.g.,
072         * using GML), and provides that complex value data structure. For an input, this element may be
073         * used by a client for any process input coded as ComplexData in the ProcessDescription. For an
074         * output, this element shall be used by a server when "store" in the Execute request is
075         * "false".
076         */
077        private ComplexValue complexValue;
078    
079        /**
080         * Identifies this input or output value as a literal value of a simple quantity (e.g., one
081         * number), and provides that value.
082         */
083        private TypedLiteral literalValue;
084    
085        /**
086         * Identifies this input or output value as an ows:BoundingBox data structure, and provides that
087         * ows:BoundingBox data structure.
088         */
089        private Envelope boundingBoxValue;
090    
091        /**
092         *
093         * @param identifier
094         * @param title
095         * @param _abstract
096         * @param boundingBoxValue
097         * @param complexValue
098         * @param complexValueReference
099         * @param literalValue
100         */
101        public IOValue( Code identifier, String title, String _abstract, Envelope boundingBoxValue,
102                        ComplexValue complexValue, ComplexValueReference complexValueReference,
103                        TypedLiteral literalValue ) {
104            super( identifier, title, _abstract );
105            this.boundingBoxValue = boundingBoxValue;
106            this.complexValue = complexValue;
107            this.complexValueReference = complexValueReference;
108            this.literalValue = literalValue;
109        }
110    
111        /**
112         *
113         * @return complexValueReference
114         */
115        public ComplexValueReference getComplexValueReference() {
116            return complexValueReference;
117        }
118    
119        /**
120         *
121         * @param value
122         */
123        public void setComplexValueReference( ComplexValueReference value ) {
124            this.complexValueReference = value;
125        }
126    
127        /**
128         *
129         * @return complexValue
130         */
131        public ComplexValue getComplexValue() {
132            return complexValue;
133        }
134    
135        /**
136         *
137         * @param value
138         */
139        public void setComplexValue( ComplexValue value ) {
140            this.complexValue = value;
141        }
142    
143        /**
144         *
145         * @return literalValue
146         */
147        public TypedLiteral getLiteralValue() {
148            return literalValue;
149        }
150    
151        /**
152         *
153         * @param value
154         */
155        public void setLiteralValue( TypedLiteral value ) {
156            this.literalValue = value;
157        }
158    
159        /**
160         *
161         * @return boundingBoxValue
162         */
163        public Envelope getBoundingBoxValue() {
164            return boundingBoxValue;
165        }
166    
167        /**
168         *
169         * @return boundingBoxValueType
170         */
171        public boolean isBoundingBoxValueType() {
172            boolean boundingBoxValueType = false;
173            if ( null != boundingBoxValue ) {
174                boundingBoxValueType = true;
175            }
176            return boundingBoxValueType;
177        }
178    
179        /**
180         *
181         * @return complexValueReferenceType
182         */
183        public boolean isComplexValueReferenceType() {
184            boolean complexValueReferenceType = false;
185            if ( null != complexValueReference ) {
186                complexValueReferenceType = true;
187            }
188            return complexValueReferenceType;
189        }
190    
191        /**
192         *
193         * @return true if the value is complex
194         */
195        public boolean isComplexValueType() {
196            boolean complexValueType = false;
197            if ( null != complexValue ) {
198                complexValueType = true;
199            }
200            return complexValueType;
201        }
202    
203        /**
204         * @return true if the value is a literal
205         */
206        public boolean isLiteralValueType() {
207            boolean literalValueType = false;
208            if ( null != literalValue ) {
209                literalValueType = true;
210            }
211            return literalValueType;
212        }
213    
214        /**
215         *
216         * @param value
217         */
218        public void setBoundingBoxValue( Envelope value ) {
219            this.boundingBoxValue = value;
220        }
221    
222        /**
223         * <code>ComplexValueReference</code> is simple wrapper class.
224         *
225         * @author <a href="mailto:christian@kiehle.org">Christian Kiehle</a>
226         *
227         * @author last edited by: $Author: mschneider $
228         *
229         * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
230         *
231         */
232        public static class ComplexValueReference extends ComplexValueEncoding {
233    
234            protected URL reference;
235    
236            /**
237             * @param encoding
238             * @param format
239             * @param schema
240             * @param reference
241             */
242            public ComplexValueReference( String format, URI encoding, URL schema, URL reference ) {
243                super( format, encoding, schema );
244                this.reference = reference;
245            }
246    
247            /**
248             * @return the reference to the data
249             */
250            public URL getReference() {
251                return reference;
252            }
253    
254        }
255    
256    }