1 package org.collectionspace.services.client;
3 import javax.ws.rs.PathParam;
4 import javax.ws.rs.core.Response;
6 import org.collectionspace.services.common.authorityref.AuthorityRefList;
7 import org.collectionspace.services.contact.ContactsCommonList;
8 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
9 import org.collectionspace.services.organization.OrganizationsCommonList;
11 import org.jboss.resteasy.client.ClientResponse;
12 import org.jboss.resteasy.client.ProxyFactory;
13 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
14 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
15 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
16 import org.jboss.resteasy.spi.ResteasyProviderFactory;
19 * A OrgAuthorityClient.
21 * @version $Revision:$
23 public class OrgAuthorityClient extends AbstractServiceClientImpl {
26 * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
29 public String getServicePathComponent() {
30 return "orgauthorities";
33 public String getItemCommonPartName() {
34 return getCommonPartName("organizations");
39 private static final OrgAuthorityClient instance = new OrgAuthorityClient();
43 private OrgAuthorityProxy orgAuthorityProxy;
47 * Default constructor for OrgAuthorityClient class.
50 public OrgAuthorityClient() {
51 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
52 RegisterBuiltin.register(factory);
57 public CollectionSpaceProxy getProxy() {
58 return this.orgAuthorityProxy;
62 * allow to reset proxy as per security needs
64 public void setProxy() {
66 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
67 getBaseURL(), getHttpClient());
69 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
79 public static OrgAuthorityClient getInstance() {
85 * @see org.collectionspace.services.client.OrgAuthorityProxy#readList()
87 public ClientResponse<OrgauthoritiesCommonList> readList() {
88 return orgAuthorityProxy.readList();
94 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
96 public ClientResponse<MultipartInput> read(String csid) {
97 return orgAuthorityProxy.read(csid);
103 * @see org.collectionspace.services.client.OrgAuthorityProxy#readByName(java.lang.String)
105 public ClientResponse<MultipartInput> readByName(String name) {
106 return orgAuthorityProxy.readByName(name);
110 * @param orgAuthority
112 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
114 public ClientResponse<Response> create(MultipartOutput multipart) {
115 return orgAuthorityProxy.create(multipart);
120 * @param orgAuthority
122 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
124 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
125 return orgAuthorityProxy.update(csid, multipart);
132 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
134 public ClientResponse<Response> delete(String csid) {
135 return orgAuthorityProxy.delete(csid);
140 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemList()
142 public ClientResponse<OrganizationsCommonList> readItemList(String vcsid) {
143 return orgAuthorityProxy.readItemList(vcsid);
148 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemListForNamedAuthority()
150 public ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(String specifier) {
151 return orgAuthorityProxy.readItemListForNamedAuthority(specifier);
154 public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
155 return orgAuthorityProxy.getItemAuthorityRefs(parentcsid, csid);
161 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
163 public ClientResponse<MultipartInput> readItem(String vcsid, String csid) {
164 return orgAuthorityProxy.readItem(vcsid, csid);
168 * @param orgAuthority
170 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
172 public ClientResponse<Response> createItem(String vcsid, MultipartOutput multipart) {
173 return orgAuthorityProxy.createItem(vcsid, multipart);
178 * @param orgAuthority
180 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
182 public ClientResponse<MultipartInput> updateItem(String vcsid, String csid, MultipartOutput multipart) {
183 return orgAuthorityProxy.updateItem(vcsid, csid, multipart);
190 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
192 public ClientResponse<Response> deleteItem(String vcsid, String csid) {
193 return orgAuthorityProxy.deleteItem(vcsid, csid);
196 public ClientResponse<Response> createContact(String parentcsid,
197 String itemcsid, MultipartOutput multipart) {
198 return orgAuthorityProxy.createContact(parentcsid, itemcsid, multipart);
201 public ClientResponse<MultipartInput> readContact(String parentcsid,
202 String itemcsid, String csid) {
203 return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid);
206 public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
208 return orgAuthorityProxy.readContactList(parentcsid, itemcsid);
211 public ClientResponse<MultipartInput> updateContact(String parentcsid,
212 String itemcsid, String csid, MultipartOutput multipart) {
213 return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart);
216 public ClientResponse<Response> deleteContact(String parentcsid,
217 String itemcsid, String csid) {
218 return orgAuthorityProxy.deleteContact(parentcsid,