1 package org.collectionspace.services.client;
3 import javax.ws.rs.core.Response;
5 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
6 import org.collectionspace.services.organization.OrganizationsCommonList;
8 import org.jboss.resteasy.client.ClientResponse;
9 import org.jboss.resteasy.client.ProxyFactory;
10 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
11 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
12 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
13 import org.jboss.resteasy.spi.ResteasyProviderFactory;
16 * A OrgAuthorityClient.
18 * @version $Revision:$
20 public class OrgAuthorityClient extends AbstractServiceClientImpl {
23 * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
26 public String getServicePathComponent() {
27 return "orgauthorities";
30 public String getItemCommonPartName() {
31 return getCommonPartName("organizations");
36 private static final OrgAuthorityClient instance = new OrgAuthorityClient();
40 private OrgAuthorityProxy orgAuthorityProxy;
44 * Default constructor for OrgAuthorityClient class.
47 public OrgAuthorityClient() {
48 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
49 RegisterBuiltin.register(factory);
54 * allow to reset proxy as per security needs
56 public void setProxy() {
58 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
59 getBaseURL(), getHttpClient());
61 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
71 public static OrgAuthorityClient getInstance() {
77 * @see org.collectionspace.services.client.OrgAuthorityProxy#readList()
79 public ClientResponse<OrgauthoritiesCommonList> readList() {
80 return orgAuthorityProxy.readList();
86 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
88 public ClientResponse<MultipartInput> read(String csid) {
89 return orgAuthorityProxy.read(csid);
95 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
97 public ClientResponse<Response> create(MultipartOutput multipart) {
98 return orgAuthorityProxy.create(multipart);
103 * @param orgAuthority
105 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
107 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
108 return orgAuthorityProxy.update(csid, multipart);
115 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
117 public ClientResponse<Response> delete(String csid) {
118 return orgAuthorityProxy.delete(csid);
123 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemList()
125 public ClientResponse<OrganizationsCommonList> readItemList(String vcsid) {
126 return orgAuthorityProxy.readItemList(vcsid);
132 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
134 public ClientResponse<MultipartInput> readItem(String vcsid, String csid) {
135 return orgAuthorityProxy.readItem(vcsid, csid);
139 * @param orgAuthority
141 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
143 public ClientResponse<Response> createItem(String vcsid, MultipartOutput multipart) {
144 return orgAuthorityProxy.createItem(vcsid, multipart);
149 * @param orgAuthority
151 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
153 public ClientResponse<MultipartInput> updateItem(String vcsid, String csid, MultipartOutput multipart) {
154 return orgAuthorityProxy.updateItem(vcsid, csid, multipart);
161 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
163 public ClientResponse<Response> deleteItem(String vcsid, String csid) {
164 return orgAuthorityProxy.deleteItem(vcsid, csid);