001 //$HeadURL: http://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/ogcwebservices/csw/manager/Update.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.manager;
037
038 import java.net.URI;
039 import java.util.List;
040
041 import org.deegree.model.feature.FeatureProperty;
042 import org.deegree.model.filterencoding.Filter;
043 import org.w3c.dom.Element;
044
045 /**
046 * An Update object is used to specify values to be used to change existing information in the
047 * catalogue. If a complete record instance value is specified then the entire record in the
048 * catalogue will be replaced by the value constained in the Update object. If individual record
049 * property values are specified in an Update object, then those individual property values of the
050 * catalogue record shall be updated.
051 *
052 * @version $Revision: 18195 $
053 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
054 * @author last edited by: $Author: mschneider $
055 *
056 * @version 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Thu, 18 Jun 2009) $
057 *
058 * @since 2.0
059 */
060 public class Update extends Operation {
061
062 private URI typeName = null;
063
064 private Filter constraint = null;
065
066 private Element record = null;
067
068 private List<FeatureProperty> recordProperties = null;
069
070 /**
071 *
072 * @param handle
073 * @param typeName
074 * @param constraint
075 * @param record
076 * @param recordProperties
077 */
078 public Update( String handle, URI typeName, Filter constraint, Element record,
079 List<FeatureProperty> recordProperties ) {
080 super( "Update", handle );
081
082 this.typeName = typeName;
083 this.constraint = constraint;
084 this.record = record;
085 this.recordProperties = recordProperties;
086 }
087
088 /**
089 * The number of records affected by an update action is determined by the contents of the
090 * constraint.
091 *
092 * @return the filter
093 */
094 public Filter getConstraint() {
095 return constraint;
096 }
097
098 /**
099 * sets the constraint to be considered with an Update operation
100 *
101 * @param constraint
102 */
103 public void setConstraint( Filter constraint ) {
104 this.constraint = constraint;
105 }
106
107 /**
108 * complete metadata record to be updated. can be used as an alternative for recordProperties.
109 *
110 * @return the element
111 */
112 public Element getRecord() {
113 return record;
114 }
115
116 /**
117 * The <csw:RecordProperty> element contains a <csw:Name> element and a <csw:Value> element. The
118 * <csw:Name> element is used to specify the name of the record property to be updated. The
119 * value of the <csw:Name> element may be a path expression to identify complex properties. The
120 * <csw:Value> element contains the value that will be used to update the record in the
121 * catalogue.
122 *
123 * @return the properties
124 */
125 public List<FeatureProperty> getRecordProperties() {
126 return recordProperties;
127 }
128
129 /**
130 * The optional typeName attribute may be used to specify the collection name from which records
131 * will be updated.
132 *
133 * @return the name
134 */
135 public URI getTypeName() {
136 return typeName;
137 }
138
139 }