Project

General

Profile

« Previous | Next » 

Revision 5291

Added by Matt Jones about 14 years ago

Refactored putObject method to separate the create() and update() portions in order to match the method signatures needed for DataONE.

View differences:

MetacatRest.java
148 148
    public Reader authenticatedQuery(Reader xmlQuery) throws MetacatInaccessibleException,IOException;
149 149
    
150 150
    /**
151
     * Insert / Update an XML document into the repository, making it available for 
151
     * Create an XML document into the repository, making it available for 
152 152
     * searching using the query() methods.
153 153
     *
154 154
     * @param docid the docid to insert the document
155 155
     * @param xmlDocument a Reader for accessing the XML document to be inserted
156
     * @param isInsert whether the operation is update or insert
157 156
     * 
158 157
     * @return the metacat response message
159 158
     * @throws InsufficientKarmaException when the user has insufficent rights
......
163 162
     * @throws MetacatException when the metacat server generates another error
164 163
     * @throws IOException when there is an error reading the xml document
165 164
     */
166
    public String putObject(String docid, Reader xmlDocument,boolean isInsert)
165
    public String create(String docid, Reader xmlDocument)
167 166
        throws InsufficientKarmaException, MetacatException, IOException,
168 167
        MetacatInaccessibleException;
169 168

  
170
 
169
    /**
170
     * Update an XML document into the repository, making it available for 
171
     * searching using the query() methods.
172
     *
173
     * @param docid the docid to insert the document
174
     * @param xmlDocument a Reader for accessing the XML document to be inserted
175
     * 
176
     * @return the metacat response message
177
     * @throws InsufficientKarmaException when the user has insufficent rights
178
     *                                    for the operation
179
     * @throws MetacatInaccessibleException when the metacat server can not be
180
     *                                    reached or does not respond
181
     * @throws MetacatException when the metacat server generates another error
182
     * @throws IOException when there is an error reading the xml document
183
     */
184
    public String update(String docid, Reader xmlDocument)
185
        throws InsufficientKarmaException, MetacatException, IOException,
186
        MetacatInaccessibleException;
187
    
171 188

  
172 189
    /**
173 190
     * Delete an XML document in the repository.

Also available in: Unified diff