001    /**
002     * Copyright (c) 2000-2010 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 java.io.Serializable getData(HttpPrincipal httpPrincipal,
136                    long companyId, java.lang.String className, java.lang.String tableName,
137                    java.lang.String columnName, long classPK)
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                                            "getData", _getDataParameterTypes2);
143    
144                            MethodHandler methodHandler = new MethodHandler(methodKey,
145                                            companyId, className, tableName, columnName, classPK);
146    
147                            Object returnObj = null;
148    
149                            try {
150                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
151                            }
152                            catch (Exception e) {
153                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
154                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
155                                    }
156    
157                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
158                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
159                                    }
160    
161                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
162                            }
163    
164                            return (java.io.Serializable)returnObj;
165                    }
166                    catch (com.liferay.portal.kernel.exception.SystemException se) {
167                            _log.error(se, se);
168    
169                            throw se;
170                    }
171            }
172    
173            public static com.liferay.portal.kernel.json.JSONObject getJSONData(
174                    HttpPrincipal httpPrincipal, long companyId,
175                    java.lang.String className, java.lang.String tableName,
176                    java.lang.String columnName, long classPK)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    try {
180                            MethodKey methodKey = new MethodKey(ExpandoValueServiceUtil.class.getName(),
181                                            "getJSONData", _getJSONDataParameterTypes3);
182    
183                            MethodHandler methodHandler = new MethodHandler(methodKey,
184                                            companyId, className, tableName, columnName, classPK);
185    
186                            Object returnObj = null;
187    
188                            try {
189                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
190                            }
191                            catch (Exception e) {
192                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
193                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
194                                    }
195    
196                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
197                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
198                                    }
199    
200                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
201                            }
202    
203                            return (com.liferay.portal.kernel.json.JSONObject)returnObj;
204                    }
205                    catch (com.liferay.portal.kernel.exception.SystemException se) {
206                            _log.error(se, se);
207    
208                            throw se;
209                    }
210            }
211    
212            private static Log _log = LogFactoryUtil.getLog(ExpandoValueServiceHttp.class);
213            private static final Class<?>[] _addValueParameterTypes0 = new Class[] {
214                            long.class, java.lang.String.class, java.lang.String.class,
215                            java.lang.String.class, long.class, java.lang.Object.class
216                    };
217            private static final Class<?>[] _addValueParameterTypes1 = new Class[] {
218                            long.class, java.lang.String.class, java.lang.String.class,
219                            java.lang.String.class, long.class, java.lang.String.class
220                    };
221            private static final Class<?>[] _getDataParameterTypes2 = new Class[] {
222                            long.class, java.lang.String.class, java.lang.String.class,
223                            java.lang.String.class, long.class
224                    };
225            private static final Class<?>[] _getJSONDataParameterTypes3 = new Class[] {
226                            long.class, java.lang.String.class, java.lang.String.class,
227                            java.lang.String.class, long.class
228                    };
229    }