1 package org.collectionspace.services.client;
3 import javax.ws.rs.core.Response;
5 import org.collectionspace.services.contact.ContactsCommonList;
6 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
7 import org.collectionspace.services.organization.OrganizationsCommonList;
9 import org.jboss.resteasy.client.ClientResponse;
10 import org.jboss.resteasy.client.ProxyFactory;
11 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
12 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
13 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
14 import org.jboss.resteasy.spi.ResteasyProviderFactory;
17 * A OrgAuthorityClient.
19 * @version $Revision:$
21 public class OrgAuthorityClient extends AbstractServiceClientImpl {
24 * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
27 public String getServicePathComponent() {
28 return "orgauthorities";
31 public String getItemCommonPartName() {
32 return getCommonPartName("organizations");
37 private static final OrgAuthorityClient instance = new OrgAuthorityClient();
41 private OrgAuthorityProxy orgAuthorityProxy;
45 * Default constructor for OrgAuthorityClient class.
48 public OrgAuthorityClient() {
49 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
50 RegisterBuiltin.register(factory);
55 * allow to reset proxy as per security needs
57 public void setProxy() {
59 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
60 getBaseURL(), getHttpClient());
62 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
72 public static OrgAuthorityClient getInstance() {
78 * @see org.collectionspace.services.client.OrgAuthorityProxy#readList()
80 public ClientResponse<OrgauthoritiesCommonList> readList() {
81 return orgAuthorityProxy.readList();
87 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
89 public ClientResponse<MultipartInput> read(String csid) {
90 return orgAuthorityProxy.read(csid);
96 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
98 public ClientResponse<Response> create(MultipartOutput multipart) {
99 return orgAuthorityProxy.create(multipart);
104 * @param orgAuthority
106 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
108 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
109 return orgAuthorityProxy.update(csid, multipart);
116 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
118 public ClientResponse<Response> delete(String csid) {
119 return orgAuthorityProxy.delete(csid);
124 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemList()
126 public ClientResponse<OrganizationsCommonList> readItemList(String vcsid) {
127 return orgAuthorityProxy.readItemList(vcsid);
133 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
135 public ClientResponse<MultipartInput> readItem(String vcsid, String csid) {
136 return orgAuthorityProxy.readItem(vcsid, csid);
140 * @param orgAuthority
142 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
144 public ClientResponse<Response> createItem(String vcsid, MultipartOutput multipart) {
145 return orgAuthorityProxy.createItem(vcsid, multipart);
150 * @param orgAuthority
152 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
154 public ClientResponse<MultipartInput> updateItem(String vcsid, String csid, MultipartOutput multipart) {
155 return orgAuthorityProxy.updateItem(vcsid, csid, multipart);
162 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
164 public ClientResponse<Response> deleteItem(String vcsid, String csid) {
165 return orgAuthorityProxy.deleteItem(vcsid, csid);
168 public ClientResponse<Response> createContact(String parentcsid,
169 String itemcsid, MultipartOutput multipart) {
170 return orgAuthorityProxy.createContact(parentcsid, itemcsid, multipart);
173 public ClientResponse<MultipartInput> readContact(String parentcsid,
174 String itemcsid, String csid) {
175 return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid);
178 public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
180 return orgAuthorityProxy.readContactList(parentcsid, itemcsid);
183 public ClientResponse<MultipartInput> updateContact(String parentcsid,
184 String itemcsid, String csid, MultipartOutput multipart) {
185 return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart);
188 public ClientResponse<Response> deleteContact(String parentcsid,
189 String itemcsid, String csid) {
190 return orgAuthorityProxy.deleteContact(parentcsid,