001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.util.MethodHandler;
020    import com.liferay.portal.kernel.util.MethodKey;
021    import com.liferay.portal.security.auth.HttpPrincipal;
022    import com.liferay.portal.service.http.TunnelUtil;
023    
024    import com.liferay.portlet.asset.service.AssetCategoryPropertyServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.asset.service.AssetCategoryPropertyServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
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       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.asset.service.AssetCategoryPropertyServiceUtil
054     * @generated
055     */
056    public class AssetCategoryPropertyServiceHttp {
057            public static com.liferay.portlet.asset.model.AssetCategoryProperty addCategoryProperty(
058                    HttpPrincipal httpPrincipal, long entryId, java.lang.String key,
059                    java.lang.String value)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    try {
063                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
080                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
081                                    }
082    
083                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
084                            }
085    
086                            return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
087                    }
088                    catch (com.liferay.portal.kernel.exception.SystemException se) {
089                            _log.error(se, se);
090    
091                            throw se;
092                    }
093            }
094    
095            public static void deleteCategoryProperty(HttpPrincipal httpPrincipal,
096                    long categoryPropertyId)
097                    throws com.liferay.portal.kernel.exception.PortalException,
098                            com.liferay.portal.kernel.exception.SystemException {
099                    try {
100                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
101                                            "deleteCategoryProperty",
102                                            _deleteCategoryPropertyParameterTypes1);
103    
104                            MethodHandler methodHandler = new MethodHandler(methodKey,
105                                            categoryPropertyId);
106    
107                            try {
108                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
109                            }
110                            catch (Exception e) {
111                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
113                                    }
114    
115                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
116                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
117                                    }
118    
119                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
120                            }
121                    }
122                    catch (com.liferay.portal.kernel.exception.SystemException se) {
123                            _log.error(se, se);
124    
125                            throw se;
126                    }
127            }
128    
129            public static java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryProperties(
130                    HttpPrincipal httpPrincipal, long entryId)
131                    throws com.liferay.portal.kernel.exception.SystemException {
132                    try {
133                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
134                                            "getCategoryProperties",
135                                            _getCategoryPropertiesParameterTypes2);
136    
137                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
138    
139                            Object returnObj = null;
140    
141                            try {
142                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
143                            }
144                            catch (Exception e) {
145                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
146                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
147                                    }
148    
149                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
150                            }
151    
152                            return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
153                    }
154                    catch (com.liferay.portal.kernel.exception.SystemException se) {
155                            _log.error(se, se);
156    
157                            throw se;
158                    }
159            }
160    
161            public static java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty> getCategoryPropertyValues(
162                    HttpPrincipal httpPrincipal, long companyId, java.lang.String key)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    try {
165                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
166                                            "getCategoryPropertyValues",
167                                            _getCategoryPropertyValuesParameterTypes3);
168    
169                            MethodHandler methodHandler = new MethodHandler(methodKey,
170                                            companyId, key);
171    
172                            Object returnObj = null;
173    
174                            try {
175                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
176                            }
177                            catch (Exception e) {
178                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
179                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
180                                    }
181    
182                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
183                            }
184    
185                            return (java.util.List<com.liferay.portlet.asset.model.AssetCategoryProperty>)returnObj;
186                    }
187                    catch (com.liferay.portal.kernel.exception.SystemException se) {
188                            _log.error(se, se);
189    
190                            throw se;
191                    }
192            }
193    
194            public static com.liferay.portlet.asset.model.AssetCategoryProperty updateCategoryProperty(
195                    HttpPrincipal httpPrincipal, long categoryPropertyId,
196                    java.lang.String key, java.lang.String value)
197                    throws com.liferay.portal.kernel.exception.PortalException,
198                            com.liferay.portal.kernel.exception.SystemException {
199                    try {
200                            MethodKey methodKey = new MethodKey(AssetCategoryPropertyServiceUtil.class.getName(),
201                                            "updateCategoryProperty",
202                                            _updateCategoryPropertyParameterTypes4);
203    
204                            MethodHandler methodHandler = new MethodHandler(methodKey,
205                                            categoryPropertyId, key, value);
206    
207                            Object returnObj = null;
208    
209                            try {
210                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
211                            }
212                            catch (Exception e) {
213                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
214                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
215                                    }
216    
217                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
218                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
219                                    }
220    
221                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
222                            }
223    
224                            return (com.liferay.portlet.asset.model.AssetCategoryProperty)returnObj;
225                    }
226                    catch (com.liferay.portal.kernel.exception.SystemException se) {
227                            _log.error(se, se);
228    
229                            throw se;
230                    }
231            }
232    
233            private static Log _log = LogFactoryUtil.getLog(AssetCategoryPropertyServiceHttp.class);
234            private static final Class<?>[] _addCategoryPropertyParameterTypes0 = new Class[] {
235                            long.class, java.lang.String.class, java.lang.String.class
236                    };
237            private static final Class<?>[] _deleteCategoryPropertyParameterTypes1 = new Class[] {
238                            long.class
239                    };
240            private static final Class<?>[] _getCategoryPropertiesParameterTypes2 = new Class[] {
241                            long.class
242                    };
243            private static final Class<?>[] _getCategoryPropertyValuesParameterTypes3 = new Class[] {
244                            long.class, java.lang.String.class
245                    };
246            private static final Class<?>[] _updateCategoryPropertyParameterTypes4 = new Class[] {
247                            long.class, java.lang.String.class, java.lang.String.class
248                    };
249    }