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 org.jboss.resteasy.client.ClientResponse;
30 import javax.ws.rs.core.Response;
31 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
34 * The Class CollectionObjectClient.
35 * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
37 public class CollectionObjectClient extends AbstractPoxServiceClientImpl<CollectionObjectProxy> {
38 public static final String SERVICE_NAME = "collectionobjects";
39 public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
40 public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
41 public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
42 public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
45 public String getServiceName() {
50 public String getServicePathComponent() {
51 return SERVICE_PATH_COMPONENT;
55 public Class<CollectionObjectProxy> getProxyClass() {
56 return CollectionObjectProxy.class;
60 * Proxied service calls
66 * @see org.collectionspace.services.client.CollectionObjectProxy#readList()
67 * @return the client response< collectionobjects common list>
69 public ClientResponse<CollectionobjectsCommonList> readList() {
70 CollectionObjectProxy proxy = (CollectionObjectProxy)getProxy();
71 return proxy.readList();
78 * This is an intentionally empty method that is used for performance test
79 * to get a rough time estimate of the client to server response-request overhead.
81 * @see org.collectionspace.services.client.CollectionObjectProxy#roundtrip()
82 * @return the client response< response>
84 public ClientResponse<Response> roundtrip(int ms) {
85 getLogger().debug(">>>>Roundtrip start.");
86 ClientResponse<Response> result = getProxy().roundtrip(ms);
87 getLogger().debug("<<<<Roundtrip stop.");
94 * @param keywords the keywords
96 * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
97 * @return the client response< collectionobjects common list>
99 public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
100 return getProxy().keywordSearch(keywords);