]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
8fd55ac08062280fb65df53e5e2ec094dff12628
[tmp/jakarta-migration.git] /
1 package org.collectionspace.hello.client;
2
3 import javax.ws.rs.core.Response;
4
5 import org.collectionspace.hello.CollectionObject;
6 import org.collectionspace.hello.CollectionObjectList;
7
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;
12
13 /**
14  * A CollectionObjectClient.
15
16  * @version $Revision:$
17  */
18 public class CollectionObjectClient extends CollectionSpaceClient {
19
20
21     /**
22      *
23      */
24     private static final CollectionObjectClient instance = new CollectionObjectClient();
25     /**
26      *
27      */
28     private CollectionObjectProxy collectionObjectProxy;
29
30     /**
31      *
32      * Default constructor for CollectionObjectClient class.
33      *
34      */
35     private CollectionObjectClient() {
36         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
37         RegisterBuiltin.register(factory);
38         collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class, getURL());
39     }
40
41     /**
42      * FIXME Comment this
43      *
44      * @return
45      */
46     public static CollectionObjectClient getInstance() {
47         return instance;
48     }
49
50     /**
51      * @return
52      * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject()
53      */
54     public ClientResponse<CollectionObjectList> getCollectionObjectList() {
55         return collectionObjectProxy.getCollectionObjectList();
56     }
57
58     /**
59      * @param csid
60      * @return
61      * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String)
62      */
63     public ClientResponse<CollectionObject> getCollectionObject(String csid) {
64         return collectionObjectProxy.getCollectionObject(csid);
65     }
66
67     /**
68      * @param collectionobject
69      * @return
70      * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.CollectionObject)
71      */
72     public ClientResponse<Response> createCollectionObject(CollectionObject collectionObject) {
73         return collectionObjectProxy.createCollectionObject(collectionObject);
74     }
75
76     /**
77      * @param csid
78      * @param collectionobject
79      * @return
80      * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.Long, org.collectionspace.hello.CollectionObject)
81      */
82     public ClientResponse<CollectionObject> updateCollectionObject(String csid, CollectionObject collectionObject) {
83         return collectionObjectProxy.updateCollectionObject(csid, collectionObject);
84     }
85
86     /**
87      * @param csid
88      * @return
89      * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.Long)
90      */
91     public ClientResponse<Response> deleteCollectionObject(String csid) {
92         return collectionObjectProxy.deleteCollectionObject(csid);
93     }
94 }