1 package org.collectionspace.hello.client;
3 import javax.ws.rs.core.Response;
5 import org.collectionspace.hello.CollectionObject;
6 import org.collectionspace.hello.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 {
24 private static final CollectionObjectClient instance = new CollectionObjectClient();
28 private CollectionObjectProxy collectionObjectProxy;
32 * Default constructor for CollectionObjectClient class.
35 private CollectionObjectClient() {
36 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
37 RegisterBuiltin.register(factory);
38 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class, getURL());
46 public static CollectionObjectClient getInstance() {
52 * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject()
54 public ClientResponse<CollectionObjectList> getCollectionObjectList() {
55 return collectionObjectProxy.getCollectionObjectList();
61 * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String)
63 public ClientResponse<CollectionObject> getCollectionObject(String csid) {
64 return collectionObjectProxy.getCollectionObject(csid);
68 * @param collectionobject
70 * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.CollectionObject)
72 public ClientResponse<Response> createCollectionObject(CollectionObject collectionObject) {
73 return collectionObjectProxy.createCollectionObject(collectionObject);
78 * @param collectionobject
80 * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.Long, org.collectionspace.hello.CollectionObject)
82 public ClientResponse<CollectionObject> updateCollectionObject(String csid, CollectionObject collectionObject) {
83 return collectionObjectProxy.updateCollectionObject(csid, collectionObject);
89 * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.Long)
91 public ClientResponse<Response> deleteCollectionObject(String csid) {
92 return collectionObjectProxy.deleteCollectionObject(csid);