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.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for UserGroupRole. This utility wraps
024     * {@link com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see UserGroupRoleLocalService
032     * @see com.liferay.portal.service.base.UserGroupRoleLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class UserGroupRoleLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the user group role to the database. Also notifies the appropriate model listeners.
046            *
047            * @param userGroupRole the user group role
048            * @return the user group role that was added
049            */
050            public static com.liferay.portal.model.UserGroupRole addUserGroupRole(
051                    com.liferay.portal.model.UserGroupRole userGroupRole) {
052                    return getService().addUserGroupRole(userGroupRole);
053            }
054    
055            public static java.util.List<com.liferay.portal.model.UserGroupRole> addUserGroupRoles(
056                    long userId, long groupId, long[] roleIds) {
057                    return getService().addUserGroupRoles(userId, groupId, roleIds);
058            }
059    
060            public static java.util.List<com.liferay.portal.model.UserGroupRole> addUserGroupRoles(
061                    long[] userIds, long groupId, long roleId) {
062                    return getService().addUserGroupRoles(userIds, groupId, roleId);
063            }
064    
065            /**
066            * Creates a new user group role with the primary key. Does not add the user group role to the database.
067            *
068            * @param userGroupRolePK the primary key for the new user group role
069            * @return the new user group role
070            */
071            public static com.liferay.portal.model.UserGroupRole createUserGroupRole(
072                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK) {
073                    return getService().createUserGroupRole(userGroupRolePK);
074            }
075    
076            /**
077            * @throws PortalException
078            */
079            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
080                    com.liferay.portal.model.PersistedModel persistedModel)
081                    throws com.liferay.portal.kernel.exception.PortalException {
082                    return getService().deletePersistedModel(persistedModel);
083            }
084    
085            /**
086            * Deletes the user group role from the database. Also notifies the appropriate model listeners.
087            *
088            * @param userGroupRole the user group role
089            * @return the user group role that was removed
090            */
091            public static com.liferay.portal.model.UserGroupRole deleteUserGroupRole(
092                    com.liferay.portal.model.UserGroupRole userGroupRole) {
093                    return getService().deleteUserGroupRole(userGroupRole);
094            }
095    
096            /**
097            * Deletes the user group role with the primary key from the database. Also notifies the appropriate model listeners.
098            *
099            * @param userGroupRolePK the primary key of the user group role
100            * @return the user group role that was removed
101            * @throws PortalException if a user group role with the primary key could not be found
102            */
103            public static com.liferay.portal.model.UserGroupRole deleteUserGroupRole(
104                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
105                    throws com.liferay.portal.kernel.exception.PortalException {
106                    return getService().deleteUserGroupRole(userGroupRolePK);
107            }
108    
109            public static void deleteUserGroupRoles(long userId, long groupId,
110                    long[] roleIds) {
111                    getService().deleteUserGroupRoles(userId, groupId, roleIds);
112            }
113    
114            public static void deleteUserGroupRoles(long userId, long[] groupIds) {
115                    getService().deleteUserGroupRoles(userId, groupIds);
116            }
117    
118            public static void deleteUserGroupRoles(long[] userIds, long groupId) {
119                    getService().deleteUserGroupRoles(userIds, groupId);
120            }
121    
122            public static void deleteUserGroupRoles(long[] userIds, long groupId,
123                    long roleId) {
124                    getService().deleteUserGroupRoles(userIds, groupId, roleId);
125            }
126    
127            public static void deleteUserGroupRoles(long[] userIds, long groupId,
128                    int roleType) {
129                    getService().deleteUserGroupRoles(userIds, groupId, roleType);
130            }
131    
132            public static void deleteUserGroupRolesByGroupId(long groupId) {
133                    getService().deleteUserGroupRolesByGroupId(groupId);
134            }
135    
136            public static void deleteUserGroupRolesByRoleId(long roleId) {
137                    getService().deleteUserGroupRolesByRoleId(roleId);
138            }
139    
140            public static void deleteUserGroupRolesByUserId(long userId) {
141                    getService().deleteUserGroupRolesByUserId(userId);
142            }
143    
144            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
145                    return getService().dynamicQuery();
146            }
147    
148            /**
149            * Performs a dynamic query on the database and returns the matching rows.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the matching rows
153            */
154            public static <T> java.util.List<T> dynamicQuery(
155                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
156                    return getService().dynamicQuery(dynamicQuery);
157            }
158    
159            /**
160            * Performs a dynamic query on the database and returns a range of the matching rows.
161            *
162            * <p>
163            * 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.
164            * </p>
165            *
166            * @param dynamicQuery the dynamic query
167            * @param start the lower bound of the range of model instances
168            * @param end the upper bound of the range of model instances (not inclusive)
169            * @return the range of matching rows
170            */
171            public static <T> java.util.List<T> dynamicQuery(
172                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
173                    int end) {
174                    return getService().dynamicQuery(dynamicQuery, start, end);
175            }
176    
177            /**
178            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
179            *
180            * <p>
181            * 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.
182            * </p>
183            *
184            * @param dynamicQuery the dynamic query
185            * @param start the lower bound of the range of model instances
186            * @param end the upper bound of the range of model instances (not inclusive)
187            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
188            * @return the ordered range of matching rows
189            */
190            public static <T> java.util.List<T> dynamicQuery(
191                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
192                    int end,
193                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
194                    return getService()
195                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
196            }
197    
198            /**
199            * Returns the number of rows matching the dynamic query.
200            *
201            * @param dynamicQuery the dynamic query
202            * @return the number of rows matching the dynamic query
203            */
204            public static long dynamicQueryCount(
205                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
206                    return getService().dynamicQueryCount(dynamicQuery);
207            }
208    
209            /**
210            * Returns the number of rows matching the dynamic query.
211            *
212            * @param dynamicQuery the dynamic query
213            * @param projection the projection to apply to the query
214            * @return the number of rows matching the dynamic query
215            */
216            public static long dynamicQueryCount(
217                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
218                    com.liferay.portal.kernel.dao.orm.Projection projection) {
219                    return getService().dynamicQueryCount(dynamicQuery, projection);
220            }
221    
222            public static com.liferay.portal.model.UserGroupRole fetchUserGroupRole(
223                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK) {
224                    return getService().fetchUserGroupRole(userGroupRolePK);
225            }
226    
227            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
228                    return getService().getActionableDynamicQuery();
229            }
230    
231            /**
232            * Returns the Spring bean ID for this bean.
233            *
234            * @return the Spring bean ID for this bean
235            */
236            public static java.lang.String getBeanIdentifier() {
237                    return getService().getBeanIdentifier();
238            }
239    
240            public static com.liferay.portal.model.PersistedModel getPersistedModel(
241                    java.io.Serializable primaryKeyObj)
242                    throws com.liferay.portal.kernel.exception.PortalException {
243                    return getService().getPersistedModel(primaryKeyObj);
244            }
245    
246            /**
247            * Returns the user group role with the primary key.
248            *
249            * @param userGroupRolePK the primary key of the user group role
250            * @return the user group role
251            * @throws PortalException if a user group role with the primary key could not be found
252            */
253            public static com.liferay.portal.model.UserGroupRole getUserGroupRole(
254                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
255                    throws com.liferay.portal.kernel.exception.PortalException {
256                    return getService().getUserGroupRole(userGroupRolePK);
257            }
258    
259            /**
260            * Returns a range of all the user group roles.
261            *
262            * <p>
263            * 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.
264            * </p>
265            *
266            * @param start the lower bound of the range of user group roles
267            * @param end the upper bound of the range of user group roles (not inclusive)
268            * @return the range of user group roles
269            */
270            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
271                    int start, int end) {
272                    return getService().getUserGroupRoles(start, end);
273            }
274    
275            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
276                    long userId) {
277                    return getService().getUserGroupRoles(userId);
278            }
279    
280            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
281                    long userId, long groupId) {
282                    return getService().getUserGroupRoles(userId, groupId);
283            }
284    
285            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
286                    long userId, long groupId, int start, int end) {
287                    return getService().getUserGroupRoles(userId, groupId, start, end);
288            }
289    
290            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroup(
291                    long groupId) {
292                    return getService().getUserGroupRolesByGroup(groupId);
293            }
294    
295            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroupAndRole(
296                    long groupId, long roleId) {
297                    return getService().getUserGroupRolesByGroupAndRole(groupId, roleId);
298            }
299    
300            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByUserUserGroupAndGroup(
301                    long userId, long groupId) {
302                    return getService()
303                                       .getUserGroupRolesByUserUserGroupAndGroup(userId, groupId);
304            }
305    
306            /**
307            * Returns the number of user group roles.
308            *
309            * @return the number of user group roles
310            */
311            public static int getUserGroupRolesCount() {
312                    return getService().getUserGroupRolesCount();
313            }
314    
315            public static int getUserGroupRolesCount(long userId, long groupId) {
316                    return getService().getUserGroupRolesCount(userId, groupId);
317            }
318    
319            public static boolean hasUserGroupRole(long userId, long groupId,
320                    long roleId) {
321                    return getService().hasUserGroupRole(userId, groupId, roleId);
322            }
323    
324            public static boolean hasUserGroupRole(long userId, long groupId,
325                    long roleId, boolean inherit) {
326                    return getService().hasUserGroupRole(userId, groupId, roleId, inherit);
327            }
328    
329            public static boolean hasUserGroupRole(long userId, long groupId,
330                    java.lang.String roleName)
331                    throws com.liferay.portal.kernel.exception.PortalException {
332                    return getService().hasUserGroupRole(userId, groupId, roleName);
333            }
334    
335            public static boolean hasUserGroupRole(long userId, long groupId,
336                    java.lang.String roleName, boolean inherit)
337                    throws com.liferay.portal.kernel.exception.PortalException {
338                    return getService().hasUserGroupRole(userId, groupId, roleName, inherit);
339            }
340    
341            /**
342            * Sets the Spring bean ID for this bean.
343            *
344            * @param beanIdentifier the Spring bean ID for this bean
345            */
346            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
347                    getService().setBeanIdentifier(beanIdentifier);
348            }
349    
350            /**
351            * Updates the user group role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
352            *
353            * @param userGroupRole the user group role
354            * @return the user group role that was updated
355            */
356            public static com.liferay.portal.model.UserGroupRole updateUserGroupRole(
357                    com.liferay.portal.model.UserGroupRole userGroupRole) {
358                    return getService().updateUserGroupRole(userGroupRole);
359            }
360    
361            public static UserGroupRoleLocalService getService() {
362                    if (_service == null) {
363                            _service = (UserGroupRoleLocalService)PortalBeanLocatorUtil.locate(UserGroupRoleLocalService.class.getName());
364    
365                            ReferenceRegistry.registerReference(UserGroupRoleLocalServiceUtil.class,
366                                    "_service");
367                    }
368    
369                    return _service;
370            }
371    
372            /**
373             * @deprecated As of 6.2.0
374             */
375            @Deprecated
376            public void setService(UserGroupRoleLocalService service) {
377            }
378    
379            private static UserGroupRoleLocalService _service;
380    }