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.announcements.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.announcements.service.AnnouncementsEntryServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.announcements.service.AnnouncementsEntryServiceUtil} 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 AnnouncementsEntryServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.announcements.service.AnnouncementsEntryServiceUtil
052     * @generated
053     */
054    public class AnnouncementsEntryServiceHttp {
055            public static com.liferay.portlet.announcements.model.AnnouncementsEntry addEntry(
056                    HttpPrincipal httpPrincipal, long plid, long classNameId, long classPK,
057                    java.lang.String title, java.lang.String content, java.lang.String url,
058                    java.lang.String type, int displayDateMonth, int displayDateDay,
059                    int displayDateYear, int displayDateHour, int displayDateMinute,
060                    boolean displayImmediately, int expirationDateMonth,
061                    int expirationDateDay, int expirationDateYear, int expirationDateHour,
062                    int expirationDateMinute, int priority, boolean alert)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    try {
066                            MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class,
067                                            "addEntry", _addEntryParameterTypes0);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey, plid,
070                                            classNameId, classPK, title, content, url, type,
071                                            displayDateMonth, displayDateDay, displayDateYear,
072                                            displayDateHour, displayDateMinute, displayImmediately,
073                                            expirationDateMonth, expirationDateDay, expirationDateYear,
074                                            expirationDateHour, expirationDateMinute, priority, alert);
075    
076                            Object returnObj = null;
077    
078                            try {
079                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
080                            }
081                            catch (Exception e) {
082                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
083                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
084                                    }
085    
086                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
087                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
088                                    }
089    
090                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
091                            }
092    
093                            return (com.liferay.portlet.announcements.model.AnnouncementsEntry)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 com.liferay.portlet.announcements.model.AnnouncementsEntry addEntry(
103                    HttpPrincipal httpPrincipal, long plid, long classNameId, long classPK,
104                    java.lang.String title, java.lang.String content, java.lang.String url,
105                    java.lang.String type, int displayDateMonth, int displayDateDay,
106                    int displayDateYear, int displayDateHour, int displayDateMinute,
107                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
108                    int expirationDateHour, int expirationDateMinute, int priority,
109                    boolean alert)
110                    throws com.liferay.portal.kernel.exception.PortalException,
111                            com.liferay.portal.kernel.exception.SystemException {
112                    try {
113                            MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class,
114                                            "addEntry", _addEntryParameterTypes1);
115    
116                            MethodHandler methodHandler = new MethodHandler(methodKey, plid,
117                                            classNameId, classPK, title, content, url, type,
118                                            displayDateMonth, displayDateDay, displayDateYear,
119                                            displayDateHour, displayDateMinute, expirationDateMonth,
120                                            expirationDateDay, expirationDateYear, expirationDateHour,
121                                            expirationDateMinute, priority, alert);
122    
123                            Object returnObj = null;
124    
125                            try {
126                                    returnObj = 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                            return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
141                    }
142                    catch (com.liferay.portal.kernel.exception.SystemException se) {
143                            _log.error(se, se);
144    
145                            throw se;
146                    }
147            }
148    
149            public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
150                    throws com.liferay.portal.kernel.exception.PortalException,
151                            com.liferay.portal.kernel.exception.SystemException {
152                    try {
153                            MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class,
154                                            "deleteEntry", _deleteEntryParameterTypes2);
155    
156                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
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.announcements.model.AnnouncementsEntry getEntry(
181                    HttpPrincipal httpPrincipal, long entryId)
182                    throws com.liferay.portal.kernel.exception.PortalException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    try {
185                            MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class,
186                                            "getEntry", _getEntryParameterTypes3);
187    
188                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
189    
190                            Object returnObj = null;
191    
192                            try {
193                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
194                            }
195                            catch (Exception e) {
196                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
197                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
198                                    }
199    
200                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
201                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
202                                    }
203    
204                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
205                            }
206    
207                            return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
208                    }
209                    catch (com.liferay.portal.kernel.exception.SystemException se) {
210                            _log.error(se, se);
211    
212                            throw se;
213                    }
214            }
215    
216            public static com.liferay.portlet.announcements.model.AnnouncementsEntry updateEntry(
217                    HttpPrincipal httpPrincipal, long entryId, java.lang.String title,
218                    java.lang.String content, java.lang.String url, java.lang.String type,
219                    int displayDateMonth, int displayDateDay, int displayDateYear,
220                    int displayDateHour, int displayDateMinute, boolean displayImmediately,
221                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
222                    int expirationDateHour, int expirationDateMinute, int priority)
223                    throws com.liferay.portal.kernel.exception.PortalException,
224                            com.liferay.portal.kernel.exception.SystemException {
225                    try {
226                            MethodKey methodKey = new MethodKey(AnnouncementsEntryServiceUtil.class,
227                                            "updateEntry", _updateEntryParameterTypes4);
228    
229                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
230                                            title, content, url, type, displayDateMonth,
231                                            displayDateDay, displayDateYear, displayDateHour,
232                                            displayDateMinute, displayImmediately, expirationDateMonth,
233                                            expirationDateDay, expirationDateYear, expirationDateHour,
234                                            expirationDateMinute, priority);
235    
236                            Object returnObj = null;
237    
238                            try {
239                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
240                            }
241                            catch (Exception e) {
242                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
243                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
244                                    }
245    
246                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
247                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
248                                    }
249    
250                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
251                            }
252    
253                            return (com.liferay.portlet.announcements.model.AnnouncementsEntry)returnObj;
254                    }
255                    catch (com.liferay.portal.kernel.exception.SystemException se) {
256                            _log.error(se, se);
257    
258                            throw se;
259                    }
260            }
261    
262            private static Log _log = LogFactoryUtil.getLog(AnnouncementsEntryServiceHttp.class);
263            private static final Class<?>[] _addEntryParameterTypes0 = new Class[] {
264                            long.class, long.class, long.class, java.lang.String.class,
265                            java.lang.String.class, java.lang.String.class,
266                            java.lang.String.class, int.class, int.class, int.class, int.class,
267                            int.class, boolean.class, int.class, int.class, int.class, int.class,
268                            int.class, int.class, boolean.class
269                    };
270            private static final Class<?>[] _addEntryParameterTypes1 = new Class[] {
271                            long.class, long.class, long.class, java.lang.String.class,
272                            java.lang.String.class, java.lang.String.class,
273                            java.lang.String.class, int.class, int.class, int.class, int.class,
274                            int.class, int.class, int.class, int.class, int.class, int.class,
275                            int.class, boolean.class
276                    };
277            private static final Class<?>[] _deleteEntryParameterTypes2 = new Class[] {
278                            long.class
279                    };
280            private static final Class<?>[] _getEntryParameterTypes3 = new Class[] {
281                            long.class
282                    };
283            private static final Class<?>[] _updateEntryParameterTypes4 = new Class[] {
284                            long.class, java.lang.String.class, java.lang.String.class,
285                            java.lang.String.class, java.lang.String.class, int.class, int.class,
286                            int.class, int.class, int.class, boolean.class, int.class, int.class,
287                            int.class, int.class, int.class, int.class
288                    };
289    }