]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
6a20afb941a1e856139bd1aa1b3c06ef919d1758
[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 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;
11
12 /**
13  * A CollectionObjectClient.
14
15  * @version $Revision:$
16  */
17 public class CollectionObjectClient {
18
19     /**
20      *
21      */
22     private static final CollectionObjectClient instance = new CollectionObjectClient();
23     /**
24      *
25      */
26     private CollectionObjectProxy CollectionObjectProxy;
27
28     /**
29      *
30      * Create a new CollectionObjectClient.
31      *
32      */
33     private CollectionObjectClient() {
34         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
35         RegisterBuiltin.register(factory);
36         CollectionObjectProxy =
37           ProxyFactory.create(CollectionObjectProxy.class, "http://localhost:8080/helloworld/cspace");
38     }
39
40     /**
41      * FIXME Comment this
42      *
43      * @return
44      */
45     public static CollectionObjectClient getInstance() {
46         return instance;
47     }
48
49     /**
50      * @param id
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 id
60      * @return
61      * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String)
62      */
63     public ClientResponse<CollectionObject> getCollectionObject(String id) {
64         return CollectionObjectProxy.getCollectionObject(id);
65     }
66
67     /**
68      * @param CollectionObject
69      * @return
70      * @see org.collectionspace.hello.client.CollectionObjectProxy#createCollectionObject(org.collectionspace.hello.client.entity.CollectionObject)
71      */
72     public ClientResponse<Response> createCollectionObject(CollectionObject CollectionObject) {
73         return CollectionObjectProxy.createCollectionObject(CollectionObject);
74     }
75
76     /**
77      * @param id
78      * @param CollectionObject
79      * @return
80      * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.String, org.collectionspace.hello.client.entity.CollectionObject)
81      */
82     public ClientResponse<CollectionObject> updateCollectionObject(String id, CollectionObject CollectionObject) {
83         return CollectionObjectProxy.updateCollectionObject(id, CollectionObject);
84     }
85
86     /**
87      * @param id
88      * @return
89      * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.String)
90      */
91     public ClientResponse<Response> deleteCollectionObject(String id) {
92         return CollectionObjectProxy.deleteCollectionObject(id);
93     }
94 }