001    /**
002     * Copyright (c) 2000-2010 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", long.class, java.lang.String.class,
066                                            java.lang.String.class, java.lang.String.class, long.class,
067                                            java.lang.Object.class);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey,
070                                            companyId, className, tableName, columnName, classPK, data);
071    
072                            Object returnObj = null;
073    
074                            try {
075                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076                            }
077                            catch (Exception e) {
078                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
080                                    }
081    
082                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
084                                    }
085    
086                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
087                            }
088    
089                            return (com.liferay.portlet.expando.model.ExpandoValue)returnObj;
090                    }
091                    catch (com.liferay.portal.kernel.exception.SystemException se) {
092                            _log.error(se, se);
093    
094                            throw se;
095                    }
096            }
097    
098            public static com.liferay.portlet.expando.model.ExpandoValue addValue(
099                    HttpPrincipal httpPrincipal, long companyId,
100                    java.lang.String className, java.lang.String tableName,
101                    java.lang.String columnName, long classPK, java.lang.String data)
102                    throws com.liferay.portal.kernel.exception.PortalException,
103                            com.liferay.portal.kernel.exception.SystemException {
104                    try {
105                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
106                                            "addValue", long.class, java.lang.String.class,
107                                            java.lang.String.class, java.lang.String.class, long.class,
108                                            java.lang.String.class);
109    
110                            MethodHandler methodHandler = new MethodHandler(methodKey,
111                                            companyId, className, tableName, columnName, classPK, data);
112    
113                            Object returnObj = null;
114    
115                            try {
116                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
117                            }
118                            catch (Exception e) {
119                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
120                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
121                                    }
122    
123                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
124                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
125                                    }
126    
127                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
128                            }
129    
130                            return (com.liferay.portlet.expando.model.ExpandoValue)returnObj;
131                    }
132                    catch (com.liferay.portal.kernel.exception.SystemException se) {
133                            _log.error(se, se);
134    
135                            throw se;
136                    }
137            }
138    
139            public static java.io.Serializable getData(HttpPrincipal httpPrincipal,
140                    long companyId, java.lang.String className, java.lang.String tableName,
141                    java.lang.String columnName, long classPK)
142                    throws com.liferay.portal.kernel.exception.PortalException,
143                            com.liferay.portal.kernel.exception.SystemException {
144                    try {
145                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
146                                            "getData", long.class, java.lang.String.class,
147                                            java.lang.String.class, java.lang.String.class, long.class);
148    
149                            MethodHandler methodHandler = new MethodHandler(methodKey,
150                                            companyId, className, tableName, columnName, classPK);
151    
152                            Object returnObj = null;
153    
154                            try {
155                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
156                            }
157                            catch (Exception e) {
158                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
159                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
160                                    }
161    
162                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
163                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
164                                    }
165    
166                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
167                            }
168    
169                            return (java.io.Serializable)returnObj;
170                    }
171                    catch (com.liferay.portal.kernel.exception.SystemException se) {
172                            _log.error(se, se);
173    
174                            throw se;
175                    }
176            }
177    
178            public static com.liferay.portal.kernel.json.JSONObject getJSONData(
179                    HttpPrincipal httpPrincipal, long companyId,
180                    java.lang.String className, java.lang.String tableName,
181                    java.lang.String columnName, long classPK)
182                    throws com.liferay.portal.kernel.exception.PortalException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    try {
185                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
186                                            "getJSONData", long.class, java.lang.String.class,
187                                            java.lang.String.class, java.lang.String.class, long.class);
188    
189                            MethodHandler methodHandler = new MethodHandler(methodKey,
190                                            companyId, className, tableName, columnName, classPK);
191    
192                            Object returnObj = null;
193    
194                            try {
195                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
196                            }
197                            catch (Exception e) {
198                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
199                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
200                                    }
201    
202                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
203                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
204                                    }
205    
206                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
207                            }
208    
209                            return (com.liferay.portal.kernel.json.JSONObject)returnObj;
210                    }
211                    catch (com.liferay.portal.kernel.exception.SystemException se) {
212                            _log.error(se, se);
213    
214                            throw se;
215                    }
216            }
217    
218            private static Log _log = LogFactoryUtil.getLog(ExpandoValueServiceHttp.class);
219    }