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.journal.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.journal.service.JournalFeedServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link JournalFeedServiceUtil} 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 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 JournalFeedServiceSoap
052     * @see HttpPrincipal
053     * @see JournalFeedServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class JournalFeedServiceHttp {
058            public static com.liferay.portlet.journal.model.JournalFeed addFeed(
059                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
060                    boolean autoFeedId, java.lang.String name,
061                    java.lang.String description, java.lang.String ddmStructureKey,
062                    java.lang.String ddmTemplateKey,
063                    java.lang.String ddmRendererTemplateKey, int delta,
064                    java.lang.String orderByCol, java.lang.String orderByType,
065                    java.lang.String targetLayoutFriendlyUrl,
066                    java.lang.String targetPortletId, java.lang.String contentField,
067                    java.lang.String feedType, double feedVersion,
068                    com.liferay.portal.service.ServiceContext serviceContext)
069                    throws com.liferay.portal.kernel.exception.PortalException {
070                    try {
071                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
072                                            "addFeed", _addFeedParameterTypes0);
073    
074                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
075                                            feedId, autoFeedId, name, description, ddmStructureKey,
076                                            ddmTemplateKey, ddmRendererTemplateKey, delta, orderByCol,
077                                            orderByType, targetLayoutFriendlyUrl, targetPortletId,
078                                            contentField, feedType, feedVersion, serviceContext);
079    
080                            Object returnObj = null;
081    
082                            try {
083                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
084                            }
085                            catch (Exception e) {
086                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
087                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
088                                    }
089    
090                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
091                            }
092    
093                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
094                    }
095                    catch (com.liferay.portal.kernel.exception.SystemException se) {
096                            _log.error(se, se);
097    
098                            throw se;
099                    }
100            }
101    
102            public static void deleteFeed(HttpPrincipal httpPrincipal, long feedId)
103                    throws com.liferay.portal.kernel.exception.PortalException {
104                    try {
105                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
106                                            "deleteFeed", _deleteFeedParameterTypes1);
107    
108                            MethodHandler methodHandler = new MethodHandler(methodKey, feedId);
109    
110                            try {
111                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
112                            }
113                            catch (Exception e) {
114                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
115                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
116                                    }
117    
118                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
119                            }
120                    }
121                    catch (com.liferay.portal.kernel.exception.SystemException se) {
122                            _log.error(se, se);
123    
124                            throw se;
125                    }
126            }
127    
128            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
129                    long feedId) throws com.liferay.portal.kernel.exception.PortalException {
130                    try {
131                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
132                                            "deleteFeed", _deleteFeedParameterTypes2);
133    
134                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
135                                            feedId);
136    
137                            try {
138                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
139                            }
140                            catch (Exception e) {
141                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
142                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
143                                    }
144    
145                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
146                            }
147                    }
148                    catch (com.liferay.portal.kernel.exception.SystemException se) {
149                            _log.error(se, se);
150    
151                            throw se;
152                    }
153            }
154    
155            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
156                    java.lang.String feedId)
157                    throws com.liferay.portal.kernel.exception.PortalException {
158                    try {
159                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
160                                            "deleteFeed", _deleteFeedParameterTypes3);
161    
162                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
163                                            feedId);
164    
165                            try {
166                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
167                            }
168                            catch (Exception e) {
169                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
170                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
171                                    }
172    
173                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
174                            }
175                    }
176                    catch (com.liferay.portal.kernel.exception.SystemException se) {
177                            _log.error(se, se);
178    
179                            throw se;
180                    }
181            }
182    
183            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
184                    HttpPrincipal httpPrincipal, long feedId)
185                    throws com.liferay.portal.kernel.exception.PortalException {
186                    try {
187                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
188                                            "getFeed", _getFeedParameterTypes4);
189    
190                            MethodHandler methodHandler = new MethodHandler(methodKey, feedId);
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.journal.model.JournalFeed)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.journal.model.JournalFeed getFeed(
215                    HttpPrincipal httpPrincipal, long groupId, long feedId)
216                    throws com.liferay.portal.kernel.exception.PortalException {
217                    try {
218                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
219                                            "getFeed", _getFeedParameterTypes5);
220    
221                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
222                                            feedId);
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
235                            }
236    
237                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
238                    }
239                    catch (com.liferay.portal.kernel.exception.SystemException se) {
240                            _log.error(se, se);
241    
242                            throw se;
243                    }
244            }
245    
246            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
247                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
248                    throws com.liferay.portal.kernel.exception.PortalException {
249                    try {
250                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
251                                            "getFeed", _getFeedParameterTypes6);
252    
253                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
254                                            feedId);
255    
256                            Object returnObj = null;
257    
258                            try {
259                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
260                            }
261                            catch (Exception e) {
262                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
263                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
264                                    }
265    
266                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
267                            }
268    
269                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
270                    }
271                    catch (com.liferay.portal.kernel.exception.SystemException se) {
272                            _log.error(se, se);
273    
274                            throw se;
275                    }
276            }
277    
278            public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
279                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
280                    java.lang.String name, java.lang.String description,
281                    java.lang.String ddmStructureKey, java.lang.String ddmTemplateKey,
282                    java.lang.String ddmRendererTemplateKey, int delta,
283                    java.lang.String orderByCol, java.lang.String orderByType,
284                    java.lang.String targetLayoutFriendlyUrl,
285                    java.lang.String targetPortletId, java.lang.String contentField,
286                    java.lang.String feedType, double feedVersion,
287                    com.liferay.portal.service.ServiceContext serviceContext)
288                    throws com.liferay.portal.kernel.exception.PortalException {
289                    try {
290                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class,
291                                            "updateFeed", _updateFeedParameterTypes7);
292    
293                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
294                                            feedId, name, description, ddmStructureKey, ddmTemplateKey,
295                                            ddmRendererTemplateKey, delta, orderByCol, orderByType,
296                                            targetLayoutFriendlyUrl, targetPortletId, contentField,
297                                            feedType, feedVersion, serviceContext);
298    
299                            Object returnObj = null;
300    
301                            try {
302                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
303                            }
304                            catch (Exception e) {
305                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
306                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
307                                    }
308    
309                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
310                            }
311    
312                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
313                    }
314                    catch (com.liferay.portal.kernel.exception.SystemException se) {
315                            _log.error(se, se);
316    
317                            throw se;
318                    }
319            }
320    
321            private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
322            private static final Class<?>[] _addFeedParameterTypes0 = new Class[] {
323                            long.class, java.lang.String.class, boolean.class,
324                            java.lang.String.class, java.lang.String.class,
325                            java.lang.String.class, java.lang.String.class,
326                            java.lang.String.class, int.class, java.lang.String.class,
327                            java.lang.String.class, java.lang.String.class,
328                            java.lang.String.class, java.lang.String.class,
329                            java.lang.String.class, double.class,
330                            com.liferay.portal.service.ServiceContext.class
331                    };
332            private static final Class<?>[] _deleteFeedParameterTypes1 = new Class[] {
333                            long.class
334                    };
335            private static final Class<?>[] _deleteFeedParameterTypes2 = new Class[] {
336                            long.class, long.class
337                    };
338            private static final Class<?>[] _deleteFeedParameterTypes3 = new Class[] {
339                            long.class, java.lang.String.class
340                    };
341            private static final Class<?>[] _getFeedParameterTypes4 = new Class[] {
342                            long.class
343                    };
344            private static final Class<?>[] _getFeedParameterTypes5 = new Class[] {
345                            long.class, long.class
346                    };
347            private static final Class<?>[] _getFeedParameterTypes6 = new Class[] {
348                            long.class, java.lang.String.class
349                    };
350            private static final Class<?>[] _updateFeedParameterTypes7 = new Class[] {
351                            long.class, java.lang.String.class, java.lang.String.class,
352                            java.lang.String.class, java.lang.String.class,
353                            java.lang.String.class, java.lang.String.class, int.class,
354                            java.lang.String.class, java.lang.String.class,
355                            java.lang.String.class, java.lang.String.class,
356                            java.lang.String.class, java.lang.String.class, double.class,
357                            com.liferay.portal.service.ServiceContext.class
358                    };
359    }