001 //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/ogcwebservices/csw/manager/Insert.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.util.HashMap; 039 import java.util.List; 040 import java.util.Map; 041 042 import org.w3c.dom.Element; 043 044 /** 045 * An Insert object is a container for one or more records that are to be inserted into the 046 * catalogue. The schema of the record(s) must conform to the schema of the information model that 047 * the catalogue supports as described using the DescribeRecord operation. 048 * 049 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a> 050 * @author last edited by: $Author: mschneider $ 051 * 052 * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $ 053 * 054 */ 055 public class Insert extends Operation { 056 057 private List<Element> records = null; 058 059 private Map<String, Element> extrinsicObjects; 060 061 /** 062 * 063 * @param handle 064 * attribute of the insert. 065 * @param records 066 * a list containing all (firstlevel) child xml elements beneath the <csw:insert> 067 * element 068 * 069 */ 070 public Insert( String handle, List<Element> records ) { 071 super( "Insert", handle ); 072 this.records = records; 073 this.extrinsicObjects = new HashMap<String, Element>(); 074 } 075 076 /** 077 * @param handle 078 * attribute of the insert. 079 * @param records 080 * a list containing all (firstlevel) child xml elements beneath the <csw:insert> 081 * element 082 * @param extrinsicObjects 083 * a mapping of the lid of the values to the rim:ExtrinsicObject w3c-element. They 084 * are needed to find the actual extrinsic objects into the multiparts send to the 085 * csw. 086 * 087 */ 088 public Insert( String handle, List<Element> records, Map<String, Element> extrinsicObjects ) { 089 super( "Insert", handle ); 090 this.records = records; 091 if( extrinsicObjects != null ){ 092 this.extrinsicObjects = extrinsicObjects; 093 } else { 094 this.extrinsicObjects = new HashMap<String, Element>(); 095 } 096 } 097 098 /** 099 * returns records to insert 100 * 101 * @return records to insert 102 */ 103 public List<Element> getRecords() { 104 return records; 105 } 106 107 /** 108 * @return the ebrim extrinsicObjects which should be inserted or an empty map if no 109 * ExtrinsicObject should be inserted, or no ebrim is used in this catalogue. 110 */ 111 public Map<String, Element> getExtrinsicObjects() { 112 return extrinsicObjects; 113 } 114 115 }