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      /**
43       * @deprecated Use <code>update(Permission permission, boolean merge)</code>.
44       */
45      public com.liferay.portal.model.Permission update(
46          com.liferay.portal.model.Permission permission)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * Add, update, or merge, the entity. This method also calls the model
51       * listeners to trigger the proper events associated with adding, deleting,
52       * or updating an entity.
53       *
54       * @param        permission the entity to add, update, or merge
55       * @param        merge boolean value for whether to merge the entity. The
56       *                default value is false. Setting merge to true is more
57       *                expensive and should only be true when permission is
58       *                transient. See LEP-5473 for a detailed discussion of this
59       *                method.
60       * @return        true if the portlet can be displayed via Ajax
61       */
62      public com.liferay.portal.model.Permission update(
63          com.liferay.portal.model.Permission permission, boolean merge)
64          throws com.liferay.portal.SystemException;
65  
66      public com.liferay.portal.model.Permission updateImpl(
67          com.liferay.portal.model.Permission permission, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Permission findByPrimaryKey(
71          long permissionId)
72          throws com.liferay.portal.SystemException,
73              com.liferay.portal.NoSuchPermissionException;
74  
75      public com.liferay.portal.model.Permission fetchByPrimaryKey(
76          long permissionId) throws com.liferay.portal.SystemException;
77  
78      public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
79          long resourceId) throws com.liferay.portal.SystemException;
80  
81      public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
82          long resourceId, int begin, int end)
83          throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
86          long resourceId, int begin, int end,
87          com.liferay.portal.kernel.util.OrderByComparator obc)
88          throws com.liferay.portal.SystemException;
89  
90      public com.liferay.portal.model.Permission findByResourceId_First(
91          long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
92          throws com.liferay.portal.SystemException,
93              com.liferay.portal.NoSuchPermissionException;
94  
95      public com.liferay.portal.model.Permission findByResourceId_Last(
96          long resourceId, com.liferay.portal.kernel.util.OrderByComparator obc)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portal.NoSuchPermissionException;
99  
100     public com.liferay.portal.model.Permission[] findByResourceId_PrevAndNext(
101         long permissionId, long resourceId,
102         com.liferay.portal.kernel.util.OrderByComparator obc)
103         throws com.liferay.portal.SystemException,
104             com.liferay.portal.NoSuchPermissionException;
105 
106     public com.liferay.portal.model.Permission findByA_R(
107         java.lang.String actionId, long resourceId)
108         throws com.liferay.portal.SystemException,
109             com.liferay.portal.NoSuchPermissionException;
110 
111     public com.liferay.portal.model.Permission fetchByA_R(
112         java.lang.String actionId, long resourceId)
113         throws com.liferay.portal.SystemException;
114 
115     public java.util.List<com.liferay.portal.model.Permission> findWithDynamicQuery(
116         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
117         throws com.liferay.portal.SystemException;
118 
119     public java.util.List<com.liferay.portal.model.Permission> findWithDynamicQuery(
120         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
121         int begin, int end) throws com.liferay.portal.SystemException;
122 
123     public java.util.List<com.liferay.portal.model.Permission> findAll()
124         throws com.liferay.portal.SystemException;
125 
126     public java.util.List<com.liferay.portal.model.Permission> findAll(
127         int begin, int end) throws com.liferay.portal.SystemException;
128 
129     public java.util.List<com.liferay.portal.model.Permission> findAll(
130         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException;
132 
133     public void removeByResourceId(long resourceId)
134         throws com.liferay.portal.SystemException;
135 
136     public void removeByA_R(java.lang.String actionId, long resourceId)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portal.NoSuchPermissionException;
139 
140     public void removeAll() throws com.liferay.portal.SystemException;
141 
142     public int countByResourceId(long resourceId)
143         throws com.liferay.portal.SystemException;
144 
145     public int countByA_R(java.lang.String actionId, long resourceId)
146         throws com.liferay.portal.SystemException;
147 
148     public int countAll() throws com.liferay.portal.SystemException;
149 
150     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk)
151         throws com.liferay.portal.SystemException,
152             com.liferay.portal.NoSuchPermissionException;
153 
154     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
155         int begin, int end)
156         throws com.liferay.portal.SystemException,
157             com.liferay.portal.NoSuchPermissionException;
158 
159     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
160         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
161         throws com.liferay.portal.SystemException,
162             com.liferay.portal.NoSuchPermissionException;
163 
164     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
165 
166     public boolean containsGroup(long pk, long groupPK)
167         throws com.liferay.portal.SystemException;
168 
169     public boolean containsGroups(long pk)
170         throws com.liferay.portal.SystemException;
171 
172     public void addGroup(long pk, long groupPK)
173         throws com.liferay.portal.SystemException,
174             com.liferay.portal.NoSuchGroupException,
175             com.liferay.portal.NoSuchPermissionException;
176 
177     public void addGroup(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 addGroups(long pk, long[] groupPKs)
183         throws com.liferay.portal.SystemException,
184             com.liferay.portal.NoSuchGroupException,
185             com.liferay.portal.NoSuchPermissionException;
186 
187     public void addGroups(long pk,
188         java.util.List<com.liferay.portal.model.Group> groups)
189         throws com.liferay.portal.SystemException,
190             com.liferay.portal.NoSuchGroupException,
191             com.liferay.portal.NoSuchPermissionException;
192 
193     public void clearGroups(long pk)
194         throws com.liferay.portal.SystemException,
195             com.liferay.portal.NoSuchPermissionException;
196 
197     public void removeGroup(long pk, long groupPK)
198         throws com.liferay.portal.SystemException,
199             com.liferay.portal.NoSuchGroupException,
200             com.liferay.portal.NoSuchPermissionException;
201 
202     public void removeGroup(long pk, com.liferay.portal.model.Group group)
203         throws com.liferay.portal.SystemException,
204             com.liferay.portal.NoSuchGroupException,
205             com.liferay.portal.NoSuchPermissionException;
206 
207     public void removeGroups(long pk, long[] groupPKs)
208         throws com.liferay.portal.SystemException,
209             com.liferay.portal.NoSuchGroupException,
210             com.liferay.portal.NoSuchPermissionException;
211 
212     public void removeGroups(long pk,
213         java.util.List<com.liferay.portal.model.Group> groups)
214         throws com.liferay.portal.SystemException,
215             com.liferay.portal.NoSuchGroupException,
216             com.liferay.portal.NoSuchPermissionException;
217 
218     public void setGroups(long pk, long[] groupPKs)
219         throws com.liferay.portal.SystemException,
220             com.liferay.portal.NoSuchGroupException,
221             com.liferay.portal.NoSuchPermissionException;
222 
223     public void setGroups(long pk,
224         java.util.List<com.liferay.portal.model.Group> groups)
225         throws com.liferay.portal.SystemException,
226             com.liferay.portal.NoSuchGroupException,
227             com.liferay.portal.NoSuchPermissionException;
228 
229     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk)
230         throws com.liferay.portal.SystemException,
231             com.liferay.portal.NoSuchPermissionException;
232 
233     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
234         int begin, int end)
235         throws com.liferay.portal.SystemException,
236             com.liferay.portal.NoSuchPermissionException;
237 
238     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
239         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
240         throws com.liferay.portal.SystemException,
241             com.liferay.portal.NoSuchPermissionException;
242 
243     public int getRolesSize(long pk) throws com.liferay.portal.SystemException;
244 
245     public boolean containsRole(long pk, long rolePK)
246         throws com.liferay.portal.SystemException;
247 
248     public boolean containsRoles(long pk)
249         throws com.liferay.portal.SystemException;
250 
251     public void addRole(long pk, long rolePK)
252         throws com.liferay.portal.SystemException,
253             com.liferay.portal.NoSuchRoleException,
254             com.liferay.portal.NoSuchPermissionException;
255 
256     public void addRole(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 addRoles(long pk, long[] rolePKs)
262         throws com.liferay.portal.SystemException,
263             com.liferay.portal.NoSuchRoleException,
264             com.liferay.portal.NoSuchPermissionException;
265 
266     public void addRoles(long pk,
267         java.util.List<com.liferay.portal.model.Role> roles)
268         throws com.liferay.portal.SystemException,
269             com.liferay.portal.NoSuchRoleException,
270             com.liferay.portal.NoSuchPermissionException;
271 
272     public void clearRoles(long pk)
273         throws com.liferay.portal.SystemException,
274             com.liferay.portal.NoSuchPermissionException;
275 
276     public void removeRole(long pk, long rolePK)
277         throws com.liferay.portal.SystemException,
278             com.liferay.portal.NoSuchRoleException,
279             com.liferay.portal.NoSuchPermissionException;
280 
281     public void removeRole(long pk, com.liferay.portal.model.Role role)
282         throws com.liferay.portal.SystemException,
283             com.liferay.portal.NoSuchRoleException,
284             com.liferay.portal.NoSuchPermissionException;
285 
286     public void removeRoles(long pk, long[] rolePKs)
287         throws com.liferay.portal.SystemException,
288             com.liferay.portal.NoSuchRoleException,
289             com.liferay.portal.NoSuchPermissionException;
290 
291     public void removeRoles(long pk,
292         java.util.List<com.liferay.portal.model.Role> roles)
293         throws com.liferay.portal.SystemException,
294             com.liferay.portal.NoSuchRoleException,
295             com.liferay.portal.NoSuchPermissionException;
296 
297     public void setRoles(long pk, long[] rolePKs)
298         throws com.liferay.portal.SystemException,
299             com.liferay.portal.NoSuchRoleException,
300             com.liferay.portal.NoSuchPermissionException;
301 
302     public void setRoles(long pk,
303         java.util.List<com.liferay.portal.model.Role> roles)
304         throws com.liferay.portal.SystemException,
305             com.liferay.portal.NoSuchRoleException,
306             com.liferay.portal.NoSuchPermissionException;
307 
308     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
309         throws com.liferay.portal.SystemException,
310             com.liferay.portal.NoSuchPermissionException;
311 
312     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
313         int begin, int end)
314         throws com.liferay.portal.SystemException,
315             com.liferay.portal.NoSuchPermissionException;
316 
317     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
318         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
319         throws com.liferay.portal.SystemException,
320             com.liferay.portal.NoSuchPermissionException;
321 
322     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
323 
324     public boolean containsUser(long pk, long userPK)
325         throws com.liferay.portal.SystemException;
326 
327     public boolean containsUsers(long pk)
328         throws com.liferay.portal.SystemException;
329 
330     public void addUser(long pk, long userPK)
331         throws com.liferay.portal.SystemException,
332             com.liferay.portal.NoSuchPermissionException,
333             com.liferay.portal.NoSuchUserException;
334 
335     public void addUser(long pk, com.liferay.portal.model.User user)
336         throws com.liferay.portal.SystemException,
337             com.liferay.portal.NoSuchPermissionException,
338             com.liferay.portal.NoSuchUserException;
339 
340     public void addUsers(long pk, long[] userPKs)
341         throws com.liferay.portal.SystemException,
342             com.liferay.portal.NoSuchPermissionException,
343             com.liferay.portal.NoSuchUserException;
344 
345     public void addUsers(long pk,
346         java.util.List<com.liferay.portal.model.User> users)
347         throws com.liferay.portal.SystemException,
348             com.liferay.portal.NoSuchPermissionException,
349             com.liferay.portal.NoSuchUserException;
350 
351     public void clearUsers(long pk)
352         throws com.liferay.portal.SystemException,
353             com.liferay.portal.NoSuchPermissionException;
354 
355     public void removeUser(long pk, long userPK)
356         throws com.liferay.portal.SystemException,
357             com.liferay.portal.NoSuchPermissionException,
358             com.liferay.portal.NoSuchUserException;
359 
360     public void removeUser(long pk, com.liferay.portal.model.User user)
361         throws com.liferay.portal.SystemException,
362             com.liferay.portal.NoSuchPermissionException,
363             com.liferay.portal.NoSuchUserException;
364 
365     public void removeUsers(long pk, long[] userPKs)
366         throws com.liferay.portal.SystemException,
367             com.liferay.portal.NoSuchPermissionException,
368             com.liferay.portal.NoSuchUserException;
369 
370     public void removeUsers(long pk,
371         java.util.List<com.liferay.portal.model.User> users)
372         throws com.liferay.portal.SystemException,
373             com.liferay.portal.NoSuchPermissionException,
374             com.liferay.portal.NoSuchUserException;
375 
376     public void setUsers(long pk, long[] userPKs)
377         throws com.liferay.portal.SystemException,
378             com.liferay.portal.NoSuchPermissionException,
379             com.liferay.portal.NoSuchUserException;
380 
381     public void setUsers(long pk,
382         java.util.List<com.liferay.portal.model.User> users)
383         throws com.liferay.portal.SystemException,
384             com.liferay.portal.NoSuchPermissionException,
385             com.liferay.portal.NoSuchUserException;
386 }