2 * PermissionRoleClient.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 javax.ws.rs.core.Response;
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;
39 // TODO: Auto-generated Javadoc
41 * A RolePermissionClient.
43 * @version $Revision:$
45 public class RolePermissionClient extends AbstractServiceClientImpl<RolePermissionProxy> {
47 public String getServiceName() {
48 throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498
54 public String getServicePathComponent() {
55 return "authorization/roles";
59 public Class<RolePermissionProxy> getProxyClass() {
60 return RolePermissionProxy.class;
70 * @param csid the csid
71 * @return the client response
74 public ClientResponse<PermissionRole> read(String csid) {
75 return getProxy().read(csid);
81 * @param csid the csid
82 * @param prcsid the prcsid
83 * @return the client response
85 public ClientResponse<PermissionRole> read(String csid, String prcsid) {
86 return getProxy().read(csid, prcsid);
90 * Creates the relationships.
92 * @param csid the csid
93 * @param permRole the perm role
94 * @return the client response
97 public ClientResponse<Response> create(String csid, PermissionRole permRole) {
98 return getProxy().create(csid, permRole);
102 * delete given relationships between given role and permission(s).
104 * @param csid the csid
105 * @param permRole the perm role
106 * @return the client response
108 public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
109 return getProxy().delete(csid, "delete", permRole);