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