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;
31 import org.apache.http.HttpStatus;
32 import org.collectionspace.services.authorization.PermissionRole;
33 import org.collectionspace.services.description.ServiceDescription;
35 // TODO: Auto-generated Javadoc
37 * A RolePermissionClient.
39 * @version $Revision:$
41 public class RolePermissionClient extends AbstractServiceClientImpl<PermissionRole, PermissionRole, PermissionRole, RolePermissionProxy> {
43 public RolePermissionClient() {
47 public RolePermissionClient(String clientPropertiesFilename) {
48 super(clientPropertiesFilename);
52 public String getServiceName() {
53 throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498
60 public String getServicePathComponent() {
61 return "authorization/roles";
65 public Class<RolePermissionProxy> getProxyClass() {
66 return RolePermissionProxy.class;
76 * @param csid the csid
77 * @return the client response
80 public Response read(String csid) {
81 return getProxy().read(csid);
87 * @param csid the csid
88 * @param prcsid the prcsid
89 * @return the client response
91 public Response read(String csid, String prcsid) {
92 return getProxy().read(csid, prcsid);
96 * Creates the relationships.
98 * @param csid the csid
99 * @param permRole the perm role
100 * @return the client response
103 public Response create(String csid, PermissionRole permRole) {
104 return getProxy().create(csid, permRole);
108 * delete given relationships between given role and permission(s).
110 * @param csid the csid
111 * @param permRole the perm role
112 * @return the client response
114 public Response delete(String csid, PermissionRole permRole) {
115 return getProxy().delete(csid, "delete", permRole);
119 public Response create(PermissionRole payload) {
120 throw new UnsupportedOperationException(); //method not supported nor needed
124 public Response update(String csid,
125 PermissionRole payload) {
126 throw new UnsupportedOperationException(); //method not supported nor needed
130 public Response readList() {
131 throw new UnsupportedOperationException(); //method not supported nor needed
135 public ServiceDescription getServiceDescription() {
136 ServiceDescription result = null;
138 Response res = getProxy().getServiceDescription();
139 if (res.getStatus() == HttpStatus.SC_OK) {
140 result = (ServiceDescription) res.readEntity(ServiceDescription.class);