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