001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/branches/2.2_testing/src/org/deegree/owscommon_new/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 ---------------------------------------------------------------------------*/ 044 package org.deegree.owscommon_new; 045 046 import java.util.List; 047 048 import org.deegree.datatypes.QualifiedName; 049 050 /** 051 * <code>Operation</code> stores the contents of an Operation 052 * element according to the OWS common specification version 1.0.0. 053 * 054 * @author <a href="mailto:schmitz@lat-lon.de">Andreas Schmitz</a> 055 * @author last edited by: $Author: apoth $ 056 * 057 * @version 2.0, $Revision: 9346 $, $Date: 2007-12-27 17:39:07 +0100 (Do, 27 Dez 2007) $ 058 * 059 * @since 2.0 060 */ 061 062 public class Operation { 063 064 private QualifiedName name = null; 065 066 private List<DCP> dcpList = null; 067 068 private List<Parameter> parameters = null; 069 070 private List<DomainType> constraints = null; 071 072 private Object metadata = null; 073 074 private String description = null; 075 076 /** 077 * Standard constructor that initializes all encapsulated data. 078 * 079 * @param name 080 * @param dcpList 081 * @param parameters 082 * @param constraints 083 * @param metadata 084 * @param description 085 */ 086 public Operation( QualifiedName name, List<DCP> dcpList, List<Parameter> parameters, 087 List<DomainType> constraints, Object metadata, String description ) { 088 this.name = name; 089 this.dcpList = dcpList; 090 this.parameters = parameters; 091 this.constraints = constraints; 092 this.metadata = metadata; 093 this.description = description; 094 } 095 096 /** 097 * @return Returns the constraints. 098 */ 099 public List<DomainType> getConstraints() { 100 return constraints; 101 } 102 103 /** 104 * @return Returns the dCP. 105 */ 106 public List<DCP> getDCP() { 107 return dcpList; 108 } 109 110 /** 111 * @return Returns the description. 112 */ 113 public String getDescription() { 114 return description; 115 } 116 117 /** 118 * @return Returns the metadata. 119 */ 120 public Object getMetadata() { 121 return metadata; 122 } 123 124 /** 125 * @return Returns the parameters. 126 */ 127 public List<Parameter> getParameters() { 128 return parameters; 129 } 130 131 /** 132 * @param name 133 * @return the <code>DomainType</code> with the specified name or null, if there is no 134 * constraint with that name. 135 */ 136 public DomainType getConstraint( QualifiedName name ) { 137 for ( DomainType constraint : constraints ) { 138 if ( constraint.getName().equals( name ) ) { 139 return constraint; 140 } 141 } 142 143 return null; 144 } 145 146 /** 147 * @param name 148 * @return the <code>Parameter</code> with the specified name or null, if there is no 149 * parameter with that name. This method only tests Parameters that are <code>DomainType</code>s. 150 */ 151 public Parameter getParameter( QualifiedName name ) { 152 for ( Parameter parameter : parameters ) { 153 if ( parameter instanceof DomainType ) { 154 if ( ( (DomainType) parameter ).getName().equals( name ) ) { 155 return parameter; 156 } 157 } 158 } 159 160 return null; 161 } 162 163 /** 164 * @return Returns the name. 165 */ 166 public QualifiedName getName() { 167 return name; 168 } 169 170 }