]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
eda08b0d58830dda3dd0d46b7cb02029e378c2dd
[tmp/jakarta-migration.git] /
1 package org.collectionspace.hello.client;
2
3 import javax.ws.rs.core.Response;
4
5 import org.collectionspace.hello.Identifier;
6 import org.jboss.resteasy.client.ProxyFactory;
7 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
8 import org.jboss.resteasy.client.ClientResponse;
9 import org.jboss.resteasy.spi.ResteasyProviderFactory;
10
11 /**
12  * A IdentifierClient.
13
14  * @version $Revision:$
15  */
16 public class IdentifierClient {
17
18     /**
19      *
20      */
21     private static final IdentifierClient instance = new IdentifierClient();
22     /**
23      *
24      */
25     private IdentifierProxy identifierProxy;
26
27     /**
28      *
29      * Create a new IdentifierClient.
30      *
31      */
32     private IdentifierClient() {
33         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
34         RegisterBuiltin.register(factory);
35         identifierProxy = ProxyFactory.create(IdentifierProxy.class, "http://localhost:8080/helloworld/cspace-nuxeo");
36     }
37
38     /**
39      * FIXME Comment this
40      *
41      * @return
42      */
43     public static IdentifierClient getInstance() {
44         return instance;
45     }
46
47     /**
48      * @param id
49      * @return
50      * @see org.collectionspace.hello.client.IdentifierProxy#getIdentifier(java.lang.Long)
51      */
52     public ClientResponse<Identifier> getIdentifier(Long id) {
53         return identifierProxy.getIdentifier(id);
54     }
55
56     /**
57      * @param identifier
58      * @return
59      * @see org.collectionspace.hello.client.IdentifierProxy#createIdentifier(org.collectionspace.hello.client.entity.Identifier)
60      */
61     public ClientResponse<Response> createIdentifier(Identifier identifier) {
62         return identifierProxy.createIdentifier(identifier);
63     }
64 }