1   /**
2    * Copyright (c) 2000-2008 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 updateImpl(
51          com.liferay.portal.model.Permission permission, boolean merge)
52          throws com.liferay.portal.SystemException;
53  
54      public com.liferay.portal.model.Permission findByPrimaryKey(
55          long permissionId)
56          throws com.liferay.portal.SystemException, 
57              com.liferay.portal.NoSuchPermissionException;
58  
59      public com.liferay.portal.model.Permission fetchByPrimaryKey(
60          long permissionId) throws com.liferay.portal.SystemException;
61  
62      public java.util.List findByResourceId(long resourceId)
63          throws com.liferay.portal.SystemException;
64  
65      public java.util.List findByResourceId(long resourceId, int begin, int end)
66          throws com.liferay.portal.SystemException;
67  
68      public java.util.List findByResourceId(long resourceId, int begin, int end,
69          com.liferay.portal.kernel.util.OrderByComparator obc)
70          throws com.liferay.portal.SystemException;
71  
72      public com.liferay.portal.model.Permission findByResourceId_First(
73          long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
74          throws com.liferay.portal.SystemException, 
75              com.liferay.portal.NoSuchPermissionException;
76  
77      public com.liferay.portal.model.Permission findByResourceId_Last(
78          long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
79          throws com.liferay.portal.SystemException, 
80              com.liferay.portal.NoSuchPermissionException;
81  
82      public com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
83          long permissionId, long resourceId,
84          com.liferay.portal.kernel.util.OrderByComparator obc)
85          throws com.liferay.portal.SystemException, 
86              com.liferay.portal.NoSuchPermissionException;
87  
88      public com.liferay.portal.model.Permission findByA_R(
89          java.lang.String actionId, long resourceId)
90          throws com.liferay.portal.SystemException, 
91              com.liferay.portal.NoSuchPermissionException;
92  
93      public com.liferay.portal.model.Permission fetchByA_R(
94          java.lang.String actionId, long resourceId)
95          throws com.liferay.portal.SystemException;
96  
97      public java.util.List findWithDynamicQuery(
98          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
99          throws com.liferay.portal.SystemException;
100 
101     public java.util.List findWithDynamicQuery(
102         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
103         int begin, int end) throws com.liferay.portal.SystemException;
104 
105     public java.util.List findAll() throws com.liferay.portal.SystemException;
106 
107     public java.util.List findAll(int begin, int end)
108         throws com.liferay.portal.SystemException;
109 
110     public java.util.List findAll(int begin, int end,
111         com.liferay.portal.kernel.util.OrderByComparator obc)
112         throws com.liferay.portal.SystemException;
113 
114     public void removeByResourceId(long resourceId)
115         throws com.liferay.portal.SystemException;
116 
117     public void removeByA_R(java.lang.String actionId, long resourceId)
118         throws com.liferay.portal.SystemException, 
119             com.liferay.portal.NoSuchPermissionException;
120 
121     public void removeAll() throws com.liferay.portal.SystemException;
122 
123     public int countByResourceId(long resourceId)
124         throws com.liferay.portal.SystemException;
125 
126     public int countByA_R(java.lang.String actionId, long resourceId)
127         throws com.liferay.portal.SystemException;
128 
129     public int countAll() throws com.liferay.portal.SystemException;
130 
131     public java.util.List getGroups(long pk)
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         throws com.liferay.portal.SystemException, 
137             com.liferay.portal.NoSuchPermissionException;
138 
139     public java.util.List getGroups(long pk, int begin, int end,
140         com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.SystemException, 
142             com.liferay.portal.NoSuchPermissionException;
143 
144     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
145 
146     public boolean containsGroup(long pk, long groupPK)
147         throws com.liferay.portal.SystemException;
148 
149     public boolean containsGroups(long pk)
150         throws com.liferay.portal.SystemException;
151 
152     public void addGroup(long pk, long groupPK)
153         throws com.liferay.portal.SystemException, 
154             com.liferay.portal.NoSuchGroupException, 
155             com.liferay.portal.NoSuchPermissionException;
156 
157     public void addGroup(long pk, com.liferay.portal.model.Group group)
158         throws com.liferay.portal.SystemException, 
159             com.liferay.portal.NoSuchGroupException, 
160             com.liferay.portal.NoSuchPermissionException;
161 
162     public void addGroups(long pk, long[] groupPKs)
163         throws com.liferay.portal.SystemException, 
164             com.liferay.portal.NoSuchGroupException, 
165             com.liferay.portal.NoSuchPermissionException;
166 
167     public void addGroups(long pk, java.util.List groups)
168         throws com.liferay.portal.SystemException, 
169             com.liferay.portal.NoSuchGroupException, 
170             com.liferay.portal.NoSuchPermissionException;
171 
172     public void clearGroups(long pk)
173         throws com.liferay.portal.SystemException, 
174             com.liferay.portal.NoSuchPermissionException;
175 
176     public void removeGroup(long pk, long groupPK)
177         throws com.liferay.portal.SystemException, 
178             com.liferay.portal.NoSuchGroupException, 
179             com.liferay.portal.NoSuchPermissionException;
180 
181     public void removeGroup(long pk, com.liferay.portal.model.Group group)
182         throws com.liferay.portal.SystemException, 
183             com.liferay.portal.NoSuchGroupException, 
184             com.liferay.portal.NoSuchPermissionException;
185 
186     public void removeGroups(long pk, long[] groupPKs)
187         throws com.liferay.portal.SystemException, 
188             com.liferay.portal.NoSuchGroupException, 
189             com.liferay.portal.NoSuchPermissionException;
190 
191     public void removeGroups(long pk, java.util.List groups)
192         throws com.liferay.portal.SystemException, 
193             com.liferay.portal.NoSuchGroupException, 
194             com.liferay.portal.NoSuchPermissionException;
195 
196     public void setGroups(long pk, long[] groupPKs)
197         throws com.liferay.portal.SystemException, 
198             com.liferay.portal.NoSuchGroupException, 
199             com.liferay.portal.NoSuchPermissionException;
200 
201     public void setGroups(long pk, java.util.List groups)
202         throws com.liferay.portal.SystemException, 
203             com.liferay.portal.NoSuchGroupException, 
204             com.liferay.portal.NoSuchPermissionException;
205 
206     public java.util.List getRoles(long pk)
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         throws com.liferay.portal.SystemException, 
212             com.liferay.portal.NoSuchPermissionException;
213 
214     public java.util.List getRoles(long pk, int begin, int end,
215         com.liferay.portal.kernel.util.OrderByComparator obc)
216         throws com.liferay.portal.SystemException, 
217             com.liferay.portal.NoSuchPermissionException;
218 
219     public int getRolesSize(long pk) throws com.liferay.portal.SystemException;
220 
221     public boolean containsRole(long pk, long rolePK)
222         throws com.liferay.portal.SystemException;
223 
224     public boolean containsRoles(long pk)
225         throws com.liferay.portal.SystemException;
226 
227     public void addRole(long pk, long rolePK)
228         throws com.liferay.portal.SystemException, 
229             com.liferay.portal.NoSuchRoleException, 
230             com.liferay.portal.NoSuchPermissionException;
231 
232     public void addRole(long pk, com.liferay.portal.model.Role role)
233         throws com.liferay.portal.SystemException, 
234             com.liferay.portal.NoSuchRoleException, 
235             com.liferay.portal.NoSuchPermissionException;
236 
237     public void addRoles(long pk, long[] rolePKs)
238         throws com.liferay.portal.SystemException, 
239             com.liferay.portal.NoSuchRoleException, 
240             com.liferay.portal.NoSuchPermissionException;
241 
242     public void addRoles(long pk, java.util.List roles)
243         throws com.liferay.portal.SystemException, 
244             com.liferay.portal.NoSuchRoleException, 
245             com.liferay.portal.NoSuchPermissionException;
246 
247     public void clearRoles(long pk)
248         throws com.liferay.portal.SystemException, 
249             com.liferay.portal.NoSuchPermissionException;
250 
251     public void removeRole(long pk, long rolePK)
252         throws com.liferay.portal.SystemException, 
253             com.liferay.portal.NoSuchRoleException, 
254             com.liferay.portal.NoSuchPermissionException;
255 
256     public void removeRole(long pk, com.liferay.portal.model.Role role)
257         throws com.liferay.portal.SystemException, 
258             com.liferay.portal.NoSuchRoleException, 
259             com.liferay.portal.NoSuchPermissionException;
260 
261     public void removeRoles(long pk, long[] rolePKs)
262         throws com.liferay.portal.SystemException, 
263             com.liferay.portal.NoSuchRoleException, 
264             com.liferay.portal.NoSuchPermissionException;
265 
266     public void removeRoles(long pk, java.util.List roles)
267         throws com.liferay.portal.SystemException, 
268             com.liferay.portal.NoSuchRoleException, 
269             com.liferay.portal.NoSuchPermissionException;
270 
271     public void setRoles(long pk, long[] rolePKs)
272         throws com.liferay.portal.SystemException, 
273             com.liferay.portal.NoSuchRoleException, 
274             com.liferay.portal.NoSuchPermissionException;
275 
276     public void setRoles(long pk, java.util.List roles)
277         throws com.liferay.portal.SystemException, 
278             com.liferay.portal.NoSuchRoleException, 
279             com.liferay.portal.NoSuchPermissionException;
280 
281     public java.util.List getUsers(long pk)
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         throws com.liferay.portal.SystemException, 
287             com.liferay.portal.NoSuchPermissionException;
288 
289     public java.util.List getUsers(long pk, int begin, int end,
290         com.liferay.portal.kernel.util.OrderByComparator obc)
291         throws com.liferay.portal.SystemException, 
292             com.liferay.portal.NoSuchPermissionException;
293 
294     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
295 
296     public boolean containsUser(long pk, long userPK)
297         throws com.liferay.portal.SystemException;
298 
299     public boolean containsUsers(long pk)
300         throws com.liferay.portal.SystemException;
301 
302     public void addUser(long pk, long userPK)
303         throws com.liferay.portal.SystemException, 
304             com.liferay.portal.NoSuchPermissionException, 
305             com.liferay.portal.NoSuchUserException;
306 
307     public void addUser(long pk, com.liferay.portal.model.User user)
308         throws com.liferay.portal.SystemException, 
309             com.liferay.portal.NoSuchPermissionException, 
310             com.liferay.portal.NoSuchUserException;
311 
312     public void addUsers(long pk, long[] userPKs)
313         throws com.liferay.portal.SystemException, 
314             com.liferay.portal.NoSuchPermissionException, 
315             com.liferay.portal.NoSuchUserException;
316 
317     public void addUsers(long pk, java.util.List users)
318         throws com.liferay.portal.SystemException, 
319             com.liferay.portal.NoSuchPermissionException, 
320             com.liferay.portal.NoSuchUserException;
321 
322     public void clearUsers(long pk)
323         throws com.liferay.portal.SystemException, 
324             com.liferay.portal.NoSuchPermissionException;
325 
326     public void removeUser(long pk, long userPK)
327         throws com.liferay.portal.SystemException, 
328             com.liferay.portal.NoSuchPermissionException, 
329             com.liferay.portal.NoSuchUserException;
330 
331     public void removeUser(long pk, com.liferay.portal.model.User user)
332         throws com.liferay.portal.SystemException, 
333             com.liferay.portal.NoSuchPermissionException, 
334             com.liferay.portal.NoSuchUserException;
335 
336     public void removeUsers(long pk, long[] userPKs)
337         throws com.liferay.portal.SystemException, 
338             com.liferay.portal.NoSuchPermissionException, 
339             com.liferay.portal.NoSuchUserException;
340 
341     public void removeUsers(long pk, java.util.List users)
342         throws com.liferay.portal.SystemException, 
343             com.liferay.portal.NoSuchPermissionException, 
344             com.liferay.portal.NoSuchUserException;
345 
346     public void setUsers(long pk, long[] userPKs)
347         throws com.liferay.portal.SystemException, 
348             com.liferay.portal.NoSuchPermissionException, 
349             com.liferay.portal.NoSuchUserException;
350 
351     public void setUsers(long pk, java.util.List users)
352         throws com.liferay.portal.SystemException, 
353             com.liferay.portal.NoSuchPermissionException, 
354             com.liferay.portal.NoSuchUserException;
355 }