]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
8e5a7cf9f650c606dd082b0412585aa0d5445d1e
[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 {
19
20         private static final String HOST = "http://localhost:8080";
21         private static final String URI = "/helloworld/cspace-nuxeo";
22
23     /**
24      *
25      */
26     private static final CollectionObjectClient instance = new CollectionObjectClient();
27     /**
28      *
29      */
30     private CollectionObjectProxy collectionObjectProxy;
31
32     /**
33      *
34      * Default constructor for CollectionObjectClient class.
35      *
36      */
37     private CollectionObjectClient() {
38         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
39         RegisterBuiltin.register(factory);
40         collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class, HOST + URI);
41     }
42
43     /**
44      * FIXME Comment this
45      *
46      * @return
47      */
48     public static CollectionObjectClient getInstance() {
49         return instance;
50     }
51
52     /**
53      * @return
54      * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject()
55      */
56     public ClientResponse<CollectionObjectList> getCollectionObjectList() {
57         return collectionObjectProxy.getCollectionObjectList();
58     }
59
60     /**
61      * @param csid
62      * @return
63      * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String)
64      */
65     public ClientResponse<CollectionObject> getCollectionObject(String csid) {
66         return collectionObjectProxy.getCollectionObject(csid);
67     }
68
69     /**
70      * @param collectionobject
71      * @return
72      * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.CollectionObject)
73      */
74     public ClientResponse<Response> createCollectionObject(CollectionObject collectionObject) {
75         return collectionObjectProxy.createCollectionObject(collectionObject);
76     }
77
78     /**
79      * @param csid
80      * @param collectionobject
81      * @return
82      * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.Long, org.collectionspace.hello.CollectionObject)
83      */
84     public ClientResponse<CollectionObject> updateCollectionObject(String csid, CollectionObject collectionObject) {
85         return collectionObjectProxy.updateCollectionObject(csid, collectionObject);
86     }
87
88     /**
89      * @param csid
90      * @return
91      * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.Long)
92      */
93     public ClientResponse<Response> deleteCollectionObject(String csid) {
94         return collectionObjectProxy.deleteCollectionObject(csid);
95     }
96 }