1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="PermissionPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface PermissionPersistence {
32      public com.liferay.portal.model.Permission create(long permissionId);
33  
34      public com.liferay.portal.model.Permission remove(long permissionId)
35          throws com.liferay.portal.SystemException, 
36              com.liferay.portal.NoSuchPermissionException;
37  
38      public com.liferay.portal.model.Permission remove(
39          com.liferay.portal.model.Permission permission)
40          throws com.liferay.portal.SystemException;
41  
42      public com.liferay.portal.model.Permission update(
43          com.liferay.portal.model.Permission permission)
44          throws com.liferay.portal.SystemException;
45  
46      public com.liferay.portal.model.Permission update(
47          com.liferay.portal.model.Permission permission, boolean merge)
48          throws com.liferay.portal.SystemException;
49  
50      public com.liferay.portal.model.Permission findByPrimaryKey(
51          long permissionId)
52          throws com.liferay.portal.SystemException, 
53              com.liferay.portal.NoSuchPermissionException;
54  
55      public com.liferay.portal.model.Permission fetchByPrimaryKey(
56          long permissionId) throws com.liferay.portal.SystemException;
57  
58      public java.util.List findByResourceId(long resourceId)
59          throws com.liferay.portal.SystemException;
60  
61      public java.util.List findByResourceId(long resourceId, int begin, int end)
62          throws com.liferay.portal.SystemException;
63  
64      public java.util.List findByResourceId(long resourceId, int begin, int end,
65          com.liferay.portal.kernel.util.OrderByComparator obc)
66          throws com.liferay.portal.SystemException;
67  
68      public com.liferay.portal.model.Permission findByResourceId_First(
69          long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
70          throws com.liferay.portal.SystemException, 
71              com.liferay.portal.NoSuchPermissionException;
72  
73      public com.liferay.portal.model.Permission findByResourceId_Last(
74          long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
75          throws com.liferay.portal.SystemException, 
76              com.liferay.portal.NoSuchPermissionException;
77  
78      public com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
79          long permissionId, long resourceId,
80          com.liferay.portal.kernel.util.OrderByComparator obc)
81          throws com.liferay.portal.SystemException, 
82              com.liferay.portal.NoSuchPermissionException;
83  
84      public com.liferay.portal.model.Permission findByA_R(
85          java.lang.String actionId, long resourceId)
86          throws com.liferay.portal.SystemException, 
87              com.liferay.portal.NoSuchPermissionException;
88  
89      public com.liferay.portal.model.Permission fetchByA_R(
90          java.lang.String actionId, long resourceId)
91          throws com.liferay.portal.SystemException;
92  
93      public java.util.List findWithDynamicQuery(
94          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
95          throws com.liferay.portal.SystemException;
96  
97      public java.util.List findWithDynamicQuery(
98          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
99          int begin, int end) throws com.liferay.portal.SystemException;
100 
101     public java.util.List findAll() throws com.liferay.portal.SystemException;
102 
103     public java.util.List findAll(int begin, int end)
104         throws com.liferay.portal.SystemException;
105 
106     public java.util.List findAll(int begin, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException;
109 
110     public void removeByResourceId(long resourceId)
111         throws com.liferay.portal.SystemException;
112 
113     public void removeByA_R(java.lang.String actionId, long resourceId)
114         throws com.liferay.portal.SystemException, 
115             com.liferay.portal.NoSuchPermissionException;
116 
117     public void removeAll() throws com.liferay.portal.SystemException;
118 
119     public int countByResourceId(long resourceId)
120         throws com.liferay.portal.SystemException;
121 
122     public int countByA_R(java.lang.String actionId, long resourceId)
123         throws com.liferay.portal.SystemException;
124 
125     public int countAll() throws com.liferay.portal.SystemException;
126 
127     public java.util.List getGroups(long pk)
128         throws com.liferay.portal.SystemException, 
129             com.liferay.portal.NoSuchPermissionException;
130 
131     public java.util.List getGroups(long pk, int begin, int end)
132         throws com.liferay.portal.SystemException, 
133             com.liferay.portal.NoSuchPermissionException;
134 
135     public java.util.List getGroups(long pk, int begin, int end,
136         com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException, 
138             com.liferay.portal.NoSuchPermissionException;
139 
140     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
141 
142     public boolean containsGroup(long pk, long groupPK)
143         throws com.liferay.portal.SystemException;
144 
145     public boolean containsGroups(long pk)
146         throws com.liferay.portal.SystemException;
147 
148     public void addGroup(long pk, long groupPK)
149         throws com.liferay.portal.SystemException, 
150             com.liferay.portal.NoSuchGroupException, 
151             com.liferay.portal.NoSuchPermissionException;
152 
153     public void addGroup(long pk, com.liferay.portal.model.Group group)
154         throws com.liferay.portal.SystemException, 
155             com.liferay.portal.NoSuchGroupException, 
156             com.liferay.portal.NoSuchPermissionException;
157 
158     public void addGroups(long pk, long[] groupPKs)
159         throws com.liferay.portal.SystemException, 
160             com.liferay.portal.NoSuchGroupException, 
161             com.liferay.portal.NoSuchPermissionException;
162 
163     public void addGroups(long pk, java.util.List groups)
164         throws com.liferay.portal.SystemException, 
165             com.liferay.portal.NoSuchGroupException, 
166             com.liferay.portal.NoSuchPermissionException;
167 
168     public void clearGroups(long pk)
169         throws com.liferay.portal.SystemException, 
170             com.liferay.portal.NoSuchPermissionException;
171 
172     public void removeGroup(long pk, long groupPK)
173         throws com.liferay.portal.SystemException, 
174             com.liferay.portal.NoSuchGroupException, 
175             com.liferay.portal.NoSuchPermissionException;
176 
177     public void removeGroup(long pk, com.liferay.portal.model.Group group)
178         throws com.liferay.portal.SystemException, 
179             com.liferay.portal.NoSuchGroupException, 
180             com.liferay.portal.NoSuchPermissionException;
181 
182     public void removeGroups(long pk, long[] groupPKs)
183         throws com.liferay.portal.SystemException, 
184             com.liferay.portal.NoSuchGroupException, 
185             com.liferay.portal.NoSuchPermissionException;
186 
187     public void removeGroups(long pk, java.util.List groups)
188         throws com.liferay.portal.SystemException, 
189             com.liferay.portal.NoSuchGroupException, 
190             com.liferay.portal.NoSuchPermissionException;
191 
192     public void setGroups(long pk, long[] groupPKs)
193         throws com.liferay.portal.SystemException, 
194             com.liferay.portal.NoSuchGroupException, 
195             com.liferay.portal.NoSuchPermissionException;
196 
197     public void setGroups(long pk, java.util.List groups)
198         throws com.liferay.portal.SystemException, 
199             com.liferay.portal.NoSuchGroupException, 
200             com.liferay.portal.NoSuchPermissionException;
201 
202     public java.util.List getRoles(long pk)
203         throws com.liferay.portal.SystemException, 
204             com.liferay.portal.NoSuchPermissionException;
205 
206     public java.util.List getRoles(long pk, int begin, int end)
207         throws com.liferay.portal.SystemException, 
208             com.liferay.portal.NoSuchPermissionException;
209 
210     public java.util.List getRoles(long pk, int begin, int end,
211         com.liferay.portal.kernel.util.OrderByComparator obc)
212         throws com.liferay.portal.SystemException, 
213             com.liferay.portal.NoSuchPermissionException;
214 
215     public int getRolesSize(long pk) throws com.liferay.portal.SystemException;
216 
217     public boolean containsRole(long pk, long rolePK)
218         throws com.liferay.portal.SystemException;
219 
220     public boolean containsRoles(long pk)
221         throws com.liferay.portal.SystemException;
222 
223     public void addRole(long pk, long rolePK)
224         throws com.liferay.portal.SystemException, 
225             com.liferay.portal.NoSuchRoleException, 
226             com.liferay.portal.NoSuchPermissionException;
227 
228     public void addRole(long pk, com.liferay.portal.model.Role role)
229         throws com.liferay.portal.SystemException, 
230             com.liferay.portal.NoSuchRoleException, 
231             com.liferay.portal.NoSuchPermissionException;
232 
233     public void addRoles(long pk, long[] rolePKs)
234         throws com.liferay.portal.SystemException, 
235             com.liferay.portal.NoSuchRoleException, 
236             com.liferay.portal.NoSuchPermissionException;
237 
238     public void addRoles(long pk, java.util.List roles)
239         throws com.liferay.portal.SystemException, 
240             com.liferay.portal.NoSuchRoleException, 
241             com.liferay.portal.NoSuchPermissionException;
242 
243     public void clearRoles(long pk)
244         throws com.liferay.portal.SystemException, 
245             com.liferay.portal.NoSuchPermissionException;
246 
247     public void removeRole(long pk, long rolePK)
248         throws com.liferay.portal.SystemException, 
249             com.liferay.portal.NoSuchRoleException, 
250             com.liferay.portal.NoSuchPermissionException;
251 
252     public void removeRole(long pk, com.liferay.portal.model.Role role)
253         throws com.liferay.portal.SystemException, 
254             com.liferay.portal.NoSuchRoleException, 
255             com.liferay.portal.NoSuchPermissionException;
256 
257     public void removeRoles(long pk, long[] rolePKs)
258         throws com.liferay.portal.SystemException, 
259             com.liferay.portal.NoSuchRoleException, 
260             com.liferay.portal.NoSuchPermissionException;
261 
262     public void removeRoles(long pk, java.util.List roles)
263         throws com.liferay.portal.SystemException, 
264             com.liferay.portal.NoSuchRoleException, 
265             com.liferay.portal.NoSuchPermissionException;
266 
267     public void setRoles(long pk, long[] rolePKs)
268         throws com.liferay.portal.SystemException, 
269             com.liferay.portal.NoSuchRoleException, 
270             com.liferay.portal.NoSuchPermissionException;
271 
272     public void setRoles(long pk, java.util.List roles)
273         throws com.liferay.portal.SystemException, 
274             com.liferay.portal.NoSuchRoleException, 
275             com.liferay.portal.NoSuchPermissionException;
276 
277     public java.util.List getUsers(long pk)
278         throws com.liferay.portal.SystemException, 
279             com.liferay.portal.NoSuchPermissionException;
280 
281     public java.util.List getUsers(long pk, int begin, int end)
282         throws com.liferay.portal.SystemException, 
283             com.liferay.portal.NoSuchPermissionException;
284 
285     public java.util.List getUsers(long pk, int begin, int end,
286         com.liferay.portal.kernel.util.OrderByComparator obc)
287         throws com.liferay.portal.SystemException, 
288             com.liferay.portal.NoSuchPermissionException;
289 
290     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
291 
292     public boolean containsUser(long pk, long userPK)
293         throws com.liferay.portal.SystemException;
294 
295     public boolean containsUsers(long pk)
296         throws com.liferay.portal.SystemException;
297 
298     public void addUser(long pk, long userPK)
299         throws com.liferay.portal.SystemException, 
300             com.liferay.portal.NoSuchPermissionException, 
301             com.liferay.portal.NoSuchUserException;
302 
303     public void addUser(long pk, com.liferay.portal.model.User user)
304         throws com.liferay.portal.SystemException, 
305             com.liferay.portal.NoSuchPermissionException, 
306             com.liferay.portal.NoSuchUserException;
307 
308     public void addUsers(long pk, long[] userPKs)
309         throws com.liferay.portal.SystemException, 
310             com.liferay.portal.NoSuchPermissionException, 
311             com.liferay.portal.NoSuchUserException;
312 
313     public void addUsers(long pk, java.util.List users)
314         throws com.liferay.portal.SystemException, 
315             com.liferay.portal.NoSuchPermissionException, 
316             com.liferay.portal.NoSuchUserException;
317 
318     public void clearUsers(long pk)
319         throws com.liferay.portal.SystemException, 
320             com.liferay.portal.NoSuchPermissionException;
321 
322     public void removeUser(long pk, long userPK)
323         throws com.liferay.portal.SystemException, 
324             com.liferay.portal.NoSuchPermissionException, 
325             com.liferay.portal.NoSuchUserException;
326 
327     public void removeUser(long pk, com.liferay.portal.model.User user)
328         throws com.liferay.portal.SystemException, 
329             com.liferay.portal.NoSuchPermissionException, 
330             com.liferay.portal.NoSuchUserException;
331 
332     public void removeUsers(long pk, long[] userPKs)
333         throws com.liferay.portal.SystemException, 
334             com.liferay.portal.NoSuchPermissionException, 
335             com.liferay.portal.NoSuchUserException;
336 
337     public void removeUsers(long pk, java.util.List users)
338         throws com.liferay.portal.SystemException, 
339             com.liferay.portal.NoSuchPermissionException, 
340             com.liferay.portal.NoSuchUserException;
341 
342     public void setUsers(long pk, long[] userPKs)
343         throws com.liferay.portal.SystemException, 
344             com.liferay.portal.NoSuchPermissionException, 
345             com.liferay.portal.NoSuchUserException;
346 
347     public void setUsers(long pk, java.util.List users)
348         throws com.liferay.portal.SystemException, 
349             com.liferay.portal.NoSuchPermissionException, 
350             com.liferay.portal.NoSuchUserException;
351 }