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 CollectionSpaceClient {
23 private static final CollectionObjectClient instance = new CollectionObjectClient();
27 private CollectionObjectProxy collectionObjectProxy;
31 * Default constructor for CollectionObjectClient class.
34 private CollectionObjectClient() {
35 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
36 RegisterBuiltin.register(factory);
38 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
39 getBaseURL(), getHttpClient());
41 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
51 public static CollectionObjectClient getInstance() {
57 * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject()
59 public ClientResponse<CollectionObjectList> getCollectionObjectList() {
60 return collectionObjectProxy.getCollectionObjectList();
66 * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String)
68 public ClientResponse<CollectionObject> getCollectionObject(String csid) {
69 return collectionObjectProxy.getCollectionObject(csid);
73 * @param collectionobject
75 * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.CollectionObject)
77 public ClientResponse<Response> createCollectionObject(CollectionObject collectionObject) {
78 return collectionObjectProxy.createCollectionObject(collectionObject);
83 * @param collectionobject
85 * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.Long, org.collectionspace.hello.CollectionObject)
87 public ClientResponse<CollectionObject> updateCollectionObject(String csid, CollectionObject collectionObject) {
88 return collectionObjectProxy.updateCollectionObject(csid, collectionObject);
94 * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.Long)
96 public ClientResponse<Response> deleteCollectionObject(String csid) {
97 return collectionObjectProxy.deleteCollectionObject(csid);