001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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.io.Serializable getData(HttpPrincipal httpPrincipal,
170                    long companyId, java.lang.String className, java.lang.String tableName,
171                    java.lang.String columnName, long classPK)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    try {
175                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
176                                            "getData", _getDataParameterTypes3);
177    
178                            MethodHandler methodHandler = new MethodHandler(methodKey,
179                                            companyId, className, tableName, columnName, classPK);
180    
181                            Object returnObj = null;
182    
183                            try {
184                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
185                            }
186                            catch (Exception e) {
187                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
188                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
189                                    }
190    
191                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
192                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
193                                    }
194    
195                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
196                            }
197    
198                            return (java.io.Serializable)returnObj;
199                    }
200                    catch (com.liferay.portal.kernel.exception.SystemException se) {
201                            _log.error(se, se);
202    
203                            throw se;
204                    }
205            }
206    
207            public static java.util.Map<java.lang.String, java.io.Serializable> getData(
208                    HttpPrincipal httpPrincipal, long companyId,
209                    java.lang.String className, java.lang.String tableName,
210                    java.util.Collection<java.lang.String> columnNames, 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, columnNames, 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.util.Map<java.lang.String, 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.lang.String.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.util.Collection.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    }