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 (C) 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.GET;
30 import javax.ws.rs.Produces;
31 import javax.ws.rs.QueryParam;
32 import javax.ws.rs.core.Context;
33 import javax.ws.rs.core.Response;
34 import javax.ws.rs.core.UriInfo;
36 import org.collectionspace.services.jaxb.AbstractCommonList;
37 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
38 import org.collectionspace.services.common.authorityref.AuthorityRefList;
39 //import org.collectionspace.services.common.context.ServiceContext;
40 //import org.collectionspace.services.common.query.IQueryManager;
41 import org.jboss.resteasy.client.ProxyFactory;
42 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
43 import org.jboss.resteasy.client.ClientResponse;
44 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
45 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
46 import org.jboss.resteasy.spi.ResteasyProviderFactory;
49 * The Class CollectionObjectClient.
50 * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
52 public class CollectionObjectClient extends AbstractServiceClientImpl {
54 /** The collection object proxy. */
55 private CollectionObjectProxy collectionObjectProxy;
58 * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
61 public String getServicePathComponent() {
62 return "collectionobjects";
66 * Instantiates a new collection object client.
68 public CollectionObjectClient() {
69 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
70 RegisterBuiltin.register(factory);
75 public CollectionSpaceProxy getProxy() {
76 return this.collectionObjectProxy;
82 public void setProxy() {
84 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
85 getBaseURL(), getHttpClient());
87 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
95 * @see org.collectionspace.services.client.CollectionObjectProxy#readList()
96 * @return the client response< collectionobjects common list>
98 public ClientResponse<CollectionobjectsCommonList> readList() {
99 return collectionObjectProxy.readList();
104 public ClientResponse<AbstractCommonList> readList(String pageSize,
106 return collectionObjectProxy.readList(pageSize, pageNumber);
113 * This is an intentionally empty method that is used for performance test
114 * to get a rough time estimate of the client to server response-request overhead.
116 * @see org.collectionspace.services.client.CollectionObjectProxy#roundtrip()
117 * @return the client response< response>
119 public ClientResponse<Response> roundtrip() {
120 return collectionObjectProxy.roundtrip();
126 * @param keywords the keywords
128 * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
129 * @return the client response< collectionobjects common list>
131 public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
132 return collectionObjectProxy.keywordSearch(keywords);
139 * @param csid the csid
141 * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
142 * @return the client response< multipart input>
144 public ClientResponse<MultipartInput> read(String csid) {
145 return collectionObjectProxy.read(csid);
151 * @see org.collectionspace.services.client.CollectionObjectProxy#getAuthorityRefs(java.lang.String)
153 public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
154 return collectionObjectProxy.getAuthorityRefs(csid);
161 * @param multipart the multipart
163 * @see org.collectionspace.services.client.CollectionObjectProxy#create()
164 * @return the client response< response>
166 public ClientResponse<Response> create(MultipartOutput multipart) {
167 return collectionObjectProxy.create(multipart);
173 * @param csid the csid
174 * @param multipart the multipart
176 * @see org.collectionspace.services.client.CollectionObjectProxy#update()
177 * @return the client response< multipart input>
179 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
180 return collectionObjectProxy.update(csid, multipart);
186 * @param csid the csid
188 * @see org.collectionspace.services.client.CollectionObjectProxy#delete()
189 * @return the client response< response>
191 public ClientResponse<Response> delete(String csid) {
192 return collectionObjectProxy.delete(csid);