1 package org.collectionspace.services.client;
3 import javax.ws.rs.PathParam;
4 import javax.ws.rs.core.Response;
6 import org.collectionspace.services.contact.ContactsCommonList;
7 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
8 import org.collectionspace.services.organization.OrganizationsCommonList;
10 import org.jboss.resteasy.client.ClientResponse;
11 import org.jboss.resteasy.client.ProxyFactory;
12 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
13 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
14 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
15 import org.jboss.resteasy.spi.ResteasyProviderFactory;
18 * A OrgAuthorityClient.
20 * @version $Revision:$
22 public class OrgAuthorityClient extends AbstractServiceClientImpl {
25 * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
28 public String getServicePathComponent() {
29 return "orgauthorities";
32 public String getItemCommonPartName() {
33 return getCommonPartName("organizations");
38 private static final OrgAuthorityClient instance = new OrgAuthorityClient();
42 private OrgAuthorityProxy orgAuthorityProxy;
46 * Default constructor for OrgAuthorityClient class.
49 public OrgAuthorityClient() {
50 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
51 RegisterBuiltin.register(factory);
56 * allow to reset proxy as per security needs
58 public void setProxy() {
60 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
61 getBaseURL(), getHttpClient());
63 orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
73 public static OrgAuthorityClient getInstance() {
79 * @see org.collectionspace.services.client.OrgAuthorityProxy#readList()
81 public ClientResponse<OrgauthoritiesCommonList> readList() {
82 return orgAuthorityProxy.readList();
88 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
90 public ClientResponse<MultipartInput> read(String csid) {
91 return orgAuthorityProxy.read(csid);
97 * @see org.collectionspace.services.client.OrgAuthorityProxy#readByName(java.lang.String)
99 public ClientResponse<MultipartInput> readByName(String name) {
100 return orgAuthorityProxy.readByName(name);
104 * @param orgAuthority
106 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
108 public ClientResponse<Response> create(MultipartOutput multipart) {
109 return orgAuthorityProxy.create(multipart);
114 * @param orgAuthority
116 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
118 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
119 return orgAuthorityProxy.update(csid, multipart);
126 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
128 public ClientResponse<Response> delete(String csid) {
129 return orgAuthorityProxy.delete(csid);
134 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemList()
136 public ClientResponse<OrganizationsCommonList> readItemList(String vcsid) {
137 return orgAuthorityProxy.readItemList(vcsid);
142 * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemListForNamedAuthority()
144 public ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(String specifier) {
145 return orgAuthorityProxy.readItemListForNamedAuthority(specifier);
151 * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
153 public ClientResponse<MultipartInput> readItem(String vcsid, String csid) {
154 return orgAuthorityProxy.readItem(vcsid, csid);
158 * @param orgAuthority
160 * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
162 public ClientResponse<Response> createItem(String vcsid, MultipartOutput multipart) {
163 return orgAuthorityProxy.createItem(vcsid, multipart);
168 * @param orgAuthority
170 * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
172 public ClientResponse<MultipartInput> updateItem(String vcsid, String csid, MultipartOutput multipart) {
173 return orgAuthorityProxy.updateItem(vcsid, csid, multipart);
180 * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
182 public ClientResponse<Response> deleteItem(String vcsid, String csid) {
183 return orgAuthorityProxy.deleteItem(vcsid, csid);
186 public ClientResponse<Response> createContact(String parentcsid,
187 String itemcsid, MultipartOutput multipart) {
188 return orgAuthorityProxy.createContact(parentcsid, itemcsid, multipart);
191 public ClientResponse<MultipartInput> readContact(String parentcsid,
192 String itemcsid, String csid) {
193 return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid);
196 public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
198 return orgAuthorityProxy.readContactList(parentcsid, itemcsid);
201 public ClientResponse<MultipartInput> updateContact(String parentcsid,
202 String itemcsid, String csid, MultipartOutput multipart) {
203 return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart);
206 public ClientResponse<Response> deleteContact(String parentcsid,
207 String itemcsid, String csid) {
208 return orgAuthorityProxy.deleteContact(parentcsid,