001    /**
002     * Copyright (c) 2000-2012 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            public static com.liferay.portal.model.UserGroupRole fetchUserGroupRole(
163                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
164                    throws com.liferay.portal.kernel.exception.SystemException {
165                    return getService().fetchUserGroupRole(userGroupRolePK);
166            }
167    
168            /**
169            * Returns the user group role with the primary key.
170            *
171            * @param userGroupRolePK the primary key of the user group role
172            * @return the user group role
173            * @throws PortalException if a user group role with the primary key could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portal.model.UserGroupRole getUserGroupRole(
177                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    return getService().getUserGroupRole(userGroupRolePK);
181            }
182    
183            public static com.liferay.portal.model.PersistedModel getPersistedModel(
184                    java.io.Serializable primaryKeyObj)
185                    throws com.liferay.portal.kernel.exception.PortalException,
186                            com.liferay.portal.kernel.exception.SystemException {
187                    return getService().getPersistedModel(primaryKeyObj);
188            }
189    
190            /**
191            * Returns a range of all the user group roles.
192            *
193            * <p>
194            * 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.
195            * </p>
196            *
197            * @param start the lower bound of the range of user group roles
198            * @param end the upper bound of the range of user group roles (not inclusive)
199            * @return the range of user group roles
200            * @throws SystemException if a system exception occurred
201            */
202            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
203                    int start, int end)
204                    throws com.liferay.portal.kernel.exception.SystemException {
205                    return getService().getUserGroupRoles(start, end);
206            }
207    
208            /**
209            * Returns the number of user group roles.
210            *
211            * @return the number of user group roles
212            * @throws SystemException if a system exception occurred
213            */
214            public static int getUserGroupRolesCount()
215                    throws com.liferay.portal.kernel.exception.SystemException {
216                    return getService().getUserGroupRolesCount();
217            }
218    
219            /**
220            * Updates the user group role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
221            *
222            * @param userGroupRole the user group role
223            * @return the user group role that was updated
224            * @throws SystemException if a system exception occurred
225            */
226            public static com.liferay.portal.model.UserGroupRole updateUserGroupRole(
227                    com.liferay.portal.model.UserGroupRole userGroupRole)
228                    throws com.liferay.portal.kernel.exception.SystemException {
229                    return getService().updateUserGroupRole(userGroupRole);
230            }
231    
232            /**
233            * Updates the user group role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
234            *
235            * @param userGroupRole the user group role
236            * @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.
237            * @return the user group role that was updated
238            * @throws SystemException if a system exception occurred
239            */
240            public static com.liferay.portal.model.UserGroupRole updateUserGroupRole(
241                    com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getService().updateUserGroupRole(userGroupRole, merge);
244            }
245    
246            /**
247            * Returns the Spring bean ID for this bean.
248            *
249            * @return the Spring bean ID for this bean
250            */
251            public static java.lang.String getBeanIdentifier() {
252                    return getService().getBeanIdentifier();
253            }
254    
255            /**
256            * Sets the Spring bean ID for this bean.
257            *
258            * @param beanIdentifier the Spring bean ID for this bean
259            */
260            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
261                    getService().setBeanIdentifier(beanIdentifier);
262            }
263    
264            public static void addUserGroupRoles(long userId, long groupId,
265                    long[] roleIds)
266                    throws com.liferay.portal.kernel.exception.PortalException,
267                            com.liferay.portal.kernel.exception.SystemException {
268                    getService().addUserGroupRoles(userId, groupId, roleIds);
269            }
270    
271            public static void addUserGroupRoles(long[] userIds, long groupId,
272                    long roleId)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException {
275                    getService().addUserGroupRoles(userIds, groupId, roleId);
276            }
277    
278            public static void deleteUserGroupRoles(long userId, long groupId,
279                    long[] roleIds)
280                    throws com.liferay.portal.kernel.exception.SystemException {
281                    getService().deleteUserGroupRoles(userId, groupId, roleIds);
282            }
283    
284            public static void deleteUserGroupRoles(long userId, long[] groupIds)
285                    throws com.liferay.portal.kernel.exception.SystemException {
286                    getService().deleteUserGroupRoles(userId, groupIds);
287            }
288    
289            public static void deleteUserGroupRoles(long[] userIds, long groupId)
290                    throws com.liferay.portal.kernel.exception.SystemException {
291                    getService().deleteUserGroupRoles(userIds, groupId);
292            }
293    
294            public static void deleteUserGroupRoles(long[] userIds, long groupId,
295                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
296                    getService().deleteUserGroupRoles(userIds, groupId, roleId);
297            }
298    
299            public static void deleteUserGroupRolesByGroupId(long groupId)
300                    throws com.liferay.portal.kernel.exception.SystemException {
301                    getService().deleteUserGroupRolesByGroupId(groupId);
302            }
303    
304            public static void deleteUserGroupRolesByRoleId(long roleId)
305                    throws com.liferay.portal.kernel.exception.SystemException {
306                    getService().deleteUserGroupRolesByRoleId(roleId);
307            }
308    
309            public static void deleteUserGroupRolesByUserId(long userId)
310                    throws com.liferay.portal.kernel.exception.SystemException {
311                    getService().deleteUserGroupRolesByUserId(userId);
312            }
313    
314            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
315                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
316                    return getService().getUserGroupRoles(userId);
317            }
318    
319            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
320                    long userId, long groupId)
321                    throws com.liferay.portal.kernel.exception.SystemException {
322                    return getService().getUserGroupRoles(userId, groupId);
323            }
324    
325            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroupAndRole(
326                    long groupId, long roleId)
327                    throws com.liferay.portal.kernel.exception.SystemException {
328                    return getService().getUserGroupRolesByGroupAndRole(groupId, roleId);
329            }
330    
331            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByUserUserGroupAndGroup(
332                    long userId, long groupId)
333                    throws com.liferay.portal.kernel.exception.SystemException {
334                    return getService()
335                                       .getUserGroupRolesByUserUserGroupAndGroup(userId, groupId);
336            }
337    
338            public static boolean hasUserGroupRole(long userId, long groupId,
339                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
340                    return getService().hasUserGroupRole(userId, groupId, roleId);
341            }
342    
343            public static boolean hasUserGroupRole(long userId, long groupId,
344                    long roleId, boolean inherit)
345                    throws com.liferay.portal.kernel.exception.SystemException {
346                    return getService().hasUserGroupRole(userId, groupId, roleId, inherit);
347            }
348    
349            public static boolean hasUserGroupRole(long userId, long groupId,
350                    java.lang.String roleName)
351                    throws com.liferay.portal.kernel.exception.PortalException,
352                            com.liferay.portal.kernel.exception.SystemException {
353                    return getService().hasUserGroupRole(userId, groupId, roleName);
354            }
355    
356            public static boolean hasUserGroupRole(long userId, long groupId,
357                    java.lang.String roleName, boolean inherit)
358                    throws com.liferay.portal.kernel.exception.PortalException,
359                            com.liferay.portal.kernel.exception.SystemException {
360                    return getService().hasUserGroupRole(userId, groupId, roleName, inherit);
361            }
362    
363            public static UserGroupRoleLocalService getService() {
364                    if (_service == null) {
365                            _service = (UserGroupRoleLocalService)PortalBeanLocatorUtil.locate(UserGroupRoleLocalService.class.getName());
366    
367                            ReferenceRegistry.registerReference(UserGroupRoleLocalServiceUtil.class,
368                                    "_service");
369                            MethodCache.remove(UserGroupRoleLocalService.class);
370                    }
371    
372                    return _service;
373            }
374    
375            public void setService(UserGroupRoleLocalService service) {
376                    MethodCache.remove(UserGroupRoleLocalService.class);
377    
378                    _service = service;
379    
380                    ReferenceRegistry.registerReference(UserGroupRoleLocalServiceUtil.class,
381                            "_service");
382                    MethodCache.remove(UserGroupRoleLocalService.class);
383            }
384    
385            private static UserGroupRoleLocalService _service;
386    }