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            /**
236            * Returns the OSGi service identifier.
237            *
238            * @return the OSGi service identifier
239            */
240            public static java.lang.String getOSGiServiceIdentifier() {
241                    return getService().getOSGiServiceIdentifier();
242            }
243    
244            public static com.liferay.portal.model.PersistedModel getPersistedModel(
245                    java.io.Serializable primaryKeyObj)
246                    throws com.liferay.portal.kernel.exception.PortalException {
247                    return getService().getPersistedModel(primaryKeyObj);
248            }
249    
250            /**
251            * Returns the user group role with the primary key.
252            *
253            * @param userGroupRolePK the primary key of the user group role
254            * @return the user group role
255            * @throws PortalException if a user group role with the primary key could not be found
256            */
257            public static com.liferay.portal.model.UserGroupRole getUserGroupRole(
258                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
259                    throws com.liferay.portal.kernel.exception.PortalException {
260                    return getService().getUserGroupRole(userGroupRolePK);
261            }
262    
263            /**
264            * Returns a range of all the user group roles.
265            *
266            * <p>
267            * 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.
268            * </p>
269            *
270            * @param start the lower bound of the range of user group roles
271            * @param end the upper bound of the range of user group roles (not inclusive)
272            * @return the range of user group roles
273            */
274            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
275                    int start, int end) {
276                    return getService().getUserGroupRoles(start, end);
277            }
278    
279            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
280                    long userId) {
281                    return getService().getUserGroupRoles(userId);
282            }
283    
284            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
285                    long userId, long groupId) {
286                    return getService().getUserGroupRoles(userId, groupId);
287            }
288    
289            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
290                    long userId, long groupId, int start, int end) {
291                    return getService().getUserGroupRoles(userId, groupId, start, end);
292            }
293    
294            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroup(
295                    long groupId) {
296                    return getService().getUserGroupRolesByGroup(groupId);
297            }
298    
299            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroupAndRole(
300                    long groupId, long roleId) {
301                    return getService().getUserGroupRolesByGroupAndRole(groupId, roleId);
302            }
303    
304            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByUserUserGroupAndGroup(
305                    long userId, long groupId) {
306                    return getService()
307                                       .getUserGroupRolesByUserUserGroupAndGroup(userId, groupId);
308            }
309    
310            /**
311            * Returns the number of user group roles.
312            *
313            * @return the number of user group roles
314            */
315            public static int getUserGroupRolesCount() {
316                    return getService().getUserGroupRolesCount();
317            }
318    
319            public static int getUserGroupRolesCount(long userId, long groupId) {
320                    return getService().getUserGroupRolesCount(userId, groupId);
321            }
322    
323            public static boolean hasUserGroupRole(long userId, long groupId,
324                    long roleId) {
325                    return getService().hasUserGroupRole(userId, groupId, roleId);
326            }
327    
328            public static boolean hasUserGroupRole(long userId, long groupId,
329                    long roleId, boolean inherit) {
330                    return getService().hasUserGroupRole(userId, groupId, roleId, inherit);
331            }
332    
333            public static boolean hasUserGroupRole(long userId, long groupId,
334                    java.lang.String roleName)
335                    throws com.liferay.portal.kernel.exception.PortalException {
336                    return getService().hasUserGroupRole(userId, groupId, roleName);
337            }
338    
339            public static boolean hasUserGroupRole(long userId, long groupId,
340                    java.lang.String roleName, boolean inherit)
341                    throws com.liferay.portal.kernel.exception.PortalException {
342                    return getService().hasUserGroupRole(userId, groupId, roleName, inherit);
343            }
344    
345            /**
346            * Updates the user group role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
347            *
348            * @param userGroupRole the user group role
349            * @return the user group role that was updated
350            */
351            public static com.liferay.portal.model.UserGroupRole updateUserGroupRole(
352                    com.liferay.portal.model.UserGroupRole userGroupRole) {
353                    return getService().updateUserGroupRole(userGroupRole);
354            }
355    
356            public static UserGroupRoleLocalService getService() {
357                    if (_service == null) {
358                            _service = (UserGroupRoleLocalService)PortalBeanLocatorUtil.locate(UserGroupRoleLocalService.class.getName());
359    
360                            ReferenceRegistry.registerReference(UserGroupRoleLocalServiceUtil.class,
361                                    "_service");
362                    }
363    
364                    return _service;
365            }
366    
367            /**
368             * @deprecated As of 6.2.0
369             */
370            @Deprecated
371            public void setService(UserGroupRoleLocalService service) {
372            }
373    
374            private static UserGroupRoleLocalService _service;
375    }