001    /**
002     * Copyright (c) 2000-2010 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", long.class, java.lang.String.class,
073                                            boolean.class, java.lang.String.class,
074                                            java.lang.String.class, java.lang.String.class,
075                                            java.lang.String.class, java.lang.String.class,
076                                            java.lang.String.class, int.class, java.lang.String.class,
077                                            java.lang.String.class, java.lang.String.class,
078                                            java.lang.String.class, java.lang.String.class,
079                                            java.lang.String.class, double.class,
080                                            com.liferay.portal.service.ServiceContext.class);
081    
082                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
083                                            feedId, autoFeedId, name, description, type, structureId,
084                                            templateId, rendererTemplateId, delta, orderByCol,
085                                            orderByType, targetLayoutFriendlyUrl, targetPortletId,
086                                            contentField, feedType, feedVersion, serviceContext);
087    
088                            Object returnObj = null;
089    
090                            try {
091                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
092                            }
093                            catch (Exception e) {
094                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
095                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
096                                    }
097    
098                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
099                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
100                                    }
101    
102                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
103                            }
104    
105                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
106                    }
107                    catch (com.liferay.portal.kernel.exception.SystemException se) {
108                            _log.error(se, se);
109    
110                            throw se;
111                    }
112            }
113    
114            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
115                    long feedId)
116                    throws com.liferay.portal.kernel.exception.PortalException,
117                            com.liferay.portal.kernel.exception.SystemException {
118                    try {
119                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
120                                            "deleteFeed", long.class, long.class);
121    
122                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
123                                            feedId);
124    
125                            try {
126                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
127                            }
128                            catch (Exception e) {
129                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
130                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
131                                    }
132    
133                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
134                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
135                                    }
136    
137                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
138                            }
139                    }
140                    catch (com.liferay.portal.kernel.exception.SystemException se) {
141                            _log.error(se, se);
142    
143                            throw se;
144                    }
145            }
146    
147            public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
148                    java.lang.String feedId)
149                    throws com.liferay.portal.kernel.exception.PortalException,
150                            com.liferay.portal.kernel.exception.SystemException {
151                    try {
152                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
153                                            "deleteFeed", long.class, java.lang.String.class);
154    
155                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
156                                            feedId);
157    
158                            try {
159                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
160                            }
161                            catch (Exception e) {
162                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
163                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
164                                    }
165    
166                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
167                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
168                                    }
169    
170                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
171                            }
172                    }
173                    catch (com.liferay.portal.kernel.exception.SystemException se) {
174                            _log.error(se, se);
175    
176                            throw se;
177                    }
178            }
179    
180            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
181                    HttpPrincipal httpPrincipal, long groupId, long feedId)
182                    throws com.liferay.portal.kernel.exception.PortalException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    try {
185                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
186                                            "getFeed", long.class, long.class);
187    
188                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
189                                            feedId);
190    
191                            Object returnObj = null;
192    
193                            try {
194                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
195                            }
196                            catch (Exception e) {
197                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
198                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
199                                    }
200    
201                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
202                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
203                                    }
204    
205                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
206                            }
207    
208                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
209                    }
210                    catch (com.liferay.portal.kernel.exception.SystemException se) {
211                            _log.error(se, se);
212    
213                            throw se;
214                    }
215            }
216    
217            public static com.liferay.portlet.journal.model.JournalFeed getFeed(
218                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
219                    throws com.liferay.portal.kernel.exception.PortalException,
220                            com.liferay.portal.kernel.exception.SystemException {
221                    try {
222                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
223                                            "getFeed", long.class, java.lang.String.class);
224    
225                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
226                                            feedId);
227    
228                            Object returnObj = null;
229    
230                            try {
231                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
232                            }
233                            catch (Exception e) {
234                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
235                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
236                                    }
237    
238                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
239                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
240                                    }
241    
242                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
243                            }
244    
245                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
246                    }
247                    catch (com.liferay.portal.kernel.exception.SystemException se) {
248                            _log.error(se, se);
249    
250                            throw se;
251                    }
252            }
253    
254            public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
255                    HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
256                    java.lang.String name, java.lang.String description,
257                    java.lang.String type, java.lang.String structureId,
258                    java.lang.String templateId, java.lang.String rendererTemplateId,
259                    int delta, java.lang.String orderByCol, java.lang.String orderByType,
260                    java.lang.String targetLayoutFriendlyUrl,
261                    java.lang.String targetPortletId, java.lang.String contentField,
262                    java.lang.String feedType, double feedVersion,
263                    com.liferay.portal.service.ServiceContext serviceContext)
264                    throws com.liferay.portal.kernel.exception.PortalException,
265                            com.liferay.portal.kernel.exception.SystemException {
266                    try {
267                            MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
268                                            "updateFeed", long.class, java.lang.String.class,
269                                            java.lang.String.class, java.lang.String.class,
270                                            java.lang.String.class, java.lang.String.class,
271                                            java.lang.String.class, java.lang.String.class, int.class,
272                                            java.lang.String.class, java.lang.String.class,
273                                            java.lang.String.class, java.lang.String.class,
274                                            java.lang.String.class, java.lang.String.class,
275                                            double.class,
276                                            com.liferay.portal.service.ServiceContext.class);
277    
278                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
279                                            feedId, name, description, type, structureId, templateId,
280                                            rendererTemplateId, delta, orderByCol, orderByType,
281                                            targetLayoutFriendlyUrl, targetPortletId, contentField,
282                                            feedType, feedVersion, serviceContext);
283    
284                            Object returnObj = null;
285    
286                            try {
287                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
288                            }
289                            catch (Exception e) {
290                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
291                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
292                                    }
293    
294                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
295                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
296                                    }
297    
298                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
299                            }
300    
301                            return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
302                    }
303                    catch (com.liferay.portal.kernel.exception.SystemException se) {
304                            _log.error(se, se);
305    
306                            throw se;
307                    }
308            }
309    
310            private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
311    }