2 * CollectionObjectClient.java
4 * {Purpose of This Class}
6 * {Other Notes Relating to This Class (Optional)}
9 * $LastChangedRevision: $
12 * This document is a part of the source code and related artifacts
13 * for CollectionSpace, an open source collections management system
14 * for museums and related institutions:
16 * http://www.collectionspace.org
17 * http://wiki.collectionspace.org
19 * Copyright © 2009 {Contributing Institution}
21 * Licensed under the Educational Community License (ECL), Version 2.0.
22 * You may not use this file except in compliance with this License.
24 * You may obtain a copy of the ECL 2.0 License at
25 * https://source.collectionspace.org/collection-space/LICENSE.txt
27 package org.collectionspace.services.client;
29 import javax.ws.rs.core.Response;
32 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
33 import org.collectionspace.services.common.context.ServiceContext;
34 import org.jboss.resteasy.client.ProxyFactory;
35 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
36 import org.jboss.resteasy.client.ClientResponse;
37 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
38 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
39 import org.jboss.resteasy.spi.ResteasyProviderFactory;
42 * A CollectionObjectClient.
44 * @version $Revision:$
46 public class CollectionObjectClient extends BaseServiceClient {
51 private CollectionObjectProxy collectionObjectProxy;
54 * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
56 public String getServicePathComponent() {
57 return "collectionobjects";
62 * Default constructor for CollectionObjectClient class.
65 public CollectionObjectClient() {
66 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
67 RegisterBuiltin.register(factory);
72 * allow to reset proxy as per security needs
74 public void setProxy() {
76 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
77 getBaseURL(), getHttpClient());
79 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
86 * @see org.collectionspace.hello.client.CollectionObjectProxy#readList()
88 public ClientResponse<CollectionobjectsCommonList> readList() {
89 return collectionObjectProxy.readList();
96 * @see org.collectionspace.hello.client.CollectionObjectProxy#getCollectionObject(java.lang.String)
98 public ClientResponse<MultipartInput> read(String csid) {
99 return collectionObjectProxy.read(csid);
103 * @param collectionobject
105 * @see org.collectionspace.hello.client.CollectionObjectProxy#create(org.collectionspace.services.collectionobject.CollectionobjectsCommon)
107 public ClientResponse<Response> create(MultipartOutput multipart) {
108 return collectionObjectProxy.create(multipart);
113 * @param collectionobject
115 * @see org.collectionspace.hello.client.CollectionObjectProxy#updateCollectionObject(java.lang.Long, org.collectionspace.services.collectionobject.CollectionobjectsCommon)
117 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
118 return collectionObjectProxy.update(csid, multipart);
124 * @see org.collectionspace.hello.client.CollectionObjectProxy#deleteCollectionObject(java.lang.Long)
126 public ClientResponse<Response> delete(String csid) {
127 return collectionObjectProxy.delete(csid);