2 * LocationAuthorityClient.java
4 * {Purpose of This Class}
6 * {Other Notes Relating to This Class (Optional)}
9 * $LastChangedRevision: $
12 * This document is a part of the source code and related artifacts
13 * for CollectionSpace, an open source collections management system
14 * for museums and related institutions:
16 * http://www.collectionspace.org
17 * http://wiki.collectionspace.org
19 * Copyright © 2009 {Contributing Institution}
21 * Licensed under the Educational Community License (ECL), Version 2.0.
22 * You may not use this file except in compliance with this License.
24 * You may obtain a copy of the ECL 2.0 License at
25 * https://source.collectionspace.org/collection-space/LICENSE.txt
27 package org.collectionspace.services.client;
29 import javax.ws.rs.PathParam;
30 import javax.ws.rs.core.Response;
32 //import org.collectionspace.services.common.authorityref.AuthorityRefList;
33 import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
34 import org.collectionspace.services.contact.ContactsCommonList;
35 import org.collectionspace.services.location.LocationauthoritiesCommonList;
36 import org.collectionspace.services.location.LocationsCommonList;
37 import org.collectionspace.services.client.LocationAuthorityProxy;
39 import org.jboss.resteasy.client.ClientResponse;
40 import org.jboss.resteasy.client.ProxyFactory;
41 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
42 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
43 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
44 import org.jboss.resteasy.spi.ResteasyProviderFactory;
47 * The Class LocationAuthorityClient.
49 public class LocationAuthorityClient extends AbstractServiceClientImpl {
52 * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
55 public String getServicePathComponent() {
56 return "locationauthorities";
60 * Gets the item common part name.
62 * @return the item common part name
64 public String getItemCommonPartName() {
65 return getCommonPartName("locations");
68 /** The location authority proxy. */
69 // private static final LocationAuthorityClient instance = new LocationAuthorityClient();
74 private LocationAuthorityProxy locationAuthorityProxy;
77 * Instantiates a new location authority client.
79 public LocationAuthorityClient() {
80 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
81 RegisterBuiltin.register(factory);
86 * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
89 public CollectionSpaceProxy getProxy() {
90 return this.locationAuthorityProxy;
96 public void setProxy() {
98 locationAuthorityProxy = ProxyFactory.create(LocationAuthorityProxy.class,
99 getBaseURL(), getHttpClient());
101 locationAuthorityProxy = ProxyFactory.create(LocationAuthorityProxy.class,
109 * @return the client response
111 // public static LocationAuthorityClient getInstance() {
117 * @see org.collectionspace.services.client.LocationAuthorityProxy#readList()
119 public ClientResponse<LocationauthoritiesCommonList> readList() {
120 return locationAuthorityProxy.readList();
126 * @param csid the csid
127 * @return the client response
129 public ClientResponse<MultipartInput> read(String csid) {
130 return locationAuthorityProxy.read(csid);
136 * @param name the name
137 * @return the client response
139 public ClientResponse<MultipartInput> readByName(String name) {
140 return locationAuthorityProxy.readByName(name);
146 * @param multipart the multipart
147 * @return the client response
149 public ClientResponse<Response> create(MultipartOutput multipart) {
150 return locationAuthorityProxy.create(multipart);
156 * @param csid the csid
157 * @param multipart the multipart
158 * @return the client response
160 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
161 return locationAuthorityProxy.update(csid, multipart);
168 * @param csid the csid
169 * @return the client response
171 public ClientResponse<Response> delete(String csid) {
172 return locationAuthorityProxy.delete(csid);
178 * @param vcsid the vcsid
179 * @return the client response
181 public ClientResponse<LocationsCommonList> readItemList(String vcsid) {
182 return locationAuthorityProxy.readItemList(vcsid);
186 * Gets the referencing objects.
188 * @param parentcsid the parentcsid
189 * @param csid the csid
190 * @return the referencing objects
192 public ClientResponse<AuthorityRefDocList> getReferencingObjects(String parentcsid, String csid) {
193 return locationAuthorityProxy.getReferencingObjects(parentcsid, csid);
197 * Read item list for named authority.
199 * @param specifier the specifier
200 * @return the client response
202 public ClientResponse<LocationsCommonList> readItemListForNamedAuthority(String specifier) {
203 return locationAuthorityProxy.readItemListForNamedAuthority(specifier);
209 * @param vcsid the vcsid
210 * @param csid the csid
211 * @return the client response
213 public ClientResponse<MultipartInput> readItem(String vcsid, String csid) {
214 return locationAuthorityProxy.readItem(vcsid, csid);
220 * @param vcsid the vcsid
221 * @param multipart the multipart
222 * @return the client response
224 public ClientResponse<Response> createItem(String vcsid, MultipartOutput multipart) {
225 return locationAuthorityProxy.createItem(vcsid, multipart);
231 * @param vcsid the vcsid
232 * @param csid the csid
233 * @param multipart the multipart
234 * @return the client response
236 public ClientResponse<MultipartInput> updateItem(String vcsid, String csid, MultipartOutput multipart) {
237 return locationAuthorityProxy.updateItem(vcsid, csid, multipart);
244 * @param vcsid the vcsid
245 * @param csid the csid
246 * @return the client response
248 public ClientResponse<Response> deleteItem(String vcsid, String csid) {
249 return locationAuthorityProxy.deleteItem(vcsid, csid);
253 * Creates the contact.
255 * @param parentcsid the parentcsid
256 * @param itemcsid the itemcsid
257 * @param multipart the multipart
258 * @return the client response
260 public ClientResponse<Response> createContact(String parentcsid,
261 String itemcsid, MultipartOutput multipart) {
262 return locationAuthorityProxy.createContact(parentcsid, itemcsid, multipart);
268 * @param parentcsid the parentcsid
269 * @param itemcsid the itemcsid
270 * @param csid the csid
271 * @return the client response
273 public ClientResponse<MultipartInput> readContact(String parentcsid,
274 String itemcsid, String csid) {
275 return locationAuthorityProxy.readContact(parentcsid, itemcsid, csid);
281 * @param parentcsid the parentcsid
282 * @param itemcsid the itemcsid
283 * @return the client response
285 public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
287 return locationAuthorityProxy.readContactList(parentcsid, itemcsid);
293 * @param parentcsid the parentcsid
294 * @param itemcsid the itemcsid
295 * @param csid the csid
296 * @param multipart the multipart
297 * @return the client response
299 public ClientResponse<MultipartInput> updateContact(String parentcsid,
300 String itemcsid, String csid, MultipartOutput multipart) {
301 return locationAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart);
307 * @param parentcsid the parentcsid
308 * @param itemcsid the itemcsid
309 * @param csid the csid
310 * @return the client response
312 public ClientResponse<Response> deleteContact(String parentcsid,
313 String itemcsid, String csid) {
314 return locationAuthorityProxy.deleteContact(parentcsid,