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