]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
0f3ffdc266379279de37b3c37e35ffcdb395732a
[tmp/jakarta-migration.git] /
1 /**     
2  * CollectionObjectClient.java
3  *
4  * {Purpose of This Class}
5  *
6  * {Other Notes Relating to This Class (Optional)}
7  *
8  * $LastChangedBy: $
9  * $LastChangedRevision: $
10  * $LastChangedDate: $
11  *
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:
15  *
16  * http://www.collectionspace.org
17  * http://wiki.collectionspace.org
18  *
19  * Copyright (C) 2009 {Contributing Institution}
20  *
21  * Licensed under the Educational Community License (ECL), Version 2.0.
22  * You may not use this file except in compliance with this License.
23  *
24  * You may obtain a copy of the ECL 2.0 License at
25  * https://source.collectionspace.org/collection-space/LICENSE.txt
26  */
27 package org.collectionspace.services.client;
28
29 import org.jboss.resteasy.client.ClientResponse;
30 import javax.ws.rs.core.Response;
31 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
32
33 /**
34  * The Class CollectionObjectClient.
35  * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
36  */
37 public class CollectionObjectClient extends AbstractPoxServiceClientImpl<CollectionobjectsCommonList, 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;
43         public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
44     
45         @Override
46         public String getServiceName() {
47                 return SERVICE_NAME;
48         }
49     
50         @Override
51     public String getServicePathComponent() {
52                 return SERVICE_PATH_COMPONENT;
53         }
54
55         @Override
56         public Class<CollectionObjectProxy> getProxyClass() {
57                 return CollectionObjectProxy.class;
58         }
59
60         /*
61          * Proxied service calls
62          */
63         
64         /**
65      * Read list.
66      * 
67      * @see org.collectionspace.services.client.CollectionObjectProxy#readList()
68      * @return the client response< collectionobjects common list>
69      */
70     public ClientResponse<CollectionobjectsCommonList> readList() {
71         CollectionObjectProxy proxy = (CollectionObjectProxy)getProxy();
72         return proxy.readList();
73
74     }
75
76     /**
77      * Roundtrip.
78      * 
79      * This is an intentionally empty method that is used for performance test 
80      * to get a rough time estimate of the client to server response-request overhead.
81      * 
82      * @see org.collectionspace.services.client.CollectionObjectProxy#roundtrip()
83      * @return the client response< response>
84      */
85     public ClientResponse<Response> roundtrip(int ms) {
86         getLogger().debug(">>>>Roundtrip start.");
87         ClientResponse<Response> result = getProxy().roundtrip(ms);
88         getLogger().debug("<<<<Roundtrip stop.");
89         return result;
90     }
91     
92     /**
93      * Keyword search.
94      * 
95      * @param keywords the keywords
96      * 
97      * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
98      * @return the client response< collectionobjects common list>
99      */
100     public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
101         return getProxy().keywordSearch(keywords);
102     }
103 }