
com.liferay.commerce.product.service.http.CPInstanceServiceHttp 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 aQute.bnd.annotation.ProviderType;
import com.liferay.commerce.product.service.CPInstanceServiceUtil;
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
* {@link CPInstanceServiceUtil} 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.
*
*
* 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 CPInstanceServiceSoap
* @see HttpPrincipal
* @see CPInstanceServiceUtil
* @generated
*/
@ProviderType
public class CPInstanceServiceHttp {
public static com.liferay.commerce.product.model.CPInstance addCPInstance(
HttpPrincipal httpPrincipal, long cpDefinitionId, String sku,
String gtin, String manufacturerPartNumber, boolean purchasable,
String json, boolean published, int displayDateMonth,
int displayDateDay, int displayDateYear, int displayDateHour,
int displayDateMinute, int expirationDateMonth, int expirationDateDay,
int expirationDateYear, int expirationDateHour,
int expirationDateMinute, boolean neverExpire,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"addCPInstance", _addCPInstanceParameterTypes0);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpDefinitionId, sku, gtin, manufacturerPartNumber,
purchasable, json, published, displayDateMonth,
displayDateDay, displayDateYear, displayDateHour,
displayDateMinute, expirationDateMonth, expirationDateDay,
expirationDateYear, expirationDateHour,
expirationDateMinute, neverExpire, 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.commerce.product.model.CPInstance)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static void buildCPInstances(HttpPrincipal httpPrincipal,
long cpDefinitionId,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"buildCPInstances", _buildCPInstancesParameterTypes1);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpDefinitionId, serviceContext);
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 void deleteCPInstance(HttpPrincipal httpPrincipal,
long cpInstanceId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"deleteCPInstance", _deleteCPInstanceParameterTypes2);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpInstanceId);
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 com.liferay.commerce.product.model.CPInstance fetchCPInstance(
HttpPrincipal httpPrincipal, long cpInstanceId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"fetchCPInstance", _fetchCPInstanceParameterTypes3);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpInstanceId);
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.commerce.product.model.CPInstance)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static java.util.List getCPDefinitionInstances(
HttpPrincipal httpPrincipal, long cpDefinitionId, int status,
int start, int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"getCPDefinitionInstances",
_getCPDefinitionInstancesParameterTypes4);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpDefinitionId, status, start, end, orderByComparator);
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 int getCPDefinitionInstancesCount(
HttpPrincipal httpPrincipal, long cpDefinitionId, int status)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"getCPDefinitionInstancesCount",
_getCPDefinitionInstancesCountParameterTypes5);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpDefinitionId, status);
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 ((Integer)returnObj).intValue();
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.commerce.product.model.CPInstance getCPInstance(
HttpPrincipal httpPrincipal, long cpInstanceId)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"getCPInstance", _getCPInstanceParameterTypes6);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpInstanceId);
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.commerce.product.model.CPInstance)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static java.util.List getCPInstances(
HttpPrincipal httpPrincipal, long groupId, int status, int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"getCPInstances", _getCPInstancesParameterTypes7);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
status, start, end, orderByComparator);
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 int getCPInstancesCount(HttpPrincipal httpPrincipal,
long groupId, int status)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"getCPInstancesCount", _getCPInstancesCountParameterTypes8);
MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
status);
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 ((Integer)returnObj).intValue();
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.portal.kernel.search.BaseModelSearchResult searchCPDefinitionInstances(
HttpPrincipal httpPrincipal, long companyId, long groupId,
long cpDefinitionId, String keywords, int status, int start, int end,
com.liferay.portal.kernel.search.Sort sort)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"searchCPDefinitionInstances",
_searchCPDefinitionInstancesParameterTypes9);
MethodHandler methodHandler = new MethodHandler(methodKey,
companyId, groupId, cpDefinitionId, keywords, status,
start, end, sort);
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.search.BaseModelSearchResult)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.portal.kernel.search.BaseModelSearchResult searchCPInstances(
HttpPrincipal httpPrincipal, long companyId, long groupId,
String keywords, int status, int start, int end,
com.liferay.portal.kernel.search.Sort sort)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"searchCPInstances", _searchCPInstancesParameterTypes10);
MethodHandler methodHandler = new MethodHandler(methodKey,
companyId, groupId, keywords, status, start, end, sort);
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.search.BaseModelSearchResult)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.commerce.product.model.CPInstance updateCPInstance(
HttpPrincipal httpPrincipal, long cpInstanceId, String sku,
String gtin, String manufacturerPartNumber, boolean purchasable,
boolean published, int displayDateMonth, int displayDateDay,
int displayDateYear, int displayDateHour, int displayDateMinute,
int expirationDateMonth, int expirationDateDay, int expirationDateYear,
int expirationDateHour, int expirationDateMinute, boolean neverExpire,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"updateCPInstance", _updateCPInstanceParameterTypes11);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpInstanceId, sku, gtin, manufacturerPartNumber,
purchasable, published, displayDateMonth, displayDateDay,
displayDateYear, displayDateHour, displayDateMinute,
expirationDateMonth, expirationDateDay, expirationDateYear,
expirationDateHour, expirationDateMinute, neverExpire,
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.commerce.product.model.CPInstance)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.commerce.product.model.CPInstance updatePricingInfo(
HttpPrincipal httpPrincipal, long cpInstanceId,
java.math.BigDecimal price, java.math.BigDecimal promoPrice,
java.math.BigDecimal cost,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"updatePricingInfo", _updatePricingInfoParameterTypes12);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpInstanceId, price, promoPrice, cost, 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.commerce.product.model.CPInstance)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.commerce.product.model.CPInstance updateShippingInfo(
HttpPrincipal httpPrincipal, long cpInstanceId, double width,
double height, double depth, double weight,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"updateShippingInfo", _updateShippingInfoParameterTypes13);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpInstanceId, width, height, depth, weight, 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.commerce.product.model.CPInstance)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
public static com.liferay.commerce.product.model.CPInstance upsertCPInstance(
HttpPrincipal httpPrincipal, long cpDefinitionId, String sku,
String gtin, String manufacturerPartNumber, boolean purchasable,
String json, double width, double height, double depth, double weight,
java.math.BigDecimal price, java.math.BigDecimal promoPrice,
java.math.BigDecimal cost, boolean published,
String externalReferenceCode, int displayDateMonth, int displayDateDay,
int displayDateYear, int displayDateHour, int displayDateMinute,
int expirationDateMonth, int expirationDateDay, int expirationDateYear,
int expirationDateHour, int expirationDateMinute, boolean neverExpire,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {
try {
MethodKey methodKey = new MethodKey(CPInstanceServiceUtil.class,
"upsertCPInstance", _upsertCPInstanceParameterTypes14);
MethodHandler methodHandler = new MethodHandler(methodKey,
cpDefinitionId, sku, gtin, manufacturerPartNumber,
purchasable, json, width, height, depth, weight, price,
promoPrice, cost, published, externalReferenceCode,
displayDateMonth, displayDateDay, displayDateYear,
displayDateHour, displayDateMinute, expirationDateMonth,
expirationDateDay, expirationDateYear, expirationDateHour,
expirationDateMinute, neverExpire, 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.commerce.product.model.CPInstance)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException se) {
_log.error(se, se);
throw se;
}
}
private static Log _log = LogFactoryUtil.getLog(CPInstanceServiceHttp.class);
private static final Class>[] _addCPInstanceParameterTypes0 = new Class[] {
long.class, String.class, String.class, String.class, boolean.class,
String.class, boolean.class, int.class, int.class, int.class,
int.class, int.class, int.class, int.class, int.class, int.class,
int.class, boolean.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class>[] _buildCPInstancesParameterTypes1 = new Class[] {
long.class, com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class>[] _deleteCPInstanceParameterTypes2 = new Class[] {
long.class
};
private static final Class>[] _fetchCPInstanceParameterTypes3 = new Class[] {
long.class
};
private static final Class>[] _getCPDefinitionInstancesParameterTypes4 = new Class[] {
long.class, int.class, int.class, int.class,
com.liferay.portal.kernel.util.OrderByComparator.class
};
private static final Class>[] _getCPDefinitionInstancesCountParameterTypes5 =
new Class[] { long.class, int.class };
private static final Class>[] _getCPInstanceParameterTypes6 = new Class[] {
long.class
};
private static final Class>[] _getCPInstancesParameterTypes7 = new Class[] {
long.class, int.class, int.class, int.class,
com.liferay.portal.kernel.util.OrderByComparator.class
};
private static final Class>[] _getCPInstancesCountParameterTypes8 = new Class[] {
long.class, int.class
};
private static final Class>[] _searchCPDefinitionInstancesParameterTypes9 = new Class[] {
long.class, long.class, long.class, String.class, int.class,
int.class, int.class, com.liferay.portal.kernel.search.Sort.class
};
private static final Class>[] _searchCPInstancesParameterTypes10 = new Class[] {
long.class, long.class, String.class, int.class, int.class,
int.class, com.liferay.portal.kernel.search.Sort.class
};
private static final Class>[] _updateCPInstanceParameterTypes11 = new Class[] {
long.class, String.class, String.class, String.class, boolean.class,
boolean.class, int.class, int.class, int.class, int.class, int.class,
int.class, int.class, int.class, int.class, int.class, boolean.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class>[] _updatePricingInfoParameterTypes12 = new Class[] {
long.class, java.math.BigDecimal.class, java.math.BigDecimal.class,
java.math.BigDecimal.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class>[] _updateShippingInfoParameterTypes13 = new Class[] {
long.class, double.class, double.class, double.class, double.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class>[] _upsertCPInstanceParameterTypes14 = new Class[] {
long.class, String.class, String.class, String.class, boolean.class,
String.class, double.class, double.class, double.class, double.class,
java.math.BigDecimal.class, java.math.BigDecimal.class,
java.math.BigDecimal.class, boolean.class, String.class, int.class,
int.class, int.class, int.class, int.class, int.class, int.class,
int.class, int.class, int.class, boolean.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy