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.NoSuchPermissionException,
36              com.liferay.portal.SystemException;
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.NoSuchPermissionException,
73              com.liferay.portal.SystemException;
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 start, int end)
83          throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portal.model.Permission> findByResourceId(
86          long resourceId, int start, 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.NoSuchPermissionException,
93              com.liferay.portal.SystemException;
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.NoSuchPermissionException,
98              com.liferay.portal.SystemException;
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.NoSuchPermissionException,
104             com.liferay.portal.SystemException;
105 
106     public com.liferay.portal.model.Permission findByA_R(
107         java.lang.String actionId, long resourceId)
108         throws com.liferay.portal.NoSuchPermissionException,
109             com.liferay.portal.SystemException;
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<Object> findWithDynamicQuery(
116         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
117         throws com.liferay.portal.SystemException;
118 
119     public java.util.List<Object> findWithDynamicQuery(
120         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
121         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 start, int end) throws com.liferay.portal.SystemException;
128 
129     public java.util.List<com.liferay.portal.model.Permission> findAll(
130         int start, 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.NoSuchPermissionException,
138             com.liferay.portal.SystemException;
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 
153     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
154         int start, int end) throws com.liferay.portal.SystemException;
155 
156     public java.util.List<com.liferay.portal.model.Group> getGroups(long pk,
157         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.SystemException;
159 
160     public int getGroupsSize(long pk) throws com.liferay.portal.SystemException;
161 
162     public boolean containsGroup(long pk, long groupPK)
163         throws com.liferay.portal.SystemException;
164 
165     public boolean containsGroups(long pk)
166         throws com.liferay.portal.SystemException;
167 
168     public void addGroup(long pk, long groupPK)
169         throws com.liferay.portal.SystemException;
170 
171     public void addGroup(long pk, com.liferay.portal.model.Group group)
172         throws com.liferay.portal.SystemException;
173 
174     public void addGroups(long pk, long[] groupPKs)
175         throws com.liferay.portal.SystemException;
176 
177     public void addGroups(long pk,
178         java.util.List<com.liferay.portal.model.Group> groups)
179         throws com.liferay.portal.SystemException;
180 
181     public void clearGroups(long pk) throws com.liferay.portal.SystemException;
182 
183     public void removeGroup(long pk, long groupPK)
184         throws com.liferay.portal.SystemException;
185 
186     public void removeGroup(long pk, com.liferay.portal.model.Group group)
187         throws com.liferay.portal.SystemException;
188 
189     public void removeGroups(long pk, long[] groupPKs)
190         throws com.liferay.portal.SystemException;
191 
192     public void removeGroups(long pk,
193         java.util.List<com.liferay.portal.model.Group> groups)
194         throws com.liferay.portal.SystemException;
195 
196     public void setGroups(long pk, long[] groupPKs)
197         throws com.liferay.portal.SystemException;
198 
199     public void setGroups(long pk,
200         java.util.List<com.liferay.portal.model.Group> groups)
201         throws com.liferay.portal.SystemException;
202 
203     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk)
204         throws com.liferay.portal.SystemException;
205 
206     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
207         int start, int end) throws com.liferay.portal.SystemException;
208 
209     public java.util.List<com.liferay.portal.model.Role> getRoles(long pk,
210         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
211         throws com.liferay.portal.SystemException;
212 
213     public int getRolesSize(long pk) throws com.liferay.portal.SystemException;
214 
215     public boolean containsRole(long pk, long rolePK)
216         throws com.liferay.portal.SystemException;
217 
218     public boolean containsRoles(long pk)
219         throws com.liferay.portal.SystemException;
220 
221     public void addRole(long pk, long rolePK)
222         throws com.liferay.portal.SystemException;
223 
224     public void addRole(long pk, com.liferay.portal.model.Role role)
225         throws com.liferay.portal.SystemException;
226 
227     public void addRoles(long pk, long[] rolePKs)
228         throws com.liferay.portal.SystemException;
229 
230     public void addRoles(long pk,
231         java.util.List<com.liferay.portal.model.Role> roles)
232         throws com.liferay.portal.SystemException;
233 
234     public void clearRoles(long pk) throws com.liferay.portal.SystemException;
235 
236     public void removeRole(long pk, long rolePK)
237         throws com.liferay.portal.SystemException;
238 
239     public void removeRole(long pk, com.liferay.portal.model.Role role)
240         throws com.liferay.portal.SystemException;
241 
242     public void removeRoles(long pk, long[] rolePKs)
243         throws com.liferay.portal.SystemException;
244 
245     public void removeRoles(long pk,
246         java.util.List<com.liferay.portal.model.Role> roles)
247         throws com.liferay.portal.SystemException;
248 
249     public void setRoles(long pk, long[] rolePKs)
250         throws com.liferay.portal.SystemException;
251 
252     public void setRoles(long pk,
253         java.util.List<com.liferay.portal.model.Role> roles)
254         throws com.liferay.portal.SystemException;
255 
256     public java.util.List<com.liferay.portal.model.User> getUsers(long pk)
257         throws com.liferay.portal.SystemException;
258 
259     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
260         int start, int end) throws com.liferay.portal.SystemException;
261 
262     public java.util.List<com.liferay.portal.model.User> getUsers(long pk,
263         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
264         throws com.liferay.portal.SystemException;
265 
266     public int getUsersSize(long pk) throws com.liferay.portal.SystemException;
267 
268     public boolean containsUser(long pk, long userPK)
269         throws com.liferay.portal.SystemException;
270 
271     public boolean containsUsers(long pk)
272         throws com.liferay.portal.SystemException;
273 
274     public void addUser(long pk, long userPK)
275         throws com.liferay.portal.SystemException;
276 
277     public void addUser(long pk, com.liferay.portal.model.User user)
278         throws com.liferay.portal.SystemException;
279 
280     public void addUsers(long pk, long[] userPKs)
281         throws com.liferay.portal.SystemException;
282 
283     public void addUsers(long pk,
284         java.util.List<com.liferay.portal.model.User> users)
285         throws com.liferay.portal.SystemException;
286 
287     public void clearUsers(long pk) throws com.liferay.portal.SystemException;
288 
289     public void removeUser(long pk, long userPK)
290         throws com.liferay.portal.SystemException;
291 
292     public void removeUser(long pk, com.liferay.portal.model.User user)
293         throws com.liferay.portal.SystemException;
294 
295     public void removeUsers(long pk, long[] userPKs)
296         throws com.liferay.portal.SystemException;
297 
298     public void removeUsers(long pk,
299         java.util.List<com.liferay.portal.model.User> users)
300         throws com.liferay.portal.SystemException;
301 
302     public void setUsers(long pk, long[] userPKs)
303         throws com.liferay.portal.SystemException;
304 
305     public void setUsers(long pk,
306         java.util.List<com.liferay.portal.model.User> users)
307         throws com.liferay.portal.SystemException;
308 
309     public void registerListener(
310         com.liferay.portal.model.ModelListener listener);
311 
312     public void unregisterListener(
313         com.liferay.portal.model.ModelListener listener);
314 }