]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
ad6f536a4d9f4b1131915a2351d85f9856a9d7cd
[tmp/jakarta-migration.git] /
1 /**     
2  * PermissionRoleClient.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 javax.ws.rs.core.Response;
30
31
32 import org.collectionspace.services.authorization.PermissionRole;
33 import org.jboss.resteasy.client.ProxyFactory;
34 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
35 import org.jboss.resteasy.client.ClientResponse;
36 import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
37 import org.jboss.resteasy.spi.ResteasyProviderFactory;
38
39 // TODO: Auto-generated Javadoc
40 /**
41  * A RolePermissionClient.
42
43  * @version $Revision:$
44  */
45 public class RolePermissionClient extends AbstractServiceClientImpl<PermissionRole, RolePermissionProxy> {
46     @Override
47     public String getServiceName() { 
48         throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498
49     }
50     
51     /* (non-Javadoc)
52      * @see 
53      */
54     @Override
55         public String getServicePathComponent() {
56         return "authorization/roles";
57     }
58     
59         @Override
60         public Class<RolePermissionProxy> getProxyClass() {
61                 return RolePermissionProxy.class;
62         }
63
64         /*
65          * CRUD+L Methods
66          */
67         
68     /**
69      * Read.
70      *
71      * @param csid the csid
72      * @return the client response
73      * @see
74      */
75     public ClientResponse<PermissionRole> read(String csid) {
76         return getProxy().read(csid);
77     }
78
79     /**
80      * Read.
81      *
82      * @param csid the csid
83      * @param prcsid the prcsid
84      * @return the client response
85      */
86     public ClientResponse<PermissionRole> read(String csid, String prcsid) {
87         return getProxy().read(csid, prcsid);
88     }
89
90     /**
91      * Creates the relationships.
92      *
93      * @param csid the csid
94      * @param permRole the perm role
95      * @return the client response
96      * @see
97      */
98     public ClientResponse<Response> create(String csid, PermissionRole permRole) {
99         return getProxy().create(csid, permRole);
100     }
101
102     /**
103      * delete given relationships between given role and permission(s).
104      *
105      * @param csid the csid
106      * @param permRole the perm role
107      * @return the client response
108      */
109     public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
110         return getProxy().delete(csid, "delete", permRole);
111     }
112 }