001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.expando.service.ExpandoColumnServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link com.liferay.portlet.expando.service.ExpandoColumnServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
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    @ProviderType
057    public class ExpandoColumnServiceHttp {
058            public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
059                    HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
060                    int type) throws com.liferay.portal.kernel.exception.PortalException {
061                    try {
062                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
063                                            "addColumn", _addColumnParameterTypes0);
064    
065                            MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
066                                            name, type);
067    
068                            Object returnObj = null;
069    
070                            try {
071                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
072                            }
073                            catch (Exception e) {
074                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
075                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
076                                    }
077    
078                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
079                            }
080    
081                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
082                    }
083                    catch (com.liferay.portal.kernel.exception.SystemException se) {
084                            _log.error(se, se);
085    
086                            throw se;
087                    }
088            }
089    
090            public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
091                    HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
092                    int type, java.lang.Object defaultData)
093                    throws com.liferay.portal.kernel.exception.PortalException {
094                    try {
095                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
096                                            "addColumn", _addColumnParameterTypes1);
097    
098                            MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
099                                            name, type, defaultData);
100    
101                            Object returnObj = null;
102    
103                            try {
104                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
105                            }
106                            catch (Exception e) {
107                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
109                                    }
110    
111                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
112                            }
113    
114                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
115                    }
116                    catch (com.liferay.portal.kernel.exception.SystemException se) {
117                            _log.error(se, se);
118    
119                            throw se;
120                    }
121            }
122    
123            public static void deleteColumn(HttpPrincipal httpPrincipal, long columnId)
124                    throws com.liferay.portal.kernel.exception.PortalException {
125                    try {
126                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
127                                            "deleteColumn", _deleteColumnParameterTypes2);
128    
129                            MethodHandler methodHandler = new MethodHandler(methodKey, columnId);
130    
131                            try {
132                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
133                            }
134                            catch (Exception e) {
135                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
136                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
137                                    }
138    
139                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
140                            }
141                    }
142                    catch (com.liferay.portal.kernel.exception.SystemException se) {
143                            _log.error(se, se);
144    
145                            throw se;
146                    }
147            }
148    
149            public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
150                    HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
151                    int type) throws com.liferay.portal.kernel.exception.PortalException {
152                    try {
153                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
154                                            "updateColumn", _updateColumnParameterTypes3);
155    
156                            MethodHandler methodHandler = new MethodHandler(methodKey,
157                                            columnId, name, type);
158    
159                            Object returnObj = null;
160    
161                            try {
162                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
163                            }
164                            catch (Exception e) {
165                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
166                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
167                                    }
168    
169                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
170                            }
171    
172                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
173                    }
174                    catch (com.liferay.portal.kernel.exception.SystemException se) {
175                            _log.error(se, se);
176    
177                            throw se;
178                    }
179            }
180    
181            public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
182                    HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
183                    int type, java.lang.Object defaultData)
184                    throws com.liferay.portal.kernel.exception.PortalException {
185                    try {
186                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
187                                            "updateColumn", _updateColumnParameterTypes4);
188    
189                            MethodHandler methodHandler = new MethodHandler(methodKey,
190                                            columnId, name, type, defaultData);
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
203                            }
204    
205                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
206                    }
207                    catch (com.liferay.portal.kernel.exception.SystemException se) {
208                            _log.error(se, se);
209    
210                            throw se;
211                    }
212            }
213    
214            public static com.liferay.portlet.expando.model.ExpandoColumn updateTypeSettings(
215                    HttpPrincipal httpPrincipal, long columnId,
216                    java.lang.String typeSettings)
217                    throws com.liferay.portal.kernel.exception.PortalException {
218                    try {
219                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class,
220                                            "updateTypeSettings", _updateTypeSettingsParameterTypes5);
221    
222                            MethodHandler methodHandler = new MethodHandler(methodKey,
223                                            columnId, typeSettings);
224    
225                            Object returnObj = null;
226    
227                            try {
228                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
229                            }
230                            catch (Exception e) {
231                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
232                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
233                                    }
234    
235                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
236                            }
237    
238                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
239                    }
240                    catch (com.liferay.portal.kernel.exception.SystemException se) {
241                            _log.error(se, se);
242    
243                            throw se;
244                    }
245            }
246    
247            private static Log _log = LogFactoryUtil.getLog(ExpandoColumnServiceHttp.class);
248            private static final Class<?>[] _addColumnParameterTypes0 = new Class[] {
249                            long.class, java.lang.String.class, int.class
250                    };
251            private static final Class<?>[] _addColumnParameterTypes1 = new Class[] {
252                            long.class, java.lang.String.class, int.class,
253                            java.lang.Object.class
254                    };
255            private static final Class<?>[] _deleteColumnParameterTypes2 = new Class[] {
256                            long.class
257                    };
258            private static final Class<?>[] _updateColumnParameterTypes3 = new Class[] {
259                            long.class, java.lang.String.class, int.class
260                    };
261            private static final Class<?>[] _updateColumnParameterTypes4 = new Class[] {
262                            long.class, java.lang.String.class, int.class,
263                            java.lang.Object.class
264                    };
265            private static final Class<?>[] _updateTypeSettingsParameterTypes5 = new Class[] {
266                            long.class, java.lang.String.class
267                    };
268    }