
com.liferay.commerce.product.service.http.CPMeasurementUnitServiceHttp 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.commerce.product.service.http;
import com.liferay.commerce.product.service.CPMeasurementUnitServiceUtil;
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.http.TunnelUtil;
import com.liferay.portal.kernel.util.MethodHandler;
import com.liferay.portal.kernel.util.MethodKey;
/**
* Provides the HTTP utility for the
* CPMeasurementUnitServiceUtil
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 Marco Leo
* @see CPMeasurementUnitServiceSoap
* @generated
*/
public class CPMeasurementUnitServiceHttp {
public static com.liferay.commerce.product.model.CPMeasurementUnit
addCPMeasurementUnit(
HttpPrincipal httpPrincipal,
java.util.Map nameMap, String key,
double rate, boolean primary, double priority, int type,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class, "addCPMeasurementUnit",
_addCPMeasurementUnitParameterTypes0);
MethodHandler methodHandler = new MethodHandler(
methodKey, nameMap, key, rate, primary, priority, type,
serviceContext);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (com.liferay.commerce.product.model.CPMeasurementUnit)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static void deleteCPMeasurementUnit(
HttpPrincipal httpPrincipal, long cpMeasurementUnitId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class, "deleteCPMeasurementUnit",
_deleteCPMeasurementUnitParameterTypes1);
MethodHandler methodHandler = new MethodHandler(
methodKey, cpMeasurementUnitId);
try {
TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static com.liferay.commerce.product.model.CPMeasurementUnit
fetchPrimaryCPMeasurementUnit(
HttpPrincipal httpPrincipal, long companyId, int type)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class,
"fetchPrimaryCPMeasurementUnit",
_fetchPrimaryCPMeasurementUnitParameterTypes2);
MethodHandler methodHandler = new MethodHandler(
methodKey, companyId, type);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (com.liferay.commerce.product.model.CPMeasurementUnit)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static com.liferay.commerce.product.model.CPMeasurementUnit
getCPMeasurementUnit(
HttpPrincipal httpPrincipal, long cpMeasurementUnitId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class, "getCPMeasurementUnit",
_getCPMeasurementUnitParameterTypes3);
MethodHandler methodHandler = new MethodHandler(
methodKey, cpMeasurementUnitId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (com.liferay.commerce.product.model.CPMeasurementUnit)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static java.util.List
getCPMeasurementUnits(
HttpPrincipal httpPrincipal, long companyId, int type,
int start, int end,
com.liferay.portal.kernel.util.OrderByComparator
orderByComparator)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class, "getCPMeasurementUnits",
_getCPMeasurementUnitsParameterTypes4);
MethodHandler methodHandler = new MethodHandler(
methodKey, companyId, type, start, end, orderByComparator);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (java.util.List
)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static java.util.List
getCPMeasurementUnits(
HttpPrincipal httpPrincipal, long companyId, int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator
orderByComparator)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class, "getCPMeasurementUnits",
_getCPMeasurementUnitsParameterTypes5);
MethodHandler methodHandler = new MethodHandler(
methodKey, companyId, start, end, orderByComparator);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (java.util.List
)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static int getCPMeasurementUnitsCount(
HttpPrincipal httpPrincipal, long companyId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class,
"getCPMeasurementUnitsCount",
_getCPMeasurementUnitsCountParameterTypes6);
MethodHandler methodHandler = new MethodHandler(
methodKey, companyId);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return ((Integer)returnObj).intValue();
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static int getCPMeasurementUnitsCount(
HttpPrincipal httpPrincipal, long companyId, int type)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class,
"getCPMeasurementUnitsCount",
_getCPMeasurementUnitsCountParameterTypes7);
MethodHandler methodHandler = new MethodHandler(
methodKey, companyId, type);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return ((Integer)returnObj).intValue();
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static com.liferay.commerce.product.model.CPMeasurementUnit
setPrimary(
HttpPrincipal httpPrincipal, long cpMeasurementUnitId,
boolean primary)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class, "setPrimary",
_setPrimaryParameterTypes8);
MethodHandler methodHandler = new MethodHandler(
methodKey, cpMeasurementUnitId, primary);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (com.liferay.commerce.product.model.CPMeasurementUnit)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
public static com.liferay.commerce.product.model.CPMeasurementUnit
updateCPMeasurementUnit(
HttpPrincipal httpPrincipal, long cpMeasurementUnitId,
java.util.Map nameMap, String key,
double rate, boolean primary, double priority, int type,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(
CPMeasurementUnitServiceUtil.class, "updateCPMeasurementUnit",
_updateCPMeasurementUnitParameterTypes9);
MethodHandler methodHandler = new MethodHandler(
methodKey, cpMeasurementUnitId, nameMap, key, rate, primary,
priority, type, serviceContext);
Object returnObj = null;
try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {
throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}
throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}
return (com.liferay.commerce.product.model.CPMeasurementUnit)
returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {
_log.error(systemException, systemException);
throw systemException;
}
}
private static Log _log = LogFactoryUtil.getLog(
CPMeasurementUnitServiceHttp.class);
private static final Class>[] _addCPMeasurementUnitParameterTypes0 =
new Class[] {
java.util.Map.class, String.class, double.class, boolean.class,
double.class, int.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class>[] _deleteCPMeasurementUnitParameterTypes1 =
new Class[] {long.class};
private static final Class>[]
_fetchPrimaryCPMeasurementUnitParameterTypes2 = new Class[] {
long.class, int.class
};
private static final Class>[] _getCPMeasurementUnitParameterTypes3 =
new Class[] {long.class};
private static final Class>[] _getCPMeasurementUnitsParameterTypes4 =
new Class[] {
long.class, int.class, int.class, int.class,
com.liferay.portal.kernel.util.OrderByComparator.class
};
private static final Class>[] _getCPMeasurementUnitsParameterTypes5 =
new Class[] {
long.class, int.class, int.class,
com.liferay.portal.kernel.util.OrderByComparator.class
};
private static final Class>[] _getCPMeasurementUnitsCountParameterTypes6 =
new Class[] {long.class};
private static final Class>[] _getCPMeasurementUnitsCountParameterTypes7 =
new Class[] {long.class, int.class};
private static final Class>[] _setPrimaryParameterTypes8 = new Class[] {
long.class, boolean.class
};
private static final Class>[] _updateCPMeasurementUnitParameterTypes9 =
new Class[] {
long.class, java.util.Map.class, String.class, double.class,
boolean.class, double.class, int.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy