1 package org.collectionspace.services.client;
3 import javax.ws.rs.core.Response;
5 import org.collectionspace.services.collectionobject.CollectionObject;
6 import org.collectionspace.services.collectionobject.CollectionObjectList;
8 import org.jboss.resteasy.client.ProxyFactory;
9 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
10 import org.jboss.resteasy.client.ClientResponse;
11 import org.jboss.resteasy.spi.ResteasyProviderFactory;
14 * A CollectionObjectClient.
16 * @version $Revision:$
18 public class CollectionObjectClient extends BaseServiceClient {
23 private CollectionObjectProxy collectionObjectProxy;
27 * Default constructor for CollectionObjectClient class.
30 public CollectionObjectClient() {
31 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
32 RegisterBuiltin.register(factory);
37 * allow to reset proxy as per security needs
39 public void setProxy() {
41 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
42 getBaseURL(), getHttpClient());
44 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
51 * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject()
53 public ClientResponse<CollectionObjectList> readList() {
54 return collectionObjectProxy.readList();
60 * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String)
62 public ClientResponse<CollectionObject> read(String csid) {
63 return collectionObjectProxy.read(csid);
67 * @param collectionobject
69 * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.CollectionObject)
71 public ClientResponse<Response> create(CollectionObject collectionObject) {
72 return collectionObjectProxy.create(collectionObject);
77 * @param collectionobject
79 * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.Long, org.collectionspace.hello.CollectionObject)
81 public ClientResponse<CollectionObject> update(String csid, CollectionObject collectionObject) {
82 return collectionObjectProxy.update(csid, collectionObject);
88 * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.Long)
90 public ClientResponse<Response> delete(String csid) {
91 return collectionObjectProxy.delete(csid);