1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.expando.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.MethodHandler;
20  import com.liferay.portal.kernel.util.MethodKey;
21  import com.liferay.portal.security.auth.HttpPrincipal;
22  import com.liferay.portal.service.http.TunnelUtil;
23  
24  import com.liferay.portlet.expando.service.ExpandoColumnServiceUtil;
25  
26  /**
27   * <a href="ExpandoColumnServiceHttp.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides a HTTP utility for the
36   * {@link com.liferay.portlet.expando.service.ExpandoColumnServiceUtil} service utility. The
37   * static methods of this class calls the same methods of the service utility.
38   * However, the signatures are different because it requires an additional
39   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
40   * </p>
41   *
42   * <p>
43   * The benefits of using the HTTP utility is that it is fast and allows for
44   * tunneling without the cost of serializing to text. The drawback is that it
45   * only works with Java.
46   * </p>
47   *
48   * <p>
49   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
50   * configure security.
51   * </p>
52   *
53   * <p>
54   * The HTTP utility is only generated for remote services.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       ExpandoColumnServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.expando.service.ExpandoColumnServiceUtil
61   * @generated
62   */
63  public class ExpandoColumnServiceHttp {
64      public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
65          HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
66          int type)
67          throws com.liferay.portal.PortalException,
68              com.liferay.portal.SystemException {
69          try {
70              MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
71                      "addColumn", _addColumnParameterTypes0);
72  
73              MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
74                      name, type);
75  
76              Object returnObj = null;
77  
78              try {
79                  returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
80              }
81              catch (Exception e) {
82                  if (e instanceof com.liferay.portal.PortalException) {
83                      throw (com.liferay.portal.PortalException)e;
84                  }
85  
86                  if (e instanceof com.liferay.portal.SystemException) {
87                      throw (com.liferay.portal.SystemException)e;
88                  }
89  
90                  throw new com.liferay.portal.SystemException(e);
91              }
92  
93              return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
94          }
95          catch (com.liferay.portal.SystemException se) {
96              _log.error(se, se);
97  
98              throw se;
99          }
100     }
101 
102     public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
103         HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
104         int type, java.lang.Object defaultData)
105         throws com.liferay.portal.PortalException,
106             com.liferay.portal.SystemException {
107         try {
108             MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
109                     "addColumn", _addColumnParameterTypes1);
110 
111             MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
112                     name, type, defaultData);
113 
114             Object returnObj = null;
115 
116             try {
117                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
118             }
119             catch (Exception e) {
120                 if (e instanceof com.liferay.portal.PortalException) {
121                     throw (com.liferay.portal.PortalException)e;
122                 }
123 
124                 if (e instanceof com.liferay.portal.SystemException) {
125                     throw (com.liferay.portal.SystemException)e;
126                 }
127 
128                 throw new com.liferay.portal.SystemException(e);
129             }
130 
131             return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
132         }
133         catch (com.liferay.portal.SystemException se) {
134             _log.error(se, se);
135 
136             throw se;
137         }
138     }
139 
140     public static void deleteColumn(HttpPrincipal httpPrincipal, long columnId)
141         throws com.liferay.portal.PortalException,
142             com.liferay.portal.SystemException {
143         try {
144             MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
145                     "deleteColumn", _deleteColumnParameterTypes2);
146 
147             MethodHandler methodHandler = new MethodHandler(methodKey, columnId);
148 
149             try {
150                 TunnelUtil.invoke(httpPrincipal, methodHandler);
151             }
152             catch (Exception e) {
153                 if (e instanceof com.liferay.portal.PortalException) {
154                     throw (com.liferay.portal.PortalException)e;
155                 }
156 
157                 if (e instanceof com.liferay.portal.SystemException) {
158                     throw (com.liferay.portal.SystemException)e;
159                 }
160 
161                 throw new com.liferay.portal.SystemException(e);
162             }
163         }
164         catch (com.liferay.portal.SystemException se) {
165             _log.error(se, se);
166 
167             throw se;
168         }
169     }
170 
171     public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
172         HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
173         int type)
174         throws com.liferay.portal.PortalException,
175             com.liferay.portal.SystemException {
176         try {
177             MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
178                     "updateColumn", _updateColumnParameterTypes3);
179 
180             MethodHandler methodHandler = new MethodHandler(methodKey,
181                     columnId, name, type);
182 
183             Object returnObj = null;
184 
185             try {
186                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
187             }
188             catch (Exception e) {
189                 if (e instanceof com.liferay.portal.PortalException) {
190                     throw (com.liferay.portal.PortalException)e;
191                 }
192 
193                 if (e instanceof com.liferay.portal.SystemException) {
194                     throw (com.liferay.portal.SystemException)e;
195                 }
196 
197                 throw new com.liferay.portal.SystemException(e);
198             }
199 
200             return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
201         }
202         catch (com.liferay.portal.SystemException se) {
203             _log.error(se, se);
204 
205             throw se;
206         }
207     }
208 
209     public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
210         HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
211         int type, java.lang.Object defaultData)
212         throws com.liferay.portal.PortalException,
213             com.liferay.portal.SystemException {
214         try {
215             MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
216                     "updateColumn", _updateColumnParameterTypes4);
217 
218             MethodHandler methodHandler = new MethodHandler(methodKey,
219                     columnId, name, type, defaultData);
220 
221             Object returnObj = null;
222 
223             try {
224                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
225             }
226             catch (Exception e) {
227                 if (e instanceof com.liferay.portal.PortalException) {
228                     throw (com.liferay.portal.PortalException)e;
229                 }
230 
231                 if (e instanceof com.liferay.portal.SystemException) {
232                     throw (com.liferay.portal.SystemException)e;
233                 }
234 
235                 throw new com.liferay.portal.SystemException(e);
236             }
237 
238             return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
239         }
240         catch (com.liferay.portal.SystemException se) {
241             _log.error(se, se);
242 
243             throw se;
244         }
245     }
246 
247     public static com.liferay.portlet.expando.model.ExpandoColumn updateTypeSettings(
248         HttpPrincipal httpPrincipal, long columnId,
249         java.lang.String typeSettings)
250         throws com.liferay.portal.PortalException,
251             com.liferay.portal.SystemException {
252         try {
253             MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
254                     "updateTypeSettings", _updateTypeSettingsParameterTypes5);
255 
256             MethodHandler methodHandler = new MethodHandler(methodKey,
257                     columnId, typeSettings);
258 
259             Object returnObj = null;
260 
261             try {
262                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
263             }
264             catch (Exception e) {
265                 if (e instanceof com.liferay.portal.PortalException) {
266                     throw (com.liferay.portal.PortalException)e;
267                 }
268 
269                 if (e instanceof com.liferay.portal.SystemException) {
270                     throw (com.liferay.portal.SystemException)e;
271                 }
272 
273                 throw new com.liferay.portal.SystemException(e);
274             }
275 
276             return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
277         }
278         catch (com.liferay.portal.SystemException se) {
279             _log.error(se, se);
280 
281             throw se;
282         }
283     }
284 
285     private static Log _log = LogFactoryUtil.getLog(ExpandoColumnServiceHttp.class);
286     private static final Class<?>[] _addColumnParameterTypes0 = new Class[] {
287             long.class, java.lang.String.class, int.class
288         };
289     private static final Class<?>[] _addColumnParameterTypes1 = new Class[] {
290             long.class, java.lang.String.class, int.class,
291             java.lang.Object.class
292         };
293     private static final Class<?>[] _deleteColumnParameterTypes2 = new Class[] {
294             long.class
295         };
296     private static final Class<?>[] _updateColumnParameterTypes3 = new Class[] {
297             long.class, java.lang.String.class, int.class
298         };
299     private static final Class<?>[] _updateColumnParameterTypes4 = new Class[] {
300             long.class, java.lang.String.class, int.class,
301             java.lang.Object.class
302         };
303     private static final Class<?>[] _updateTypeSettingsParameterTypes5 = new Class[] {
304             long.class, java.lang.String.class
305         };
306 }