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;
7 import org.jboss.resteasy.client.ProxyFactory;
8 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
9 import org.jboss.resteasy.client.ClientResponse;
10 import org.jboss.resteasy.spi.ResteasyProviderFactory;
13 * A CollectionObjectClient.
15 * @version $Revision:$
17 public class CollectionObjectClient {
22 private static final CollectionObjectClient instance = new CollectionObjectClient();
26 private CollectionObjectProxy CollectionObjectProxy;
30 * Create a new CollectionObjectClient.
33 private CollectionObjectClient() {
34 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
35 RegisterBuiltin.register(factory);
36 CollectionObjectProxy =
37 ProxyFactory.create(CollectionObjectProxy.class, "http://localhost:8080/helloworld/cspace");
45 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 id) {
64 return CollectionObjectProxy.getCollectionObject(id);
68 * @param CollectionObject
70 * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.client.entity.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.String, org.collectionspace.hello.client.entity.CollectionObject)
82 public ClientResponse<CollectionObject> updateCollectionObject(String id, CollectionObject CollectionObject) {
83 return CollectionObjectProxy.updateCollectionObject(id, CollectionObject);
89 * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.String)
91 public ClientResponse<Response> deleteCollectionObject(String id) {
92 return CollectionObjectProxy.deleteCollectionObject(id);