]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
3e8ed0a7e8b7de4436607dea6157b31ab882a9cf
[tmp/jakarta-migration.git] /
1 package org.collectionspace.services.client;
2
3 import javax.ws.rs.PathParam;
4 import javax.ws.rs.core.Response;
5
6 import org.collectionspace.services.common.authorityref.AuthorityRefList;
7 import org.collectionspace.services.contact.ContactsCommonList;
8 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
9 import org.collectionspace.services.organization.OrganizationsCommonList;
10
11 import org.jboss.resteasy.client.ClientResponse;
12 import org.jboss.resteasy.client.ProxyFactory;
13 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
14 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
15 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
16 import org.jboss.resteasy.spi.ResteasyProviderFactory;
17
18 /**
19  * A OrgAuthorityClient.
20
21  * @version $Revision:$
22  */
23 public class OrgAuthorityClient extends AbstractServiceClientImpl {
24
25     /* (non-Javadoc)
26      * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
27      */
28     @Override
29     public String getServicePathComponent() {
30         return "orgauthorities";
31     }
32
33     public String getItemCommonPartName() {
34         return getCommonPartName("organizations");
35     }
36     /**
37      *
38      */
39     private static final OrgAuthorityClient instance = new OrgAuthorityClient();
40     /**
41      *
42      */
43     private OrgAuthorityProxy orgAuthorityProxy;
44
45     /**
46      *
47      * Default constructor for OrgAuthorityClient class.
48      *
49      */
50     public OrgAuthorityClient() {
51         ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
52         RegisterBuiltin.register(factory);
53         setProxy();
54     }
55
56     /**
57      * allow to reset proxy as per security needs
58      */
59     public void setProxy() {
60         if (useAuth()) {
61             orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
62                     getBaseURL(), getHttpClient());
63         } else {
64             orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
65                     getBaseURL());
66         }
67     }
68
69     /**
70      * FIXME Comment this
71      *
72      * @return
73      */
74     public static OrgAuthorityClient getInstance() {
75         return instance;
76     }
77
78     /**
79      * @return
80      * @see org.collectionspace.services.client.OrgAuthorityProxy#readList()
81      */
82     public ClientResponse<OrgauthoritiesCommonList> readList() {
83         return orgAuthorityProxy.readList();
84     }
85
86     /**
87      * @param csid
88      * @return
89      * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
90      */
91     public ClientResponse<MultipartInput> read(String csid) {
92         return orgAuthorityProxy.read(csid);
93     }
94
95     /**
96      * @param name
97      * @return
98      * @see org.collectionspace.services.client.OrgAuthorityProxy#readByName(java.lang.String)
99      */
100     public ClientResponse<MultipartInput> readByName(String name) {
101         return orgAuthorityProxy.readByName(name);
102     }
103
104     /**
105      * @param orgAuthority
106      * @return
107      * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
108      */
109     public ClientResponse<Response> create(MultipartOutput multipart) {
110         return orgAuthorityProxy.create(multipart);
111     }
112
113     /**
114      * @param csid
115      * @param orgAuthority
116      * @return
117      * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
118      */
119     public ClientResponse<MultipartInput> update(String csid, MultipartOutput multipart) {
120         return orgAuthorityProxy.update(csid, multipart);
121
122     }
123
124     /**
125      * @param csid
126      * @return
127      * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
128      */
129     public ClientResponse<Response> delete(String csid) {
130         return orgAuthorityProxy.delete(csid);
131     }
132
133     /**
134      * @return
135      * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemList()
136      */
137     public ClientResponse<OrganizationsCommonList> readItemList(String vcsid) {
138         return orgAuthorityProxy.readItemList(vcsid);
139     }
140
141     /**
142      * @return
143      * @see org.collectionspace.services.client.OrgAuthorityProxy#readItemListForNamedAuthority()
144      */
145     public ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(String specifier) {
146         return orgAuthorityProxy.readItemListForNamedAuthority(specifier);
147     }
148
149     public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
150         return orgAuthorityProxy.getItemAuthorityRefs(parentcsid, csid);
151     }
152
153     /**
154      * @param csid
155      * @return
156      * @see org.collectionspace.services.client.OrgAuthorityProxy#read(java.lang.String)
157      */
158     public ClientResponse<MultipartInput> readItem(String vcsid, String csid) {
159         return orgAuthorityProxy.readItem(vcsid, csid);
160     }
161
162     /**
163      * @param orgAuthority
164      * @return
165      * @see org.collectionspace.services.client.OrgAuthorityProxy#createOrgAuthority(org.collectionspace.hello.OrgAuthority)
166      */
167     public ClientResponse<Response> createItem(String vcsid, MultipartOutput multipart) {
168         return orgAuthorityProxy.createItem(vcsid, multipart);
169     }
170
171     /**
172      * @param csid
173      * @param orgAuthority
174      * @return
175      * @see org.collectionspace.services.client.OrgAuthorityProxy#updateOrgAuthority(java.lang.Long, org.collectionspace.hello.OrgAuthority)
176      */
177     public ClientResponse<MultipartInput> updateItem(String vcsid, String csid, MultipartOutput multipart) {
178         return orgAuthorityProxy.updateItem(vcsid, csid, multipart);
179
180     }
181
182     /**
183      * @param csid
184      * @return
185      * @see org.collectionspace.services.client.OrgAuthorityProxy#deleteOrgAuthority(java.lang.Long)
186      */
187     public ClientResponse<Response> deleteItem(String vcsid, String csid) {
188         return orgAuthorityProxy.deleteItem(vcsid, csid);
189     }
190
191     public ClientResponse<Response> createContact(String parentcsid,
192             String itemcsid, MultipartOutput multipart) {
193         return orgAuthorityProxy.createContact(parentcsid, itemcsid, multipart);
194     }
195
196     public ClientResponse<MultipartInput> readContact(String parentcsid,
197             String itemcsid, String csid) {
198         return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid);
199     }
200
201     public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
202             String itemcsid) {
203         return orgAuthorityProxy.readContactList(parentcsid, itemcsid);
204     }
205
206     public ClientResponse<MultipartInput> updateContact(String parentcsid,
207             String itemcsid, String csid, MultipartOutput multipart) {
208         return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, multipart);
209     }
210
211     public ClientResponse<Response> deleteContact(String parentcsid,
212         String itemcsid, String csid) {
213         return orgAuthorityProxy.deleteContact(parentcsid,
214             itemcsid, csid);
215     }
216
217 }