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 team remote service. This utility wraps {@link com.liferay.portal.service.impl.TeamServiceImpl} 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 TeamService
030     * @see com.liferay.portal.service.base.TeamServiceBaseImpl
031     * @see com.liferay.portal.service.impl.TeamServiceImpl
032     * @generated
033     */
034    public class TeamServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.TeamServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portal.model.Team addTeam(long groupId,
041                    java.lang.String name, java.lang.String description)
042                    throws com.liferay.portal.kernel.exception.PortalException,
043                            com.liferay.portal.kernel.exception.SystemException {
044                    return getService().addTeam(groupId, name, description);
045            }
046    
047            public static void deleteTeam(long teamId)
048                    throws com.liferay.portal.kernel.exception.PortalException,
049                            com.liferay.portal.kernel.exception.SystemException {
050                    getService().deleteTeam(teamId);
051            }
052    
053            public static java.util.List<com.liferay.portal.model.Team> getGroupTeams(
054                    long groupId)
055                    throws com.liferay.portal.kernel.exception.PortalException,
056                            com.liferay.portal.kernel.exception.SystemException {
057                    return getService().getGroupTeams(groupId);
058            }
059    
060            public static com.liferay.portal.model.Team getTeam(long teamId)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    return getService().getTeam(teamId);
064            }
065    
066            public static com.liferay.portal.model.Team getTeam(long groupId,
067                    java.lang.String name)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    return getService().getTeam(groupId, name);
071            }
072    
073            public static java.util.List<com.liferay.portal.model.Team> getUserTeams(
074                    long userId)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException {
077                    return getService().getUserTeams(userId);
078            }
079    
080            public static java.util.List<com.liferay.portal.model.Team> getUserTeams(
081                    long userId, long groupId)
082                    throws com.liferay.portal.kernel.exception.PortalException,
083                            com.liferay.portal.kernel.exception.SystemException {
084                    return getService().getUserTeams(userId, groupId);
085            }
086    
087            public static boolean hasUserTeam(long userId, long teamId)
088                    throws com.liferay.portal.kernel.exception.PortalException,
089                            com.liferay.portal.kernel.exception.SystemException {
090                    return getService().hasUserTeam(userId, teamId);
091            }
092    
093            public static com.liferay.portal.model.Team updateTeam(long teamId,
094                    java.lang.String name, java.lang.String description)
095                    throws com.liferay.portal.kernel.exception.PortalException,
096                            com.liferay.portal.kernel.exception.SystemException {
097                    return getService().updateTeam(teamId, name, description);
098            }
099    
100            public static TeamService getService() {
101                    if (_service == null) {
102                            _service = (TeamService)PortalBeanLocatorUtil.locate(TeamService.class.getName());
103    
104                            ReferenceRegistry.registerReference(TeamServiceUtil.class,
105                                    "_service");
106                            MethodCache.remove(TeamService.class);
107                    }
108    
109                    return _service;
110            }
111    
112            public void setService(TeamService service) {
113                    MethodCache.remove(TeamService.class);
114    
115                    _service = service;
116    
117                    ReferenceRegistry.registerReference(TeamServiceUtil.class, "_service");
118                    MethodCache.remove(TeamService.class);
119            }
120    
121            private static TeamService _service;
122    }