001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 remote service. This utility wraps {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see UserGroupService
030     * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl
031     * @see com.liferay.portal.service.impl.UserGroupServiceImpl
032     * @generated
033     */
034    public class UserGroupServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static void addGroupUserGroups(long groupId, long[] userGroupIds)
041                    throws com.liferay.portal.kernel.exception.PortalException,
042                            com.liferay.portal.kernel.exception.SystemException {
043                    getService().addGroupUserGroups(groupId, userGroupIds);
044            }
045    
046            public static void addTeamUserGroups(long teamId, long[] userGroupIds)
047                    throws com.liferay.portal.kernel.exception.PortalException,
048                            com.liferay.portal.kernel.exception.SystemException {
049                    getService().addTeamUserGroups(teamId, userGroupIds);
050            }
051    
052            public static com.liferay.portal.model.UserGroup addUserGroup(
053                    java.lang.String name, java.lang.String description)
054                    throws com.liferay.portal.kernel.exception.PortalException,
055                            com.liferay.portal.kernel.exception.SystemException {
056                    return getService().addUserGroup(name, description);
057            }
058    
059            public static void deleteUserGroup(long userGroupId)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    getService().deleteUserGroup(userGroupId);
063            }
064    
065            public static com.liferay.portal.model.UserGroup getUserGroup(
066                    long userGroupId)
067                    throws com.liferay.portal.kernel.exception.PortalException,
068                            com.liferay.portal.kernel.exception.SystemException {
069                    return getService().getUserGroup(userGroupId);
070            }
071    
072            public static com.liferay.portal.model.UserGroup getUserGroup(
073                    java.lang.String name)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException {
076                    return getService().getUserGroup(name);
077            }
078    
079            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
080                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
081                    return getService().getUserUserGroups(userId);
082            }
083    
084            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    getService().unsetGroupUserGroups(groupId, userGroupIds);
088            }
089    
090            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
091                    throws com.liferay.portal.kernel.exception.PortalException,
092                            com.liferay.portal.kernel.exception.SystemException {
093                    getService().unsetTeamUserGroups(teamId, userGroupIds);
094            }
095    
096            public static com.liferay.portal.model.UserGroup updateUserGroup(
097                    long userGroupId, java.lang.String name, java.lang.String description)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    return getService().updateUserGroup(userGroupId, name, description);
101            }
102    
103            public static UserGroupService getService() {
104                    if (_service == null) {
105                            _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName());
106    
107                            ReferenceRegistry.registerReference(UserGroupServiceUtil.class,
108                                    "_service");
109                            MethodCache.remove(UserGroupService.class);
110                    }
111    
112                    return _service;
113            }
114    
115            public void setService(UserGroupService service) {
116                    MethodCache.remove(UserGroupService.class);
117    
118                    _service = service;
119    
120                    ReferenceRegistry.registerReference(UserGroupServiceUtil.class,
121                            "_service");
122                    MethodCache.remove(UserGroupService.class);
123            }
124    
125            private static UserGroupService _service;
126    }