1 package org.collectionspace.hello.client;
3 import javax.ws.rs.core.Response;
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;
14 * @version $Revision:$
16 public class IdentifierClient {
21 private static final IdentifierClient instance = new IdentifierClient();
25 private IdentifierProxy identifierProxy;
29 * Create a new IdentifierClient.
32 private IdentifierClient() {
33 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
34 RegisterBuiltin.register(factory);
35 identifierProxy = ProxyFactory.create(IdentifierProxy.class, "http://localhost:8080/helloworld/cspace");
43 public static IdentifierClient getInstance() {
50 * @see org.collectionspace.hello.client.IdentifierProxy#getIdentifier(java.lang.Long)
52 public ClientResponse<Identifier> getIdentifier(Long id) {
53 return identifierProxy.getIdentifier(id);
59 * @see org.collectionspace.hello.client.IdentifierProxy#createIdentifier(org.collectionspace.hello.client.entity.Identifier)
61 public ClientResponse<Response> createIdentifier(Identifier identifier) {
62 return identifierProxy.createIdentifier(identifier);