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.ExpandoColumnServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.expando.service.ExpandoColumnServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author Brian Wing Shun Chan
049     * @see ExpandoColumnServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.expando.service.ExpandoColumnServiceUtil
052     * @generated
053     */
054    public class ExpandoColumnServiceHttp {
055            public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
056                    HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
057                    int type)
058                    throws com.liferay.portal.kernel.exception.PortalException,
059                            com.liferay.portal.kernel.exception.SystemException {
060                    try {
061                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
062                                            "addColumn", _addColumnParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
065                                            name, type);
066    
067                            Object returnObj = null;
068    
069                            try {
070                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
071                            }
072                            catch (Exception e) {
073                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
074                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
075                                    }
076    
077                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
078                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
079                                    }
080    
081                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
082                            }
083    
084                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
085                    }
086                    catch (com.liferay.portal.kernel.exception.SystemException se) {
087                            _log.error(se, se);
088    
089                            throw se;
090                    }
091            }
092    
093            public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
094                    HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
095                    int type, java.lang.Object defaultData)
096                    throws com.liferay.portal.kernel.exception.PortalException,
097                            com.liferay.portal.kernel.exception.SystemException {
098                    try {
099                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
100                                            "addColumn", _addColumnParameterTypes1);
101    
102                            MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
103                                            name, type, defaultData);
104    
105                            Object returnObj = null;
106    
107                            try {
108                                    returnObj = 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                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
123                    }
124                    catch (com.liferay.portal.kernel.exception.SystemException se) {
125                            _log.error(se, se);
126    
127                            throw se;
128                    }
129            }
130    
131            public static void deleteColumn(HttpPrincipal httpPrincipal, long columnId)
132                    throws com.liferay.portal.kernel.exception.PortalException,
133                            com.liferay.portal.kernel.exception.SystemException {
134                    try {
135                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
136                                            "deleteColumn", _deleteColumnParameterTypes2);
137    
138                            MethodHandler methodHandler = new MethodHandler(methodKey, columnId);
139    
140                            try {
141                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
142                            }
143                            catch (Exception e) {
144                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
145                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
146                                    }
147    
148                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
149                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
150                                    }
151    
152                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
153                            }
154                    }
155                    catch (com.liferay.portal.kernel.exception.SystemException se) {
156                            _log.error(se, se);
157    
158                            throw se;
159                    }
160            }
161    
162            public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
163                    HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
164                    int type)
165                    throws com.liferay.portal.kernel.exception.PortalException,
166                            com.liferay.portal.kernel.exception.SystemException {
167                    try {
168                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
169                                            "updateColumn", _updateColumnParameterTypes3);
170    
171                            MethodHandler methodHandler = new MethodHandler(methodKey,
172                                            columnId, name, type);
173    
174                            Object returnObj = null;
175    
176                            try {
177                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
178                            }
179                            catch (Exception e) {
180                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
181                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
182                                    }
183    
184                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
185                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
186                                    }
187    
188                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
189                            }
190    
191                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
192                    }
193                    catch (com.liferay.portal.kernel.exception.SystemException se) {
194                            _log.error(se, se);
195    
196                            throw se;
197                    }
198            }
199    
200            public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
201                    HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
202                    int type, java.lang.Object defaultData)
203                    throws com.liferay.portal.kernel.exception.PortalException,
204                            com.liferay.portal.kernel.exception.SystemException {
205                    try {
206                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
207                                            "updateColumn", _updateColumnParameterTypes4);
208    
209                            MethodHandler methodHandler = new MethodHandler(methodKey,
210                                            columnId, name, type, defaultData);
211    
212                            Object returnObj = null;
213    
214                            try {
215                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
216                            }
217                            catch (Exception e) {
218                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
219                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
220                                    }
221    
222                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
223                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
224                                    }
225    
226                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
227                            }
228    
229                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
230                    }
231                    catch (com.liferay.portal.kernel.exception.SystemException se) {
232                            _log.error(se, se);
233    
234                            throw se;
235                    }
236            }
237    
238            public static com.liferay.portlet.expando.model.ExpandoColumn updateTypeSettings(
239                    HttpPrincipal httpPrincipal, long columnId,
240                    java.lang.String typeSettings)
241                    throws com.liferay.portal.kernel.exception.PortalException,
242                            com.liferay.portal.kernel.exception.SystemException {
243                    try {
244                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
245                                            "updateTypeSettings", _updateTypeSettingsParameterTypes5);
246    
247                            MethodHandler methodHandler = new MethodHandler(methodKey,
248                                            columnId, typeSettings);
249    
250                            Object returnObj = null;
251    
252                            try {
253                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
254                            }
255                            catch (Exception e) {
256                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
257                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
258                                    }
259    
260                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
261                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
262                                    }
263    
264                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
265                            }
266    
267                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
268                    }
269                    catch (com.liferay.portal.kernel.exception.SystemException se) {
270                            _log.error(se, se);
271    
272                            throw se;
273                    }
274            }
275    
276            private static Log _log = LogFactoryUtil.getLog(ExpandoColumnServiceHttp.class);
277            private static final Class<?>[] _addColumnParameterTypes0 = new Class[] {
278                            long.class, java.lang.String.class, int.class
279                    };
280            private static final Class<?>[] _addColumnParameterTypes1 = new Class[] {
281                            long.class, java.lang.String.class, int.class,
282                            java.lang.Object.class
283                    };
284            private static final Class<?>[] _deleteColumnParameterTypes2 = new Class[] {
285                            long.class
286                    };
287            private static final Class<?>[] _updateColumnParameterTypes3 = new Class[] {
288                            long.class, java.lang.String.class, int.class
289                    };
290            private static final Class<?>[] _updateColumnParameterTypes4 = new Class[] {
291                            long.class, java.lang.String.class, int.class,
292                            java.lang.Object.class
293                    };
294            private static final Class<?>[] _updateTypeSettingsParameterTypes5 = new Class[] {
295                            long.class, java.lang.String.class
296                    };
297    }