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;
36 * A PermissionRoleClient.
38 * @version $Revision:$
40 public class PermissionRoleClient extends AbstractServiceClientImpl<PermissionRole, PermissionRole, PermissionRole, PermissionRoleProxy> {
42 public PermissionRoleClient() {
46 public PermissionRoleClient(String clientPropertiesFilename) {
47 super(clientPropertiesFilename);
51 public String getServiceName() {
52 throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3497
59 public String getServicePathComponent() {
60 return "authorization/permissions";
64 public Class<PermissionRoleProxy> getProxyClass() {
65 return PermissionRoleProxy.class;
75 * @param csid the csid
76 * @param prcsid relationship does not have an id, junk is fine
77 * @return the client response
80 public Response read(String csid, String prcsid) {
81 return getProxy().read(csid, prcsid);
87 * @param csid the csid
88 * @param prcsid relationship does not have an id, junk is fine
89 * @return the client response
93 public Response read(String csid) {
94 return getProxy().read(csid);
100 * @param csid the csid
101 * @param permRole the perm role
102 * @return the client response
105 public Response create(String csid, PermissionRole permRole) {
106 return getProxy().create(csid, permRole);
110 * Delete with payload
112 * @param csid the csid
113 * @param permRole the perm role
114 * @return the client response
116 public Response delete(String csid, PermissionRole permRole) {
117 return getProxy().delete(csid, "delete", permRole);
121 public Response create(PermissionRole payload) {
122 throw new UnsupportedOperationException(); //method not supported nor needed
126 public Response update(String csid,
127 PermissionRole payload) {
128 throw new UnsupportedOperationException(); //method not supported nor needed
132 public Response readList() {
133 throw new UnsupportedOperationException(); //method not supported nor needed
137 public ServiceDescription getServiceDescription() {
138 ServiceDescription result = null;
140 Response res = getProxy().getServiceDescription();
141 if (res.getStatus() == HttpStatus.SC_OK) {
142 result = (ServiceDescription) res.readEntity(ServiceDescription.class);