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 * allow to reset proxy as per security needs
59 public void setProxy() {
61 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
62 getBaseURL(), getHttpClient());
64 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
74 public static OrgAuthorityClient getInstance() {
80 * @see org.collectionspace.services.client.OrgAuthorityProxy#readList()
82 public ClientResponse<OrgauthoritiesCommonList> readList() {
83 return orgAuthorityProxy.readList();
89 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
91 public ClientResponse<MultipartInput> read(String csid) {
92 return orgAuthorityProxy.read(csid);
98 * @see org.collectionspace.services.client.OrgAuthorityProxy#readByName(java.lang.String)
100 public ClientResponse<MultipartInput> readByName(String name) {
101 return orgAuthorityProxy.readByName(name);
105 * @param orgAuthority
107 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
109 public ClientResponse<Response> create(MultipartOutput multipart) {
110 return orgAuthorityProxy.create(multipart);
115 * @param orgAuthority
117 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
119 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
120 return orgAuthorityProxy.update(csid, multipart);
127 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
129 public ClientResponse<Response> delete(String csid) {
130 return orgAuthorityProxy.delete(csid);
135 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemList()
137 public ClientResponse<OrganizationsCommonList> readItemList(String vcsid) {
138 return orgAuthorityProxy.readItemList(vcsid);
143 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemListForNamedAuthority()
145 public ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(String specifier) {
146 return orgAuthorityProxy.readItemListForNamedAuthority(specifier);
149 public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
150 return orgAuthorityProxy.getItemAuthorityRefs(parentcsid, csid);
156 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
158 public ClientResponse<MultipartInput> readItem(String vcsid, String csid) {
159 return orgAuthorityProxy.readItem(vcsid, csid);
163 * @param orgAuthority
165 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
167 public ClientResponse<Response> createItem(String vcsid, MultipartOutput multipart) {
168 return orgAuthorityProxy.createItem(vcsid, multipart);
173 * @param orgAuthority
175 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
177 public ClientResponse<MultipartInput> updateItem(String vcsid, String csid, MultipartOutput multipart) {
178 return orgAuthorityProxy.updateItem(vcsid, csid, multipart);
185 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
187 public ClientResponse<Response> deleteItem(String vcsid, String csid) {
188 return orgAuthorityProxy.deleteItem(vcsid, csid);
191 public ClientResponse<Response> createContact(String parentcsid,
192 String itemcsid, MultipartOutput multipart) {
193 return orgAuthorityProxy.createContact(parentcsid, itemcsid, multipart);
196 public ClientResponse<MultipartInput> readContact(String parentcsid,
197 String itemcsid, String csid) {
198 return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid);
201 public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
203 return orgAuthorityProxy.readContactList(parentcsid, itemcsid);
206 public ClientResponse<MultipartInput> updateContact(String parentcsid,
207 String itemcsid, String csid, MultipartOutput multipart) {
208 return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart);
211 public ClientResponse<Response> deleteContact(String parentcsid,
212 String itemcsid, String csid) {
213 return orgAuthorityProxy.deleteContact(parentcsid,