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.journal.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.journal.service.JournalFeedServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.journal.service.JournalFeedServiceUtil} 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 JournalFeedServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.journal.service.JournalFeedServiceUtil
052     * @generated
053     */
054    public class JournalFeedServiceHttp {
055            public static com.liferay.portlet.journal.model.JournalFeed addFeed(
056                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
057                    boolean autoFeedId, java.lang.String name,
058                    java.lang.String description, java.lang.String type,
059                    java.lang.String structureId, java.lang.String templateId,
060                    java.lang.String rendererTemplateId, int delta,
061                    java.lang.String orderByCol, java.lang.String orderByType,
062                    java.lang.String targetLayoutFriendlyUrl,
063                    java.lang.String targetPortletId, java.lang.String contentField,
064                    java.lang.String feedType, double feedVersion,
065                    com.liferay.portal.service.ServiceContext serviceContext)
066                    throws com.liferay.portal.kernel.exception.PortalException,
067                            com.liferay.portal.kernel.exception.SystemException {
068                    try {
069                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
070                                            "addFeed", _addFeedParameterTypes0);
071    
072                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
073                                            feedId, autoFeedId, name, description, type, structureId,
074                                            templateId, rendererTemplateId, delta, orderByCol,
075                                            orderByType, targetLayoutFriendlyUrl, targetPortletId,
076                                            contentField, feedType, feedVersion, serviceContext);
077    
078                            Object returnObj = null;
079    
080                            try {
081                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
082                            }
083                            catch (Exception e) {
084                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
085                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
086                                    }
087    
088                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
089                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
090                                    }
091    
092                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
093                            }
094    
095                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
096                    }
097                    catch (com.liferay.portal.kernel.exception.SystemException se) {
098                            _log.error(se, se);
099    
100                            throw se;
101                    }
102            }
103    
104            public static void deleteFeed(HttpPrincipal httpPrincipal, long feedId)
105                    throws com.liferay.portal.kernel.exception.PortalException,
106                            com.liferay.portal.kernel.exception.SystemException {
107                    try {
108                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
109                                            "deleteFeed", _deleteFeedParameterTypes1);
110    
111                            MethodHandler methodHandler = new MethodHandler(methodKey, feedId);
112    
113                            try {
114                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
115                            }
116                            catch (Exception e) {
117                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
118                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
119                                    }
120    
121                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
122                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
123                                    }
124    
125                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
126                            }
127                    }
128                    catch (com.liferay.portal.kernel.exception.SystemException se) {
129                            _log.error(se, se);
130    
131                            throw se;
132                    }
133            }
134    
135            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
136                    long feedId)
137                    throws com.liferay.portal.kernel.exception.PortalException,
138                            com.liferay.portal.kernel.exception.SystemException {
139                    try {
140                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
141                                            "deleteFeed", _deleteFeedParameterTypes2);
142    
143                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
144                                            feedId);
145    
146                            try {
147                                    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                    catch (com.liferay.portal.kernel.exception.SystemException se) {
162                            _log.error(se, se);
163    
164                            throw se;
165                    }
166            }
167    
168            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
169                    java.lang.String feedId)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    try {
173                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
174                                            "deleteFeed", _deleteFeedParameterTypes3);
175    
176                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
177                                            feedId);
178    
179                            try {
180                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
181                            }
182                            catch (Exception e) {
183                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
184                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
185                                    }
186    
187                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
188                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
189                                    }
190    
191                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
192                            }
193                    }
194                    catch (com.liferay.portal.kernel.exception.SystemException se) {
195                            _log.error(se, se);
196    
197                            throw se;
198                    }
199            }
200    
201            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
202                    HttpPrincipal httpPrincipal, long feedId)
203                    throws com.liferay.portal.kernel.exception.PortalException,
204                            com.liferay.portal.kernel.exception.SystemException {
205                    try {
206                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
207                                            "getFeed", _getFeedParameterTypes4);
208    
209                            MethodHandler methodHandler = new MethodHandler(methodKey, feedId);
210    
211                            Object returnObj = null;
212    
213                            try {
214                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
215                            }
216                            catch (Exception e) {
217                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
218                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
219                                    }
220    
221                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
222                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
223                                    }
224    
225                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
226                            }
227    
228                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
229                    }
230                    catch (com.liferay.portal.kernel.exception.SystemException se) {
231                            _log.error(se, se);
232    
233                            throw se;
234                    }
235            }
236    
237            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
238                    HttpPrincipal httpPrincipal, long groupId, long feedId)
239                    throws com.liferay.portal.kernel.exception.PortalException,
240                            com.liferay.portal.kernel.exception.SystemException {
241                    try {
242                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
243                                            "getFeed", _getFeedParameterTypes5);
244    
245                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
246                                            feedId);
247    
248                            Object returnObj = null;
249    
250                            try {
251                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
252                            }
253                            catch (Exception e) {
254                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
255                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
256                                    }
257    
258                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
259                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
260                                    }
261    
262                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
263                            }
264    
265                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
266                    }
267                    catch (com.liferay.portal.kernel.exception.SystemException se) {
268                            _log.error(se, se);
269    
270                            throw se;
271                    }
272            }
273    
274            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
275                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
276                    throws com.liferay.portal.kernel.exception.PortalException,
277                            com.liferay.portal.kernel.exception.SystemException {
278                    try {
279                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
280                                            "getFeed", _getFeedParameterTypes6);
281    
282                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
283                                            feedId);
284    
285                            Object returnObj = null;
286    
287                            try {
288                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
289                            }
290                            catch (Exception e) {
291                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
292                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
293                                    }
294    
295                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
296                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
297                                    }
298    
299                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
300                            }
301    
302                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
303                    }
304                    catch (com.liferay.portal.kernel.exception.SystemException se) {
305                            _log.error(se, se);
306    
307                            throw se;
308                    }
309            }
310    
311            public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
312                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
313                    java.lang.String name, java.lang.String description,
314                    java.lang.String type, java.lang.String structureId,
315                    java.lang.String templateId, java.lang.String rendererTemplateId,
316                    int delta, java.lang.String orderByCol, java.lang.String orderByType,
317                    java.lang.String targetLayoutFriendlyUrl,
318                    java.lang.String targetPortletId, java.lang.String contentField,
319                    java.lang.String feedType, double feedVersion,
320                    com.liferay.portal.service.ServiceContext serviceContext)
321                    throws com.liferay.portal.kernel.exception.PortalException,
322                            com.liferay.portal.kernel.exception.SystemException {
323                    try {
324                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
325                                            "updateFeed", _updateFeedParameterTypes7);
326    
327                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
328                                            feedId, name, description, type, structureId, templateId,
329                                            rendererTemplateId, delta, orderByCol, orderByType,
330                                            targetLayoutFriendlyUrl, targetPortletId, contentField,
331                                            feedType, feedVersion, serviceContext);
332    
333                            Object returnObj = null;
334    
335                            try {
336                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
337                            }
338                            catch (Exception e) {
339                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
340                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
341                                    }
342    
343                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
344                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
345                                    }
346    
347                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
348                            }
349    
350                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
351                    }
352                    catch (com.liferay.portal.kernel.exception.SystemException se) {
353                            _log.error(se, se);
354    
355                            throw se;
356                    }
357            }
358    
359            private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
360            private static final Class<?>[] _addFeedParameterTypes0 = new Class[] {
361                            long.class, java.lang.String.class, boolean.class,
362                            java.lang.String.class, java.lang.String.class,
363                            java.lang.String.class, java.lang.String.class,
364                            java.lang.String.class, java.lang.String.class, int.class,
365                            java.lang.String.class, java.lang.String.class,
366                            java.lang.String.class, java.lang.String.class,
367                            java.lang.String.class, java.lang.String.class, double.class,
368                            com.liferay.portal.service.ServiceContext.class
369                    };
370            private static final Class<?>[] _deleteFeedParameterTypes1 = new Class[] {
371                            long.class
372                    };
373            private static final Class<?>[] _deleteFeedParameterTypes2 = new Class[] {
374                            long.class, long.class
375                    };
376            private static final Class<?>[] _deleteFeedParameterTypes3 = new Class[] {
377                            long.class, java.lang.String.class
378                    };
379            private static final Class<?>[] _getFeedParameterTypes4 = new Class[] {
380                            long.class
381                    };
382            private static final Class<?>[] _getFeedParameterTypes5 = new Class[] {
383                            long.class, long.class
384                    };
385            private static final Class<?>[] _getFeedParameterTypes6 = new Class[] {
386                            long.class, java.lang.String.class
387                    };
388            private static final Class<?>[] _updateFeedParameterTypes7 = new Class[] {
389                            long.class, java.lang.String.class, java.lang.String.class,
390                            java.lang.String.class, java.lang.String.class,
391                            java.lang.String.class, java.lang.String.class,
392                            java.lang.String.class, int.class, java.lang.String.class,
393                            java.lang.String.class, java.lang.String.class,
394                            java.lang.String.class, java.lang.String.class,
395                            java.lang.String.class, double.class,
396                            com.liferay.portal.service.ServiceContext.class
397                    };
398    }