]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
56061c6ad100596568ce17c2794ff4de992ff0e5
[tmp/jakarta-migration.git] /
1 package org.collectionspace.hello.client;
2
3 import javax.ws.rs.core.Response;
4
5 import org.collectionspace.hello.DomainIdentifier;
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 DomainIdentifierClient extends CollectionSpaceClient {
17
18
19     /**
20      *
21      */
22     private static final DomainIdentifierClient instance = new DomainIdentifierClient();
23     /**
24      *
25      */
26     private DomainIdentifierProxy identifierProxy;
27
28     /**
29      *
30      * Create a new IdentifierClient.
31      *
32      */
33     private DomainIdentifierClient() {
34         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
35         RegisterBuiltin.register(factory);
36         identifierProxy = ProxyFactory.create(DomainIdentifierProxy.class, getURL());
37     }
38
39     /**
40      * FIXME Comment this
41      *
42      * @return
43      */
44     public static DomainIdentifierClient getInstance() {
45         return instance;
46     }
47
48     /**
49      * @param id
50      * @return
51      * @see org.collectionspace.hello.client.IdentifierProxy#getIdentifier(java.lang.Long)
52      */
53     public ClientResponse<DomainIdentifier> getIdentifier(String id) {
54         return identifierProxy.getIdentifier(id);
55     }
56
57     /**
58      * @param identifier
59      * @return
60      * @see org.collectionspace.hello.client.IdentifierProxy#createIdentifier(org.collectionspace.hello.client.entity.Identifier)
61      */
62     public ClientResponse<Response> createIdentifier(DomainIdentifier identifier) {
63         return identifierProxy.createIdentifier(identifier);
64     }
65 }