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.context.ServiceContext;
39 import org.collectionspace.services.common.query.IQueryManager;
40 import org.jboss.resteasy.client.ProxyFactory;
41 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
42 import org.jboss.resteasy.client.ClientResponse;
43 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
44 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
45 import org.jboss.resteasy.spi.ResteasyProviderFactory;
48 * The Class CollectionObjectClient.
50 public class CollectionObjectClient extends AbstractServiceClientImpl {
52 /** The collection object proxy. */
53 private CollectionObjectProxy collectionObjectProxy;
56 * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
58 public String getServicePathComponent() {
59 return "collectionobjects";
63 * Instantiates a new collection object client.
65 public CollectionObjectClient() {
66 ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
67 RegisterBuiltin.register(factory);
74 public void setProxy() {
76 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
77 getBaseURL(), getHttpClient());
79 collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
87 * @return the client response< collectionobjects common list>
89 public ClientResponse<CollectionobjectsCommonList> readList() {
90 return collectionObjectProxy.readList();
97 * This is an intentionally empty method that is used for performance test
98 * to get a rough time estimate of the client to server response-request overhead.
100 * @return the client response< response>
102 public ClientResponse<Response> roundtrip() {
103 return collectionObjectProxy.roundtrip();
109 * @param keywords the keywords
111 * @return the client response< collectionobjects common list>
113 public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
114 return collectionObjectProxy.keywordSearch(keywords);
121 * @param csid the csid
123 * @return the client response< multipart input>
125 public ClientResponse<MultipartInput> read(String csid) {
126 return collectionObjectProxy.read(csid);
132 * @param multipart the multipart
134 * @return the client response< response>
136 public ClientResponse<Response> create(MultipartOutput multipart) {
137 return collectionObjectProxy.create(multipart);
143 * @param csid the csid
144 * @param multipart the multipart
146 * @return the client response< multipart input>
148 public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
149 return collectionObjectProxy.update(csid, multipart);
155 * @param csid the csid
157 * @return the client response< response>
159 public ClientResponse<Response> delete(String csid) {
160 return collectionObjectProxy.delete(csid);