/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.portal.service.http;
import aQute.bnd.annotation.ProviderType;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.security.auth.HttpPrincipal;
import com.liferay.portal.kernel.service.TeamServiceUtil;
import com.liferay.portal.kernel.service.http.TunnelUtil;
import com.liferay.portal.kernel.util.MethodHandler;
import com.liferay.portal.kernel.util.MethodKey;
/**
* Provides the HTTP utility for the
* {@link TeamServiceUtil} service utility. The
* static methods of this class calls the same methods of the service utility.
* However, the signatures are different because it requires an additional
* {@link HttpPrincipal} parameter.
*
* <p>
* The benefits of using the HTTP utility is that it is fast and allows for
* tunneling without the cost of serializing to text. The drawback is that it
* only works with Java.
* </p>
*
* <p>
* Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
* configure security.
* </p>
*
* <p>
* The HTTP utility is only generated for remote services.
* </p>
*
* @author Brian Wing Shun Chan
* @see TeamServiceSoap
* @see HttpPrincipal
* @see TeamServiceUtil
* @generated
*/
@ProviderType
public class TeamServiceHttp {
public static com.liferay.portal.kernel.model.Team addTeam(
HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
java.lang.String description)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"addTeam", _addTeamParameterTypes0);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
name, description);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.kernel.model.Team)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.portal.kernel.model.Team addTeam(
HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
java.lang.String description,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"addTeam", _addTeamParameterTypes1);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
name, description, serviceContext);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.kernel.model.Team)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static void deleteTeam(HttpPrincipal httpPrincipal, long teamId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"deleteTeam", _deleteTeamParameterTypes2);
MethodHandler methodHandler = new MethodHandler(methodKey, teamId);
try {
TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static java.util.List<com.liferay.portal.kernel.model.Team> getGroupTeams(
HttpPrincipal httpPrincipal, long groupId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getGroupTeams", _getGroupTeamsParameterTypes3);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.portal.kernel.model.Team getTeam(
HttpPrincipal httpPrincipal, long teamId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getTeam", _getTeamParameterTypes4);
MethodHandler methodHandler = new MethodHandler(methodKey, teamId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.kernel.model.Team)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.portal.kernel.model.Team getTeam(
HttpPrincipal httpPrincipal, long groupId, java.lang.String name)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getTeam", _getTeamParameterTypes5);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
name);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.kernel.model.Team)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static java.util.List<com.liferay.portal.kernel.model.Team> getUserTeams(
HttpPrincipal httpPrincipal, long userId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getUserTeams", _getUserTeamsParameterTypes6);
MethodHandler methodHandler = new MethodHandler(methodKey, userId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static java.util.List<com.liferay.portal.kernel.model.Team> getUserTeams(
HttpPrincipal httpPrincipal, long userId, long groupId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getUserTeams", _getUserTeamsParameterTypes7);
MethodHandler methodHandler = new MethodHandler(methodKey, userId,
groupId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static boolean hasUserTeam(HttpPrincipal httpPrincipal, long userId,
long teamId) throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"hasUserTeam", _hasUserTeamParameterTypes8);
MethodHandler methodHandler = new MethodHandler(methodKey, userId,
teamId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return ((Boolean)returnObj).booleanValue();
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static java.util.List<com.liferay.portal.kernel.model.Team> search(
HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
java.lang.String description,
java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
int start, int end,
com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Team> obc) {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"search", _searchParameterTypes9);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
name, description, params, start, end, obc);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (java.util.List<com.liferay.portal.kernel.model.Team>)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static int searchCount(HttpPrincipal httpPrincipal, long groupId,
java.lang.String name, java.lang.String description,
java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"searchCount", _searchCountParameterTypes10);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
name, description, params);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return ((Integer)returnObj).intValue();
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.portal.kernel.model.Team updateTeam(
HttpPrincipal httpPrincipal, long teamId, java.lang.String name,
java.lang.String description)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"updateTeam", _updateTeamParameterTypes11);
MethodHandler methodHandler = new MethodHandler(methodKey, teamId,
name, description);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception e) {
if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.kernel.model.Team)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
private static Log _log = LogFactoryUtil.getLog(TeamServiceHttp.class);
private static final Class<?>[] _addTeamParameterTypes0 = new Class[] {
long.class, java.lang.String.class, java.lang.String.class
};
private static final Class<?>[] _addTeamParameterTypes1 = new Class[] {
long.class, java.lang.String.class, java.lang.String.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class<?>[] _deleteTeamParameterTypes2 = new Class[] {
long.class
};
private static final Class<?>[] _getGroupTeamsParameterTypes3 = new Class[] {
long.class
};
private static final Class<?>[] _getTeamParameterTypes4 = new Class[] {
long.class
};
private static final Class<?>[] _getTeamParameterTypes5 = new Class[] {
long.class, java.lang.String.class
};
private static final Class<?>[] _getUserTeamsParameterTypes6 = new Class[] {
long.class
};
private static final Class<?>[] _getUserTeamsParameterTypes7 = new Class[] {
long.class, long.class
};
private static final Class<?>[] _hasUserTeamParameterTypes8 = new Class[] {
long.class, long.class
};
private static final Class<?>[] _searchParameterTypes9 = new Class[] {
long.class, java.lang.String.class, java.lang.String.class,
java.util.LinkedHashMap.class, int.class, int.class,
com.liferay.portal.kernel.util.OrderByComparator.class
};
private static final Class<?>[] _searchCountParameterTypes10 = new Class[] {
long.class, java.lang.String.class, java.lang.String.class,
java.util.LinkedHashMap.class
};
private static final Class<?>[] _updateTeamParameterTypes11 = new Class[] {
long.class, java.lang.String.class, java.lang.String.class
};
}