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.expando.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.expando.service.ExpandoValueServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.expando.service.ExpandoValueServiceUtil} 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       ExpandoValueServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.expando.service.ExpandoValueServiceUtil
054     * @generated
055     */
056    public class ExpandoValueServiceHttp {
057            public static com.liferay.portlet.expando.model.ExpandoValue addValue(
058                    HttpPrincipal httpPrincipal, long companyId,
059                    java.lang.String className, java.lang.String tableName,
060                    java.lang.String columnName, long classPK, java.lang.Object data)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    try {
064                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
065                                            "addValue", _addValueParameterTypes0);
066    
067                            MethodHandler methodHandler = new MethodHandler(methodKey,
068                                            companyId, className, tableName, columnName, classPK, data);
069    
070                            Object returnObj = null;
071    
072                            try {
073                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074                            }
075                            catch (Exception e) {
076                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
078                                    }
079    
080                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
082                                    }
083    
084                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
085                            }
086    
087                            return (com.liferay.portlet.expando.model.ExpandoValue)returnObj;
088                    }
089                    catch (com.liferay.portal.kernel.exception.SystemException se) {
090                            _log.error(se, se);
091    
092                            throw se;
093                    }
094            }
095    
096            public static com.liferay.portlet.expando.model.ExpandoValue addValue(
097                    HttpPrincipal httpPrincipal, long companyId,
098                    java.lang.String className, java.lang.String tableName,
099                    java.lang.String columnName, long classPK, java.lang.String data)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    try {
103                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
104                                            "addValue", _addValueParameterTypes1);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey,
107                                            companyId, className, tableName, columnName, classPK, data);
108    
109                            Object returnObj = null;
110    
111                            try {
112                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
113                            }
114                            catch (Exception e) {
115                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
116                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
117                                    }
118    
119                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
120                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
121                                    }
122    
123                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
124                            }
125    
126                            return (com.liferay.portlet.expando.model.ExpandoValue)returnObj;
127                    }
128                    catch (com.liferay.portal.kernel.exception.SystemException se) {
129                            _log.error(se, se);
130    
131                            throw se;
132                    }
133            }
134    
135            public static void addValues(HttpPrincipal httpPrincipal, long companyId,
136                    java.lang.String className, java.lang.String tableName, long classPK,
137                    java.util.Map<java.lang.String, java.io.Serializable> attributeValues)
138                    throws com.liferay.portal.kernel.exception.PortalException,
139                            com.liferay.portal.kernel.exception.SystemException {
140                    try {
141                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
142                                            "addValues", _addValuesParameterTypes2);
143    
144                            MethodHandler methodHandler = new MethodHandler(methodKey,
145                                            companyId, className, tableName, classPK, attributeValues);
146    
147                            try {
148                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
149                            }
150                            catch (Exception e) {
151                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
152                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
153                                    }
154    
155                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
156                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
157                                    }
158    
159                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
160                            }
161                    }
162                    catch (com.liferay.portal.kernel.exception.SystemException se) {
163                            _log.error(se, se);
164    
165                            throw se;
166                    }
167            }
168    
169            public static java.util.Map<java.lang.String, java.io.Serializable> getData(
170                    HttpPrincipal httpPrincipal, long companyId,
171                    java.lang.String className, java.lang.String tableName,
172                    java.util.Collection<java.lang.String> columnNames, long classPK)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    try {
176                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
177                                            "getData", _getDataParameterTypes3);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey,
180                                            companyId, className, tableName, columnNames, classPK);
181    
182                            Object returnObj = null;
183    
184                            try {
185                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
186                            }
187                            catch (Exception e) {
188                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
189                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
190                                    }
191    
192                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
193                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
194                                    }
195    
196                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
197                            }
198    
199                            return (java.util.Map<java.lang.String, java.io.Serializable>)returnObj;
200                    }
201                    catch (com.liferay.portal.kernel.exception.SystemException se) {
202                            _log.error(se, se);
203    
204                            throw se;
205                    }
206            }
207    
208            public static java.io.Serializable getData(HttpPrincipal httpPrincipal,
209                    long companyId, java.lang.String className, java.lang.String tableName,
210                    java.lang.String columnName, long classPK)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    try {
214                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
215                                            "getData", _getDataParameterTypes4);
216    
217                            MethodHandler methodHandler = new MethodHandler(methodKey,
218                                            companyId, className, tableName, columnName, classPK);
219    
220                            Object returnObj = null;
221    
222                            try {
223                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
224                            }
225                            catch (Exception e) {
226                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
227                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
228                                    }
229    
230                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
231                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
232                                    }
233    
234                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
235                            }
236    
237                            return (java.io.Serializable)returnObj;
238                    }
239                    catch (com.liferay.portal.kernel.exception.SystemException se) {
240                            _log.error(se, se);
241    
242                            throw se;
243                    }
244            }
245    
246            public static com.liferay.portal.kernel.json.JSONObject getJSONData(
247                    HttpPrincipal httpPrincipal, long companyId,
248                    java.lang.String className, java.lang.String tableName,
249                    java.lang.String columnName, long classPK)
250                    throws com.liferay.portal.kernel.exception.PortalException,
251                            com.liferay.portal.kernel.exception.SystemException {
252                    try {
253                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
254                                            "getJSONData", _getJSONDataParameterTypes5);
255    
256                            MethodHandler methodHandler = new MethodHandler(methodKey,
257                                            companyId, className, tableName, columnName, classPK);
258    
259                            Object returnObj = null;
260    
261                            try {
262                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
263                            }
264                            catch (Exception e) {
265                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
266                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
267                                    }
268    
269                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
270                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
271                                    }
272    
273                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
274                            }
275    
276                            return (com.liferay.portal.kernel.json.JSONObject)returnObj;
277                    }
278                    catch (com.liferay.portal.kernel.exception.SystemException se) {
279                            _log.error(se, se);
280    
281                            throw se;
282                    }
283            }
284    
285            private static Log _log = LogFactoryUtil.getLog(ExpandoValueServiceHttp.class);
286            private static final Class<?>[] _addValueParameterTypes0 = new Class[] {
287                            long.class, java.lang.String.class, java.lang.String.class,
288                            java.lang.String.class, long.class, java.lang.Object.class
289                    };
290            private static final Class<?>[] _addValueParameterTypes1 = new Class[] {
291                            long.class, java.lang.String.class, java.lang.String.class,
292                            java.lang.String.class, long.class, java.lang.String.class
293                    };
294            private static final Class<?>[] _addValuesParameterTypes2 = new Class[] {
295                            long.class, java.lang.String.class, java.lang.String.class,
296                            long.class, java.util.Map.class
297                    };
298            private static final Class<?>[] _getDataParameterTypes3 = new Class[] {
299                            long.class, java.lang.String.class, java.lang.String.class,
300                            java.util.Collection.class, long.class
301                    };
302            private static final Class<?>[] _getDataParameterTypes4 = new Class[] {
303                            long.class, java.lang.String.class, java.lang.String.class,
304                            java.lang.String.class, long.class
305                    };
306            private static final Class<?>[] _getJSONDataParameterTypes5 = new Class[] {
307                            long.class, java.lang.String.class, java.lang.String.class,
308                            java.lang.String.class, long.class
309                    };
310    }