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