com.liferay.portal.service.http.TeamServiceHttp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of portal-impl Show documentation
Show all versions of portal-impl Show documentation
Contains implementation for the portal services.
/**
* Copyright (c) 2000-2013 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 com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.MethodHandler;
import com.liferay.portal.kernel.util.MethodKey;
import com.liferay.portal.security.auth.HttpPrincipal;
import com.liferay.portal.service.TeamServiceUtil;
/**
* Provides the HTTP utility for the
* {@link com.liferay.portal.service.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 com.liferay.portal.security.auth.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
* @see com.liferay.portal.security.auth.HttpPrincipal
* @see com.liferay.portal.service.TeamServiceUtil
* @generated
*/
public class TeamServiceHttp {
public static com.liferay.portal.model.Team addTeam(
HttpPrincipal httpPrincipal, long groupId, java.lang.String name,
java.lang.String description)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.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,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"deleteTeam", _deleteTeamParameterTypes1);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)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,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getGroupTeams", _getGroupTeamsParameterTypes2);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)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.model.Team getTeam(
HttpPrincipal httpPrincipal, long teamId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getTeam", _getTeamParameterTypes3);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.model.Team)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.portal.model.Team getTeam(
HttpPrincipal httpPrincipal, long groupId, java.lang.String name)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getTeam", _getTeamParameterTypes4);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.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,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getUserTeams", _getUserTeamsParameterTypes5);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)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,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"getUserTeams", _getUserTeamsParameterTypes6);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)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,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"hasUserTeam", _hasUserTeamParameterTypes7);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)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 com.liferay.portal.model.Team updateTeam(
HttpPrincipal httpPrincipal, long teamId, java.lang.String name,
java.lang.String description)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException {
try {
MethodKey methodKey = new MethodKey(TeamServiceUtil.class,
"updateTeam", _updateTeamParameterTypes8);
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;
}
if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
throw (com.liferay.portal.kernel.exception.SystemException)e;
}
throw new com.liferay.portal.kernel.exception.SystemException(e);
}
return (com.liferay.portal.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[] _deleteTeamParameterTypes1 = new Class[] {
long.class
};
private static final Class[] _getGroupTeamsParameterTypes2 = new Class[] {
long.class
};
private static final Class[] _getTeamParameterTypes3 = new Class[] {
long.class
};
private static final Class[] _getTeamParameterTypes4 = new Class[] {
long.class, java.lang.String.class
};
private static final Class[] _getUserTeamsParameterTypes5 = new Class[] {
long.class
};
private static final Class[] _getUserTeamsParameterTypes6 = new Class[] {
long.class, long.class
};
private static final Class[] _hasUserTeamParameterTypes7 = new Class[] {
long.class, long.class
};
private static final Class[] _updateTeamParameterTypes8 = new Class[] {
long.class, java.lang.String.class, java.lang.String.class
};
}