001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.asset.service.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.asset.service.AssetCategoryPropertyServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link AssetCategoryPropertyServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link HttpPrincipal} parameter.
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author Brian Wing Shun Chan
051     * @see AssetCategoryPropertyServiceSoap
052     * @see HttpPrincipal
053     * @see AssetCategoryPropertyServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class AssetCategoryPropertyServiceHttp {
058            public static com.liferay.portlet.asset.model.AssetCategoryProperty addCategoryProperty(
059                    HttpPrincipal httpPrincipal, long entryId, java.lang.String key,
060                    java.lang.String value)
061                    throws com.liferay.portal.kernel.exception.PortalException {
062                    try {
063                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class,
064                                            "addCategoryProperty", _addCategoryPropertyParameterTypes0);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
067                                            key, value);
068    
069                            Object returnObj = null;
070    
071                            try {
072                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
073                            }
074                            catch (Exception e) {
075                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
076                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
077                                    }
078    
079                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
080                            }
081    
082                            return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
083                    }
084                    catch (com.liferay.portal.kernel.exception.SystemException se) {
085                            _log.error(se, se);
086    
087                            throw se;
088                    }
089            }
090    
091            public static void deleteCategoryProperty(HttpPrincipal httpPrincipal,
092                    long categoryPropertyId)
093                    throws com.liferay.portal.kernel.exception.PortalException {
094                    try {
095                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class,
096                                            "deleteCategoryProperty",
097                                            _deleteCategoryPropertyParameterTypes1);
098    
099                            MethodHandler methodHandler = new MethodHandler(methodKey,
100                                            categoryPropertyId);
101    
102                            try {
103                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
104                            }
105                            catch (Exception e) {
106                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
107                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
108                                    }
109    
110                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
111                            }
112                    }
113                    catch (com.liferay.portal.kernel.exception.SystemException se) {
114                            _log.error(se, se);
115    
116                            throw se;
117                    }
118            }
119    
120            public static java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryProperties(
121                    HttpPrincipal httpPrincipal, long entryId) {
122                    try {
123                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class,
124                                            "getCategoryProperties",
125                                            _getCategoryPropertiesParameterTypes2);
126    
127                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
128    
129                            Object returnObj = null;
130    
131                            try {
132                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
133                            }
134                            catch (Exception e) {
135                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
136                            }
137    
138                            return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
139                    }
140                    catch (com.liferay.portal.kernel.exception.SystemException se) {
141                            _log.error(se, se);
142    
143                            throw se;
144                    }
145            }
146    
147            public static java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryPropertyValues(
148                    HttpPrincipal httpPrincipal, long companyId, java.lang.String key) {
149                    try {
150                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class,
151                                            "getCategoryPropertyValues",
152                                            _getCategoryPropertyValuesParameterTypes3);
153    
154                            MethodHandler methodHandler = new MethodHandler(methodKey,
155                                            companyId, key);
156    
157                            Object returnObj = null;
158    
159                            try {
160                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
161                            }
162                            catch (Exception e) {
163                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
164                            }
165    
166                            return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
167                    }
168                    catch (com.liferay.portal.kernel.exception.SystemException se) {
169                            _log.error(se, se);
170    
171                            throw se;
172                    }
173            }
174    
175            public static com.liferay.portlet.asset.model.AssetCategoryProperty updateCategoryProperty(
176                    HttpPrincipal httpPrincipal, long userId, long categoryPropertyId,
177                    java.lang.String key, java.lang.String value)
178                    throws com.liferay.portal.kernel.exception.PortalException {
179                    try {
180                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class,
181                                            "updateCategoryProperty",
182                                            _updateCategoryPropertyParameterTypes4);
183    
184                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
185                                            categoryPropertyId, key, value);
186    
187                            Object returnObj = null;
188    
189                            try {
190                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
191                            }
192                            catch (Exception e) {
193                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
194                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
195                                    }
196    
197                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
198                            }
199    
200                            return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
201                    }
202                    catch (com.liferay.portal.kernel.exception.SystemException se) {
203                            _log.error(se, se);
204    
205                            throw se;
206                    }
207            }
208    
209            public static com.liferay.portlet.asset.model.AssetCategoryProperty updateCategoryProperty(
210                    HttpPrincipal httpPrincipal, long categoryPropertyId,
211                    java.lang.String key, java.lang.String value)
212                    throws com.liferay.portal.kernel.exception.PortalException {
213                    try {
214                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class,
215                                            "updateCategoryProperty",
216                                            _updateCategoryPropertyParameterTypes5);
217    
218                            MethodHandler methodHandler = new MethodHandler(methodKey,
219                                            categoryPropertyId, key, value);
220    
221                            Object returnObj = null;
222    
223                            try {
224                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
225                            }
226                            catch (Exception e) {
227                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
228                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
229                                    }
230    
231                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
232                            }
233    
234                            return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
235                    }
236                    catch (com.liferay.portal.kernel.exception.SystemException se) {
237                            _log.error(se, se);
238    
239                            throw se;
240                    }
241            }
242    
243            private static Log _log = LogFactoryUtil.getLog(AssetCategoryPropertyServiceHttp.class);
244            private static final Class<?>[] _addCategoryPropertyParameterTypes0 = new Class[] {
245                            long.class, java.lang.String.class, java.lang.String.class
246                    };
247            private static final Class<?>[] _deleteCategoryPropertyParameterTypes1 = new Class[] {
248                            long.class
249                    };
250            private static final Class<?>[] _getCategoryPropertiesParameterTypes2 = new Class[] {
251                            long.class
252                    };
253            private static final Class<?>[] _getCategoryPropertyValuesParameterTypes3 = new Class[] {
254                            long.class, java.lang.String.class
255                    };
256            private static final Class<?>[] _updateCategoryPropertyParameterTypes4 = new Class[] {
257                            long.class, long.class, java.lang.String.class,
258                            java.lang.String.class
259                    };
260            private static final Class<?>[] _updateCategoryPropertyParameterTypes5 = new Class[] {
261                            long.class, java.lang.String.class, java.lang.String.class
262                    };
263    }