001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.Projection;
023    import com.liferay.portal.kernel.exception.PortalException;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.model.PersistedModel;
026    import com.liferay.portal.kernel.model.UserGroupRole;
027    import com.liferay.portal.kernel.search.Indexable;
028    import com.liferay.portal.kernel.search.IndexableType;
029    import com.liferay.portal.kernel.service.persistence.UserGroupRolePK;
030    import com.liferay.portal.kernel.transaction.Isolation;
031    import com.liferay.portal.kernel.transaction.Propagation;
032    import com.liferay.portal.kernel.transaction.Transactional;
033    import com.liferay.portal.kernel.util.OrderByComparator;
034    
035    import java.io.Serializable;
036    
037    import java.util.List;
038    
039    /**
040     * Provides the local service interface for UserGroupRole. Methods of this
041     * service will not have security checks based on the propagated JAAS
042     * credentials because this service can only be accessed from within the same
043     * VM.
044     *
045     * @author Brian Wing Shun Chan
046     * @see UserGroupRoleLocalServiceUtil
047     * @see com.liferay.portal.service.base.UserGroupRoleLocalServiceBaseImpl
048     * @see com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl
049     * @generated
050     */
051    @ProviderType
052    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
053            PortalException.class, SystemException.class})
054    public interface UserGroupRoleLocalService extends BaseLocalService,
055            PersistedModelLocalService {
056            /*
057             * NOTE FOR DEVELOPERS:
058             *
059             * Never modify or reference this interface directly. Always use {@link UserGroupRoleLocalServiceUtil} to access the user group role local service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
060             */
061    
062            /**
063            * Adds the user group role to the database. Also notifies the appropriate model listeners.
064            *
065            * @param userGroupRole the user group role
066            * @return the user group role that was added
067            */
068            @Indexable(type = IndexableType.REINDEX)
069            public UserGroupRole addUserGroupRole(UserGroupRole userGroupRole);
070    
071            public List<UserGroupRole> addUserGroupRoles(long userId, long groupId,
072                    long[] roleIds);
073    
074            public List<UserGroupRole> addUserGroupRoles(long[] userIds, long groupId,
075                    long roleId);
076    
077            /**
078            * Creates a new user group role with the primary key. Does not add the user group role to the database.
079            *
080            * @param userGroupRolePK the primary key for the new user group role
081            * @return the new user group role
082            */
083            public UserGroupRole createUserGroupRole(UserGroupRolePK userGroupRolePK);
084    
085            /**
086            * @throws PortalException
087            */
088            @Override
089            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
090                    throws PortalException;
091    
092            /**
093            * Deletes the user group role from the database. Also notifies the appropriate model listeners.
094            *
095            * @param userGroupRole the user group role
096            * @return the user group role that was removed
097            */
098            @Indexable(type = IndexableType.DELETE)
099            public UserGroupRole deleteUserGroupRole(UserGroupRole userGroupRole);
100    
101            /**
102            * Deletes the user group role with the primary key from the database. Also notifies the appropriate model listeners.
103            *
104            * @param userGroupRolePK the primary key of the user group role
105            * @return the user group role that was removed
106            * @throws PortalException if a user group role with the primary key could not be found
107            */
108            @Indexable(type = IndexableType.DELETE)
109            public UserGroupRole deleteUserGroupRole(UserGroupRolePK userGroupRolePK)
110                    throws PortalException;
111    
112            public void deleteUserGroupRoles(long groupId, int roleType);
113    
114            public void deleteUserGroupRoles(long userId, long groupId, long[] roleIds);
115    
116            public void deleteUserGroupRoles(long userId, long[] groupIds);
117    
118            public void deleteUserGroupRoles(long[] userIds, long groupId);
119    
120            public void deleteUserGroupRoles(long[] userIds, long groupId, long roleId);
121    
122            public void deleteUserGroupRoles(long[] userIds, long groupId, int roleType);
123    
124            public void deleteUserGroupRolesByGroupId(long groupId);
125    
126            public void deleteUserGroupRolesByRoleId(long roleId);
127    
128            public void deleteUserGroupRolesByUserId(long userId);
129    
130            public DynamicQuery dynamicQuery();
131    
132            /**
133            * Performs a dynamic query on the database and returns the matching rows.
134            *
135            * @param dynamicQuery the dynamic query
136            * @return the matching rows
137            */
138            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
139    
140            /**
141            * Performs a dynamic query on the database and returns a range of the matching rows.
142            *
143            * <p>
144            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupRoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
145            * </p>
146            *
147            * @param dynamicQuery the dynamic query
148            * @param start the lower bound of the range of model instances
149            * @param end the upper bound of the range of model instances (not inclusive)
150            * @return the range of matching rows
151            */
152            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
153                    int end);
154    
155            /**
156            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
157            *
158            * <p>
159            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupRoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
160            * </p>
161            *
162            * @param dynamicQuery the dynamic query
163            * @param start the lower bound of the range of model instances
164            * @param end the upper bound of the range of model instances (not inclusive)
165            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
166            * @return the ordered range of matching rows
167            */
168            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
169                    int end, OrderByComparator<T> orderByComparator);
170    
171            /**
172            * Returns the number of rows matching the dynamic query.
173            *
174            * @param dynamicQuery the dynamic query
175            * @return the number of rows matching the dynamic query
176            */
177            public long dynamicQueryCount(DynamicQuery dynamicQuery);
178    
179            /**
180            * Returns the number of rows matching the dynamic query.
181            *
182            * @param dynamicQuery the dynamic query
183            * @param projection the projection to apply to the query
184            * @return the number of rows matching the dynamic query
185            */
186            public long dynamicQueryCount(DynamicQuery dynamicQuery,
187                    Projection projection);
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public UserGroupRole fetchUserGroupRole(UserGroupRolePK userGroupRolePK);
191    
192            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193            public ActionableDynamicQuery getActionableDynamicQuery();
194    
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
197    
198            /**
199            * Returns the OSGi service identifier.
200            *
201            * @return the OSGi service identifier
202            */
203            public java.lang.String getOSGiServiceIdentifier();
204    
205            @Override
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
208                    throws PortalException;
209    
210            /**
211            * Returns the user group role with the primary key.
212            *
213            * @param userGroupRolePK the primary key of the user group role
214            * @return the user group role
215            * @throws PortalException if a user group role with the primary key could not be found
216            */
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public UserGroupRole getUserGroupRole(UserGroupRolePK userGroupRolePK)
219                    throws PortalException;
220    
221            /**
222            * Returns a range of all the user group roles.
223            *
224            * <p>
225            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupRoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
226            * </p>
227            *
228            * @param start the lower bound of the range of user group roles
229            * @param end the upper bound of the range of user group roles (not inclusive)
230            * @return the range of user group roles
231            */
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public List<UserGroupRole> getUserGroupRoles(int start, int end);
234    
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public List<UserGroupRole> getUserGroupRoles(long userId);
237    
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public List<UserGroupRole> getUserGroupRoles(long userId, long groupId);
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public List<UserGroupRole> getUserGroupRoles(long userId, long groupId,
243                    int start, int end);
244    
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public List<UserGroupRole> getUserGroupRolesByGroup(long groupId);
247    
248            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249            public List<UserGroupRole> getUserGroupRolesByGroupAndRole(long groupId,
250                    long roleId);
251    
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public List<UserGroupRole> getUserGroupRolesByUserUserGroupAndGroup(
254                    long userId, long groupId);
255    
256            /**
257            * Returns the number of user group roles.
258            *
259            * @return the number of user group roles
260            */
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public int getUserGroupRolesCount();
263    
264            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265            public int getUserGroupRolesCount(long userId, long groupId);
266    
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public boolean hasUserGroupRole(long userId, long groupId, long roleId);
269    
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public boolean hasUserGroupRole(long userId, long groupId, long roleId,
272                    boolean inherit);
273    
274            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
275            public boolean hasUserGroupRole(long userId, long groupId,
276                    java.lang.String roleName) throws PortalException;
277    
278            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
279            public boolean hasUserGroupRole(long userId, long groupId,
280                    java.lang.String roleName, boolean inherit) throws PortalException;
281    
282            /**
283            * Updates the user group role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
284            *
285            * @param userGroupRole the user group role
286            * @return the user group role that was updated
287            */
288            @Indexable(type = IndexableType.REINDEX)
289            public UserGroupRole updateUserGroupRole(UserGroupRole userGroupRole);
290    }