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;
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.
51 public class CollectionObjectClient extends AbstractServiceClientImpl {
53 /** The collection object proxy. */
54 private CollectionObjectProxy collectionObjectProxy;
57 * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
59 public String getServicePathComponent() {
60 return "collectionobjects";
64 * Instantiates a new collection object client.
66 public CollectionObjectClient() {
67 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
68 RegisterBuiltin.register(factory);
75 public void setProxy() {
77 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
78 getBaseURL(), getHttpClient());
80 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
88 * @see org.collectionspace.services.client.CollectionObjectProxy#readList()
89 * @return the client response< collectionobjects common list>
91 public ClientResponse<CollectionobjectsCommonList> readList() {
92 return collectionObjectProxy.readList();
99 * This is an intentionally empty method that is used for performance test
100 * to get a rough time estimate of the client to server response-request overhead.
102 * @see org.collectionspace.services.client.CollectionObjectProxy#roundtrip()
103 * @return the client response< response>
105 public ClientResponse<Response> roundtrip() {
106 return collectionObjectProxy.roundtrip();
112 * @param keywords the keywords
114 * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
115 * @return the client response< collectionobjects common list>
117 public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
118 return collectionObjectProxy.keywordSearch(keywords);
125 * @param csid the csid
127 * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
128 * @return the client response< multipart input>
130 public ClientResponse<MultipartInput> read(String csid) {
131 return collectionObjectProxy.read(csid);
137 * @see org.collectionspace.services.client.CollectionObjectProxy#getAuthorityRefs(java.lang.String)
139 public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
140 return collectionObjectProxy.getAuthorityRefs(csid);
147 * @param multipart the multipart
149 * @see org.collectionspace.services.client.CollectionObjectProxy#create()
150 * @return the client response< response>
152 public ClientResponse<Response> create(MultipartOutput multipart) {
153 return collectionObjectProxy.create(multipart);
159 * @param csid the csid
160 * @param multipart the multipart
162 * @see org.collectionspace.services.client.CollectionObjectProxy#update()
163 * @return the client response< multipart input>
165 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
166 return collectionObjectProxy.update(csid, multipart);
172 * @param csid the csid
174 * @see org.collectionspace.services.client.CollectionObjectProxy#delete()
175 * @return the client response< response>
177 public ClientResponse<Response> delete(String csid) {
178 return collectionObjectProxy.delete(csid);