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     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.journal.service.JournalFeedServiceUtil} 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       JournalFeedServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.journal.service.JournalFeedServiceUtil
054     * @generated
055     */
056    public class JournalFeedServiceHttp {
057            public static com.liferay.portlet.journal.model.JournalFeed addFeed(
058                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
059                    boolean autoFeedId, java.lang.String name,
060                    java.lang.String description, java.lang.String type,
061                    java.lang.String structureId, java.lang.String templateId,
062                    java.lang.String rendererTemplateId, int delta,
063                    java.lang.String orderByCol, java.lang.String orderByType,
064                    java.lang.String targetLayoutFriendlyUrl,
065                    java.lang.String targetPortletId, java.lang.String contentField,
066                    java.lang.String feedType, double feedVersion,
067                    com.liferay.portal.service.ServiceContext serviceContext)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    try {
071                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
072                                            "addFeed", _addFeedParameterTypes0);
073    
074                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
075                                            feedId, autoFeedId, name, description, type, structureId,
076                                            templateId, rendererTemplateId, 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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
091                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
092                                    }
093    
094                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
095                            }
096    
097                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
098                    }
099                    catch (com.liferay.portal.kernel.exception.SystemException se) {
100                            _log.error(se, se);
101    
102                            throw se;
103                    }
104            }
105    
106            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
107                    long feedId)
108                    throws com.liferay.portal.kernel.exception.PortalException,
109                            com.liferay.portal.kernel.exception.SystemException {
110                    try {
111                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
112                                            "deleteFeed", _deleteFeedParameterTypes1);
113    
114                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
115                                            feedId);
116    
117                            try {
118                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
119                            }
120                            catch (Exception e) {
121                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
122                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
123                                    }
124    
125                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
126                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
127                                    }
128    
129                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
130                            }
131                    }
132                    catch (com.liferay.portal.kernel.exception.SystemException se) {
133                            _log.error(se, se);
134    
135                            throw se;
136                    }
137            }
138    
139            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
140                    java.lang.String feedId)
141                    throws com.liferay.portal.kernel.exception.PortalException,
142                            com.liferay.portal.kernel.exception.SystemException {
143                    try {
144                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
145                                            "deleteFeed", _deleteFeedParameterTypes2);
146    
147                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
148                                            feedId);
149    
150                            try {
151                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
152                            }
153                            catch (Exception e) {
154                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
155                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
156                                    }
157    
158                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
159                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
160                                    }
161    
162                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
163                            }
164                    }
165                    catch (com.liferay.portal.kernel.exception.SystemException se) {
166                            _log.error(se, se);
167    
168                            throw se;
169                    }
170            }
171    
172            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
173                    HttpPrincipal httpPrincipal, long groupId, long feedId)
174                    throws com.liferay.portal.kernel.exception.PortalException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    try {
177                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
178                                            "getFeed", _getFeedParameterTypes3);
179    
180                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
181                                            feedId);
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.kernel.exception.PortalException) {
190                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
191                                    }
192    
193                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
194                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
195                                    }
196    
197                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
198                            }
199    
200                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
201                    }
202                    catch (com.liferay.portal.kernel.exception.SystemException se) {
203                            _log.error(se, se);
204    
205                            throw se;
206                    }
207            }
208    
209            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
210                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    try {
214                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
215                                            "getFeed", _getFeedParameterTypes4);
216    
217                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
218                                            feedId);
219    
220                            Object returnObj = null;
221    
222                            try {
223                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
224                            }
225                            catch (Exception e) {
226                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
227                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
228                                    }
229    
230                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
231                                            throw (com.liferay.portal.kernel.exception.SystemException)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 updateFeed(
247                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
248                    java.lang.String name, java.lang.String description,
249                    java.lang.String type, java.lang.String structureId,
250                    java.lang.String templateId, java.lang.String rendererTemplateId,
251                    int delta, java.lang.String orderByCol, java.lang.String orderByType,
252                    java.lang.String targetLayoutFriendlyUrl,
253                    java.lang.String targetPortletId, java.lang.String contentField,
254                    java.lang.String feedType, double feedVersion,
255                    com.liferay.portal.service.ServiceContext serviceContext)
256                    throws com.liferay.portal.kernel.exception.PortalException,
257                            com.liferay.portal.kernel.exception.SystemException {
258                    try {
259                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
260                                            "updateFeed", _updateFeedParameterTypes5);
261    
262                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
263                                            feedId, name, description, type, structureId, templateId,
264                                            rendererTemplateId, delta, orderByCol, orderByType,
265                                            targetLayoutFriendlyUrl, targetPortletId, contentField,
266                                            feedType, feedVersion, serviceContext);
267    
268                            Object returnObj = null;
269    
270                            try {
271                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
272                            }
273                            catch (Exception e) {
274                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
275                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
276                                    }
277    
278                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
279                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
280                                    }
281    
282                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
283                            }
284    
285                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
286                    }
287                    catch (com.liferay.portal.kernel.exception.SystemException se) {
288                            _log.error(se, se);
289    
290                            throw se;
291                    }
292            }
293    
294            private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
295            private static final Class<?>[] _addFeedParameterTypes0 = new Class[] {
296                            long.class, java.lang.String.class, boolean.class,
297                            java.lang.String.class, java.lang.String.class,
298                            java.lang.String.class, java.lang.String.class,
299                            java.lang.String.class, java.lang.String.class, int.class,
300                            java.lang.String.class, java.lang.String.class,
301                            java.lang.String.class, java.lang.String.class,
302                            java.lang.String.class, java.lang.String.class, double.class,
303                            com.liferay.portal.service.ServiceContext.class
304                    };
305            private static final Class<?>[] _deleteFeedParameterTypes1 = new Class[] {
306                            long.class, long.class
307                    };
308            private static final Class<?>[] _deleteFeedParameterTypes2 = new Class[] {
309                            long.class, java.lang.String.class
310                    };
311            private static final Class<?>[] _getFeedParameterTypes3 = new Class[] {
312                            long.class, long.class
313                    };
314            private static final Class<?>[] _getFeedParameterTypes4 = new Class[] {
315                            long.class, java.lang.String.class
316                    };
317            private static final Class<?>[] _updateFeedParameterTypes5 = new Class[] {
318                            long.class, java.lang.String.class, java.lang.String.class,
319                            java.lang.String.class, java.lang.String.class,
320                            java.lang.String.class, java.lang.String.class,
321                            java.lang.String.class, int.class, java.lang.String.class,
322                            java.lang.String.class, java.lang.String.class,
323                            java.lang.String.class, java.lang.String.class,
324                            java.lang.String.class, double.class,
325                            com.liferay.portal.service.ServiceContext.class
326                    };
327    }