--- /dev/null
+package org.collectionspace.hello.client;
+
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.hello.PersonNuxeo;
+import org.collectionspace.hello.People;
+import org.jboss.resteasy.client.ProxyFactory;
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.spi.ResteasyProviderFactory;
+
+/**
+ * A PersonNuxeoClient.
+
+ * @version $Revision:$
+ */
+public class PersonNuxeoClient {
+
+ /**
+ *
+ */
+ private static final PersonNuxeoClient instance = new PersonNuxeoClient();
+ /**
+ *
+ */
+ private PersonNuxeoProxy personProxy;
+
+ /**
+ *
+ * Create a new PersonNuxeoClient.
+ *
+ */
+ private PersonNuxeoClient() {
+ ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
+ RegisterBuiltin.register(factory);
+ personProxy = ProxyFactory.create(PersonNuxeoProxy.class, "http://localhost:8080/helloworld/cspace-nuxeo");
+ }
+
+ /**
+ * FIXME Comment this
+ *
+ * @return
+ */
+ public static PersonNuxeoClient getInstance() {
+ return instance;
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson()
+ */
+ public ClientResponse<People> getPeople() {
+ return personProxy.getPeople();
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see org.collectionspace.hello.client.PersonNuxeoProxy#getPerson(java.lang.String)
+ */
+ public ClientResponse<PersonNuxeo> getPerson(String id) {
+ return personProxy.getPerson(id);
+ }
+
+ /**
+ * @param person
+ * @return
+ * @see org.collectionspace.hello.client.PersonNuxeoProxy#createPerson(org.collectionspace.hello.PersonNuxeo)
+ */
+ public ClientResponse<Response> createPerson(PersonNuxeo person) {
+ return personProxy.createPerson(person);
+ }
+
+ /**
+ * @param id
+ * @param person
+ * @return
+ * @see org.collectionspace.hello.client.PersonNuxeoProxy#updatePerson(java.lang.Long, org.collectionspace.hello.PersonNuxeo)
+ */
+ public ClientResponse<PersonNuxeo> updatePerson(String id, PersonNuxeo person) {
+ return personProxy.updatePerson(id, person);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see org.collectionspace.hello.client.PersonNuxeoProxy#deletePerson(java.lang.Long)
+ */
+ public ClientResponse<Response> deletePerson(String id) {
+ return personProxy.deletePerson(id);
+ }
+}
--- /dev/null
+package org.collectionspace.hello.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.hello.PersonNuxeo;
+import org.collectionspace.hello.People;
+import org.jboss.resteasy.client.ClientResponse;
+
+/**
+ * @version $Revision:$
+ */
+@Path("/persons/")
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public interface PersonNuxeoProxy {
+
+ @GET
+ ClientResponse<People> getPeople();
+
+ @GET
+ @Path("/{id}")
+ ClientResponse<PersonNuxeo> getPerson(@PathParam("id") String id);
+
+ @POST
+ ClientResponse<Response> createPerson(PersonNuxeo so);
+
+ @PUT
+ @Path("/{id}")
+ ClientResponse<PersonNuxeo> updatePerson(@PathParam("id") String id, PersonNuxeo so);
+
+ @DELETE
+ @Path("/{id}")
+ ClientResponse<Response> deletePerson(@PathParam("id") String id);
+}
\ No newline at end of file