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.dynamicdatalists.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.dynamicdatalists.service.DDLRecordSetServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil} 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       DDLRecordSetServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil
054     * @generated
055     */
056    public class DDLRecordSetServiceHttp {
057            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet addRecordSet(
058                    HttpPrincipal httpPrincipal, long groupId, long ddmStructureId,
059                    java.lang.String recordSetKey,
060                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
061                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
062                    int minDisplayRows, int scope,
063                    com.liferay.portal.service.ServiceContext serviceContext)
064                    throws com.liferay.portal.kernel.exception.PortalException,
065                            com.liferay.portal.kernel.exception.SystemException {
066                    try {
067                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class.getName(),
068                                            "addRecordSet", _addRecordSetParameterTypes0);
069    
070                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
071                                            ddmStructureId, recordSetKey, nameMap, descriptionMap,
072                                            minDisplayRows, scope, serviceContext);
073    
074                            Object returnObj = null;
075    
076                            try {
077                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
078                            }
079                            catch (Exception e) {
080                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
081                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
082                                    }
083    
084                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
085                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
086                                    }
087    
088                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
089                            }
090    
091                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
092                    }
093                    catch (com.liferay.portal.kernel.exception.SystemException se) {
094                            _log.error(se, se);
095    
096                            throw se;
097                    }
098            }
099    
100            public static void deleteRecordSet(HttpPrincipal httpPrincipal,
101                    long recordSetId)
102                    throws com.liferay.portal.kernel.exception.PortalException,
103                            com.liferay.portal.kernel.exception.SystemException {
104                    try {
105                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class.getName(),
106                                            "deleteRecordSet", _deleteRecordSetParameterTypes1);
107    
108                            MethodHandler methodHandler = new MethodHandler(methodKey,
109                                            recordSetId);
110    
111                            try {
112                                    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                    catch (com.liferay.portal.kernel.exception.SystemException se) {
127                            _log.error(se, se);
128    
129                            throw se;
130                    }
131            }
132    
133            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet getRecordSet(
134                    HttpPrincipal httpPrincipal, long recordSetId)
135                    throws com.liferay.portal.kernel.exception.PortalException,
136                            com.liferay.portal.kernel.exception.SystemException {
137                    try {
138                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class.getName(),
139                                            "getRecordSet", _getRecordSetParameterTypes2);
140    
141                            MethodHandler methodHandler = new MethodHandler(methodKey,
142                                            recordSetId);
143    
144                            Object returnObj = null;
145    
146                            try {
147                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
148                            }
149                            catch (Exception e) {
150                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
151                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
152                                    }
153    
154                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
155                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
156                                    }
157    
158                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
159                            }
160    
161                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
162                    }
163                    catch (com.liferay.portal.kernel.exception.SystemException se) {
164                            _log.error(se, se);
165    
166                            throw se;
167                    }
168            }
169    
170            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet updateMinDisplayRows(
171                    HttpPrincipal httpPrincipal, long recordSetId, int minDisplayRows,
172                    com.liferay.portal.service.ServiceContext serviceContext)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    try {
176                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class.getName(),
177                                            "updateMinDisplayRows", _updateMinDisplayRowsParameterTypes3);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey,
180                                            recordSetId, minDisplayRows, serviceContext);
181    
182                            Object returnObj = null;
183    
184                            try {
185                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
186                            }
187                            catch (Exception e) {
188                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
189                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
190                                    }
191    
192                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
193                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
194                                    }
195    
196                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
197                            }
198    
199                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
200                    }
201                    catch (com.liferay.portal.kernel.exception.SystemException se) {
202                            _log.error(se, se);
203    
204                            throw se;
205                    }
206            }
207    
208            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet updateRecordSet(
209                    HttpPrincipal httpPrincipal, long recordSetId, long ddmStructureId,
210                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
211                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
212                    int minDisplayRows,
213                    com.liferay.portal.service.ServiceContext serviceContext)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    try {
217                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class.getName(),
218                                            "updateRecordSet", _updateRecordSetParameterTypes4);
219    
220                            MethodHandler methodHandler = new MethodHandler(methodKey,
221                                            recordSetId, ddmStructureId, nameMap, descriptionMap,
222                                            minDisplayRows, serviceContext);
223    
224                            Object returnObj = null;
225    
226                            try {
227                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
228                            }
229                            catch (Exception e) {
230                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
231                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
232                                    }
233    
234                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
235                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
236                                    }
237    
238                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
239                            }
240    
241                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
242                    }
243                    catch (com.liferay.portal.kernel.exception.SystemException se) {
244                            _log.error(se, se);
245    
246                            throw se;
247                    }
248            }
249    
250            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet updateRecordSet(
251                    HttpPrincipal httpPrincipal, long groupId, long ddmStructureId,
252                    java.lang.String recordSetKey,
253                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
254                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
255                    int minDisplayRows,
256                    com.liferay.portal.service.ServiceContext serviceContext)
257                    throws com.liferay.portal.kernel.exception.PortalException,
258                            com.liferay.portal.kernel.exception.SystemException {
259                    try {
260                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class.getName(),
261                                            "updateRecordSet", _updateRecordSetParameterTypes5);
262    
263                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
264                                            ddmStructureId, recordSetKey, nameMap, descriptionMap,
265                                            minDisplayRows, serviceContext);
266    
267                            Object returnObj = null;
268    
269                            try {
270                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
271                            }
272                            catch (Exception e) {
273                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
274                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
275                                    }
276    
277                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
278                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
279                                    }
280    
281                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
282                            }
283    
284                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
285                    }
286                    catch (com.liferay.portal.kernel.exception.SystemException se) {
287                            _log.error(se, se);
288    
289                            throw se;
290                    }
291            }
292    
293            private static Log _log = LogFactoryUtil.getLog(DDLRecordSetServiceHttp.class);
294            private static final Class<?>[] _addRecordSetParameterTypes0 = new Class[] {
295                            long.class, long.class, java.lang.String.class, java.util.Map.class,
296                            java.util.Map.class, int.class, int.class,
297                            com.liferay.portal.service.ServiceContext.class
298                    };
299            private static final Class<?>[] _deleteRecordSetParameterTypes1 = new Class[] {
300                            long.class
301                    };
302            private static final Class<?>[] _getRecordSetParameterTypes2 = new Class[] {
303                            long.class
304                    };
305            private static final Class<?>[] _updateMinDisplayRowsParameterTypes3 = new Class[] {
306                            long.class, int.class,
307                            com.liferay.portal.service.ServiceContext.class
308                    };
309            private static final Class<?>[] _updateRecordSetParameterTypes4 = new Class[] {
310                            long.class, long.class, java.util.Map.class, java.util.Map.class,
311                            int.class, com.liferay.portal.service.ServiceContext.class
312                    };
313            private static final Class<?>[] _updateRecordSetParameterTypes5 = new Class[] {
314                            long.class, long.class, java.lang.String.class, java.util.Map.class,
315                            java.util.Map.class, int.class,
316                            com.liferay.portal.service.ServiceContext.class
317                    };
318    }