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