]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
97ee6de56d2f520bacb887e623a09d847749b374
[tmp/jakarta-migration.git] /
1 /**     
2  * PermissionClient.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 import org.collectionspace.services.authorization.perms.Permission;
32 import org.collectionspace.services.authorization.perms.PermissionsList;
33
34 /**
35  * A PermissionClient.
36
37  * @version $Revision:$
38  */
39 public class PermissionClient extends AbstractServiceClientImpl<PermissionsList, Permission, Permission, PermissionProxy> {
40         public static final String SERVICE_NAME = "authorization/permissions";
41         public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
42         public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
43         public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";     
44     
45         public PermissionClient() {
46                 super();
47         }
48
49         public PermissionClient(String clientPropertiesFilename) {
50                 super(clientPropertiesFilename);
51         }
52
53         /* (non-Javadoc)
54      * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
55      */
56     @Override
57         public String getServicePathComponent() {
58         return SERVICE_PATH_COMPONENT;
59     }
60
61         @Override
62         public String getServiceName() {
63                 return SERVICE_NAME;
64         }
65
66         @Override
67         public Class<PermissionProxy> getProxyClass() {
68                 return PermissionProxy.class;
69         }
70         
71         /*
72          * CRUD+L Methods
73          */
74         
75     /**
76      * @return
77      * @see org.collectionspace.hello.client.PermissionProxy#readList()
78      */
79     public Response readList() {
80         return getProxy().readList();
81
82     }
83
84     public Response readSearchList(String resourceName) {
85         return getProxy().readSearchList(resourceName);
86
87     }
88
89     /**
90      * @param csid
91      * @return
92      * @see org.collectionspace.hello.client.PermissionProxy#getAccount(java.lang.String)
93      */
94     public Response read(String csid) {
95         return getProxy().read(csid);
96     }
97
98     /**
99      * @param permission
100      * @return
101      * @see org.collectionspace.hello.client.PermissionProxy#create(org.collectionspace.services.permission.Permission)
102      */
103     public Response create(Permission permission) {
104         return getProxy().create(permission);
105     }
106
107     /**
108      * @param csid
109      * @param permission
110      * @return
111      * @see org.collectionspace.hello.client.PermissionProxy#updateAccount(java.lang.Long, org.collectionspace.services.permission.Permission)
112      */
113     public Response update(String csid, Permission permission) {
114         return getProxy().update(csid, permission);
115     }
116 }