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