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 groupId, int roleType) {
110                    getService().deleteUserGroupRoles(groupId, roleType);
111            }
112    
113            public static void deleteUserGroupRoles(long userId, long groupId,
114                    long[] roleIds) {
115                    getService().deleteUserGroupRoles(userId, groupId, roleIds);
116            }
117    
118            public static void deleteUserGroupRoles(long userId, long[] groupIds) {
119                    getService().deleteUserGroupRoles(userId, groupIds);
120            }
121    
122            public static void deleteUserGroupRoles(long[] userIds, long groupId) {
123                    getService().deleteUserGroupRoles(userIds, groupId);
124            }
125    
126            public static void deleteUserGroupRoles(long[] userIds, long groupId,
127                    long roleId) {
128                    getService().deleteUserGroupRoles(userIds, groupId, roleId);
129            }
130    
131            public static void deleteUserGroupRoles(long[] userIds, long groupId,
132                    int roleType) {
133                    getService().deleteUserGroupRoles(userIds, groupId, roleType);
134            }
135    
136            public static void deleteUserGroupRolesByGroupId(long groupId) {
137                    getService().deleteUserGroupRolesByGroupId(groupId);
138            }
139    
140            public static void deleteUserGroupRolesByRoleId(long roleId) {
141                    getService().deleteUserGroupRolesByRoleId(roleId);
142            }
143    
144            public static void deleteUserGroupRolesByUserId(long userId) {
145                    getService().deleteUserGroupRolesByUserId(userId);
146            }
147    
148            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
149                    return getService().dynamicQuery();
150            }
151    
152            /**
153            * Performs a dynamic query on the database and returns the matching rows.
154            *
155            * @param dynamicQuery the dynamic query
156            * @return the matching rows
157            */
158            public static <T> java.util.List<T> dynamicQuery(
159                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
160                    return getService().dynamicQuery(dynamicQuery);
161            }
162    
163            /**
164            * Performs a dynamic query on the database and returns a range of the matching rows.
165            *
166            * <p>
167            * 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.
168            * </p>
169            *
170            * @param dynamicQuery the dynamic query
171            * @param start the lower bound of the range of model instances
172            * @param end the upper bound of the range of model instances (not inclusive)
173            * @return the range of matching rows
174            */
175            public static <T> java.util.List<T> dynamicQuery(
176                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
177                    int end) {
178                    return getService().dynamicQuery(dynamicQuery, start, end);
179            }
180    
181            /**
182            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
183            *
184            * <p>
185            * 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.
186            * </p>
187            *
188            * @param dynamicQuery the dynamic query
189            * @param start the lower bound of the range of model instances
190            * @param end the upper bound of the range of model instances (not inclusive)
191            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
192            * @return the ordered range of matching rows
193            */
194            public static <T> java.util.List<T> dynamicQuery(
195                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
196                    int end,
197                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
198                    return getService()
199                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
200            }
201    
202            /**
203            * Returns the number of rows matching the dynamic query.
204            *
205            * @param dynamicQuery the dynamic query
206            * @return the number of rows matching the dynamic query
207            */
208            public static long dynamicQueryCount(
209                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
210                    return getService().dynamicQueryCount(dynamicQuery);
211            }
212    
213            /**
214            * Returns the number of rows matching the dynamic query.
215            *
216            * @param dynamicQuery the dynamic query
217            * @param projection the projection to apply to the query
218            * @return the number of rows matching the dynamic query
219            */
220            public static long dynamicQueryCount(
221                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
222                    com.liferay.portal.kernel.dao.orm.Projection projection) {
223                    return getService().dynamicQueryCount(dynamicQuery, projection);
224            }
225    
226            public static com.liferay.portal.model.UserGroupRole fetchUserGroupRole(
227                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK) {
228                    return getService().fetchUserGroupRole(userGroupRolePK);
229            }
230    
231            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
232                    return getService().getActionableDynamicQuery();
233            }
234    
235            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
236                    return getService().getIndexableActionableDynamicQuery();
237            }
238    
239            /**
240            * Returns the OSGi service identifier.
241            *
242            * @return the OSGi service identifier
243            */
244            public static java.lang.String getOSGiServiceIdentifier() {
245                    return getService().getOSGiServiceIdentifier();
246            }
247    
248            public static com.liferay.portal.model.PersistedModel getPersistedModel(
249                    java.io.Serializable primaryKeyObj)
250                    throws com.liferay.portal.kernel.exception.PortalException {
251                    return getService().getPersistedModel(primaryKeyObj);
252            }
253    
254            /**
255            * Returns the user group role with the primary key.
256            *
257            * @param userGroupRolePK the primary key of the user group role
258            * @return the user group role
259            * @throws PortalException if a user group role with the primary key could not be found
260            */
261            public static com.liferay.portal.model.UserGroupRole getUserGroupRole(
262                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
263                    throws com.liferay.portal.kernel.exception.PortalException {
264                    return getService().getUserGroupRole(userGroupRolePK);
265            }
266    
267            /**
268            * Returns a range of all the user group roles.
269            *
270            * <p>
271            * 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.
272            * </p>
273            *
274            * @param start the lower bound of the range of user group roles
275            * @param end the upper bound of the range of user group roles (not inclusive)
276            * @return the range of user group roles
277            */
278            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
279                    int start, int end) {
280                    return getService().getUserGroupRoles(start, end);
281            }
282    
283            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
284                    long userId) {
285                    return getService().getUserGroupRoles(userId);
286            }
287    
288            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
289                    long userId, long groupId) {
290                    return getService().getUserGroupRoles(userId, groupId);
291            }
292    
293            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
294                    long userId, long groupId, int start, int end) {
295                    return getService().getUserGroupRoles(userId, groupId, start, end);
296            }
297    
298            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroup(
299                    long groupId) {
300                    return getService().getUserGroupRolesByGroup(groupId);
301            }
302    
303            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroupAndRole(
304                    long groupId, long roleId) {
305                    return getService().getUserGroupRolesByGroupAndRole(groupId, roleId);
306            }
307    
308            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByUserUserGroupAndGroup(
309                    long userId, long groupId) {
310                    return getService()
311                                       .getUserGroupRolesByUserUserGroupAndGroup(userId, groupId);
312            }
313    
314            /**
315            * Returns the number of user group roles.
316            *
317            * @return the number of user group roles
318            */
319            public static int getUserGroupRolesCount() {
320                    return getService().getUserGroupRolesCount();
321            }
322    
323            public static int getUserGroupRolesCount(long userId, long groupId) {
324                    return getService().getUserGroupRolesCount(userId, groupId);
325            }
326    
327            public static boolean hasUserGroupRole(long userId, long groupId,
328                    long roleId) {
329                    return getService().hasUserGroupRole(userId, groupId, roleId);
330            }
331    
332            public static boolean hasUserGroupRole(long userId, long groupId,
333                    long roleId, boolean inherit) {
334                    return getService().hasUserGroupRole(userId, groupId, roleId, inherit);
335            }
336    
337            public static boolean hasUserGroupRole(long userId, long groupId,
338                    java.lang.String roleName)
339                    throws com.liferay.portal.kernel.exception.PortalException {
340                    return getService().hasUserGroupRole(userId, groupId, roleName);
341            }
342    
343            public static boolean hasUserGroupRole(long userId, long groupId,
344                    java.lang.String roleName, boolean inherit)
345                    throws com.liferay.portal.kernel.exception.PortalException {
346                    return getService().hasUserGroupRole(userId, groupId, roleName, inherit);
347            }
348    
349            /**
350            * Updates the user group role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
351            *
352            * @param userGroupRole the user group role
353            * @return the user group role that was updated
354            */
355            public static com.liferay.portal.model.UserGroupRole updateUserGroupRole(
356                    com.liferay.portal.model.UserGroupRole userGroupRole) {
357                    return getService().updateUserGroupRole(userGroupRole);
358            }
359    
360            public static UserGroupRoleLocalService getService() {
361                    if (_service == null) {
362                            _service = (UserGroupRoleLocalService)PortalBeanLocatorUtil.locate(UserGroupRoleLocalService.class.getName());
363    
364                            ReferenceRegistry.registerReference(UserGroupRoleLocalServiceUtil.class,
365                                    "_service");
366                    }
367    
368                    return _service;
369            }
370    
371            private static UserGroupRoleLocalService _service;
372    }