com.liferay.portal.service.http.TeamServiceHttp Maven / Gradle / Ivy
/**
* 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
* 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
* HttpPrincipal
parameter.
*
*
* 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.
*
*
*
* Set the property tunnel.servlet.hosts.allowed in portal.properties to
* configure security.
*
*
*
* The HTTP utility is only generated for remote services.
*
*
* @author Brian Wing Shun Chan
* @see TeamServiceSoap
* @generated
*/
@ProviderType
public class TeamServiceHttp {
public static com.liferay.portal.kernel.model.Team addTeam(
HttpPrincipal httpPrincipal, long groupId, String name,
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, String name,
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
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)
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, 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
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)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static java.util.List
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)
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 search(
HttpPrincipal httpPrincipal, long groupId, String name,
String description, java.util.LinkedHashMap params,
int start, int end,
com.liferay.portal.kernel.util.OrderByComparator
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)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static int searchCount(
HttpPrincipal httpPrincipal, long groupId, String name,
String description, java.util.LinkedHashMap 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, String name,
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, String.class, String.class
};
private static final Class[] _addTeamParameterTypes1 = new Class[] {
long.class, String.class, 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, 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, String.class, 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, String.class, String.class, java.util.LinkedHashMap.class
};
private static final Class[] _updateTeamParameterTypes11 = new Class[] {
long.class, String.class, String.class
};
}