001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.messageboards.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.messageboards.service.MBThreadServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.messageboards.service.MBThreadServiceUtil} 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       MBThreadServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.messageboards.service.MBThreadServiceUtil
054     * @generated
055     */
056    public class MBThreadServiceHttp {
057            public static void deleteThread(HttpPrincipal httpPrincipal, long threadId)
058                    throws com.liferay.portal.kernel.exception.PortalException,
059                            com.liferay.portal.kernel.exception.SystemException {
060                    try {
061                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
062                                            "deleteThread", _deleteThreadParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey, threadId);
065    
066                            try {
067                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
068                            }
069                            catch (Exception e) {
070                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
072                                    }
073    
074                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
076                                    }
077    
078                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
079                            }
080                    }
081                    catch (com.liferay.portal.kernel.exception.SystemException se) {
082                            _log.error(se, se);
083    
084                            throw se;
085                    }
086            }
087    
088            public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
089                    HttpPrincipal httpPrincipal, long groupId, long userId, int status,
090                    boolean subscribed, boolean includeAnonymous, int start, int end)
091                    throws com.liferay.portal.kernel.exception.PortalException,
092                            com.liferay.portal.kernel.exception.SystemException {
093                    try {
094                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
095                                            "getGroupThreads", _getGroupThreadsParameterTypes1);
096    
097                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
098                                            userId, status, subscribed, includeAnonymous, start, end);
099    
100                            Object returnObj = null;
101    
102                            try {
103                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
104                            }
105                            catch (Exception e) {
106                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
107                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
108                                    }
109    
110                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
111                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
112                                    }
113    
114                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
115                            }
116    
117                            return (java.util.List<com.liferay.portlet.messageboards.model.MBThread>)returnObj;
118                    }
119                    catch (com.liferay.portal.kernel.exception.SystemException se) {
120                            _log.error(se, se);
121    
122                            throw se;
123                    }
124            }
125    
126            public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
127                    HttpPrincipal httpPrincipal, long groupId, long userId, int status,
128                    boolean subscribed, int start, int end)
129                    throws com.liferay.portal.kernel.exception.PortalException,
130                            com.liferay.portal.kernel.exception.SystemException {
131                    try {
132                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
133                                            "getGroupThreads", _getGroupThreadsParameterTypes2);
134    
135                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
136                                            userId, status, subscribed, start, end);
137    
138                            Object returnObj = null;
139    
140                            try {
141                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
142                            }
143                            catch (Exception e) {
144                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
145                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
146                                    }
147    
148                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
149                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
150                                    }
151    
152                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
153                            }
154    
155                            return (java.util.List<com.liferay.portlet.messageboards.model.MBThread>)returnObj;
156                    }
157                    catch (com.liferay.portal.kernel.exception.SystemException se) {
158                            _log.error(se, se);
159    
160                            throw se;
161                    }
162            }
163    
164            public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
165                    HttpPrincipal httpPrincipal, long groupId, long userId, int status,
166                    int start, int end)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    try {
170                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
171                                            "getGroupThreads", _getGroupThreadsParameterTypes3);
172    
173                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
174                                            userId, status, start, end);
175    
176                            Object returnObj = null;
177    
178                            try {
179                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
180                            }
181                            catch (Exception e) {
182                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
183                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
184                                    }
185    
186                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
187                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
188                                    }
189    
190                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
191                            }
192    
193                            return (java.util.List<com.liferay.portlet.messageboards.model.MBThread>)returnObj;
194                    }
195                    catch (com.liferay.portal.kernel.exception.SystemException se) {
196                            _log.error(se, se);
197    
198                            throw se;
199                    }
200            }
201    
202            public static int getGroupThreadsCount(HttpPrincipal httpPrincipal,
203                    long groupId, long userId, int status)
204                    throws com.liferay.portal.kernel.exception.SystemException {
205                    try {
206                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
207                                            "getGroupThreadsCount", _getGroupThreadsCountParameterTypes4);
208    
209                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
210                                            userId, status);
211    
212                            Object returnObj = null;
213    
214                            try {
215                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
216                            }
217                            catch (Exception e) {
218                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
219                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
220                                    }
221    
222                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
223                            }
224    
225                            return ((Integer)returnObj).intValue();
226                    }
227                    catch (com.liferay.portal.kernel.exception.SystemException se) {
228                            _log.error(se, se);
229    
230                            throw se;
231                    }
232            }
233    
234            public static int getGroupThreadsCount(HttpPrincipal httpPrincipal,
235                    long groupId, long userId, int status, boolean subscribed)
236                    throws com.liferay.portal.kernel.exception.SystemException {
237                    try {
238                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
239                                            "getGroupThreadsCount", _getGroupThreadsCountParameterTypes5);
240    
241                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
242                                            userId, status, subscribed);
243    
244                            Object returnObj = null;
245    
246                            try {
247                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
248                            }
249                            catch (Exception e) {
250                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
251                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
252                                    }
253    
254                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
255                            }
256    
257                            return ((Integer)returnObj).intValue();
258                    }
259                    catch (com.liferay.portal.kernel.exception.SystemException se) {
260                            _log.error(se, se);
261    
262                            throw se;
263                    }
264            }
265    
266            public static int getGroupThreadsCount(HttpPrincipal httpPrincipal,
267                    long groupId, long userId, int status, boolean subscribed,
268                    boolean includeAnonymous)
269                    throws com.liferay.portal.kernel.exception.SystemException {
270                    try {
271                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
272                                            "getGroupThreadsCount", _getGroupThreadsCountParameterTypes6);
273    
274                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
275                                            userId, status, subscribed, includeAnonymous);
276    
277                            Object returnObj = null;
278    
279                            try {
280                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
281                            }
282                            catch (Exception e) {
283                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
284                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
285                                    }
286    
287                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
288                            }
289    
290                            return ((Integer)returnObj).intValue();
291                    }
292                    catch (com.liferay.portal.kernel.exception.SystemException se) {
293                            _log.error(se, se);
294    
295                            throw se;
296                    }
297            }
298    
299            public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getThreads(
300                    HttpPrincipal httpPrincipal, long groupId, long categoryId, int status,
301                    int start, int end)
302                    throws com.liferay.portal.kernel.exception.SystemException {
303                    try {
304                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
305                                            "getThreads", _getThreadsParameterTypes7);
306    
307                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
308                                            categoryId, status, start, end);
309    
310                            Object returnObj = null;
311    
312                            try {
313                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
314                            }
315                            catch (Exception e) {
316                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
317                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
318                                    }
319    
320                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
321                            }
322    
323                            return (java.util.List<com.liferay.portlet.messageboards.model.MBThread>)returnObj;
324                    }
325                    catch (com.liferay.portal.kernel.exception.SystemException se) {
326                            _log.error(se, se);
327    
328                            throw se;
329                    }
330            }
331    
332            public static int getThreadsCount(HttpPrincipal httpPrincipal,
333                    long groupId, long categoryId, int status)
334                    throws com.liferay.portal.kernel.exception.SystemException {
335                    try {
336                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
337                                            "getThreadsCount", _getThreadsCountParameterTypes8);
338    
339                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
340                                            categoryId, status);
341    
342                            Object returnObj = null;
343    
344                            try {
345                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
346                            }
347                            catch (Exception e) {
348                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
349                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
350                                    }
351    
352                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
353                            }
354    
355                            return ((Integer)returnObj).intValue();
356                    }
357                    catch (com.liferay.portal.kernel.exception.SystemException se) {
358                            _log.error(se, se);
359    
360                            throw se;
361                    }
362            }
363    
364            public static com.liferay.portal.model.Lock lockThread(
365                    HttpPrincipal httpPrincipal, long threadId)
366                    throws com.liferay.portal.kernel.exception.PortalException,
367                            com.liferay.portal.kernel.exception.SystemException {
368                    try {
369                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
370                                            "lockThread", _lockThreadParameterTypes9);
371    
372                            MethodHandler methodHandler = new MethodHandler(methodKey, threadId);
373    
374                            Object returnObj = null;
375    
376                            try {
377                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
378                            }
379                            catch (Exception e) {
380                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
381                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
382                                    }
383    
384                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
385                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
386                                    }
387    
388                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
389                            }
390    
391                            return (com.liferay.portal.model.Lock)returnObj;
392                    }
393                    catch (com.liferay.portal.kernel.exception.SystemException se) {
394                            _log.error(se, se);
395    
396                            throw se;
397                    }
398            }
399    
400            public static com.liferay.portlet.messageboards.model.MBThread moveThread(
401                    HttpPrincipal httpPrincipal, long categoryId, long threadId)
402                    throws com.liferay.portal.kernel.exception.PortalException,
403                            com.liferay.portal.kernel.exception.SystemException {
404                    try {
405                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
406                                            "moveThread", _moveThreadParameterTypes10);
407    
408                            MethodHandler methodHandler = new MethodHandler(methodKey,
409                                            categoryId, threadId);
410    
411                            Object returnObj = null;
412    
413                            try {
414                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
415                            }
416                            catch (Exception e) {
417                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
418                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
419                                    }
420    
421                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
422                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
423                                    }
424    
425                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
426                            }
427    
428                            return (com.liferay.portlet.messageboards.model.MBThread)returnObj;
429                    }
430                    catch (com.liferay.portal.kernel.exception.SystemException se) {
431                            _log.error(se, se);
432    
433                            throw se;
434                    }
435            }
436    
437            public static com.liferay.portlet.messageboards.model.MBThread splitThread(
438                    HttpPrincipal httpPrincipal, long messageId,
439                    com.liferay.portal.service.ServiceContext serviceContext)
440                    throws com.liferay.portal.kernel.exception.PortalException,
441                            com.liferay.portal.kernel.exception.SystemException {
442                    try {
443                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
444                                            "splitThread", _splitThreadParameterTypes11);
445    
446                            MethodHandler methodHandler = new MethodHandler(methodKey,
447                                            messageId, serviceContext);
448    
449                            Object returnObj = null;
450    
451                            try {
452                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
453                            }
454                            catch (Exception e) {
455                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
456                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
457                                    }
458    
459                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
460                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
461                                    }
462    
463                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
464                            }
465    
466                            return (com.liferay.portlet.messageboards.model.MBThread)returnObj;
467                    }
468                    catch (com.liferay.portal.kernel.exception.SystemException se) {
469                            _log.error(se, se);
470    
471                            throw se;
472                    }
473            }
474    
475            public static void unlockThread(HttpPrincipal httpPrincipal, long threadId)
476                    throws com.liferay.portal.kernel.exception.PortalException,
477                            com.liferay.portal.kernel.exception.SystemException {
478                    try {
479                            MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
480                                            "unlockThread", _unlockThreadParameterTypes12);
481    
482                            MethodHandler methodHandler = new MethodHandler(methodKey, threadId);
483    
484                            try {
485                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
486                            }
487                            catch (Exception e) {
488                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
489                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
490                                    }
491    
492                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
493                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
494                                    }
495    
496                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
497                            }
498                    }
499                    catch (com.liferay.portal.kernel.exception.SystemException se) {
500                            _log.error(se, se);
501    
502                            throw se;
503                    }
504            }
505    
506            private static Log _log = LogFactoryUtil.getLog(MBThreadServiceHttp.class);
507            private static final Class<?>[] _deleteThreadParameterTypes0 = new Class[] {
508                            long.class
509                    };
510            private static final Class<?>[] _getGroupThreadsParameterTypes1 = new Class[] {
511                            long.class, long.class, int.class, boolean.class, boolean.class,
512                            int.class, int.class
513                    };
514            private static final Class<?>[] _getGroupThreadsParameterTypes2 = new Class[] {
515                            long.class, long.class, int.class, boolean.class, int.class,
516                            int.class
517                    };
518            private static final Class<?>[] _getGroupThreadsParameterTypes3 = new Class[] {
519                            long.class, long.class, int.class, int.class, int.class
520                    };
521            private static final Class<?>[] _getGroupThreadsCountParameterTypes4 = new Class[] {
522                            long.class, long.class, int.class
523                    };
524            private static final Class<?>[] _getGroupThreadsCountParameterTypes5 = new Class[] {
525                            long.class, long.class, int.class, boolean.class
526                    };
527            private static final Class<?>[] _getGroupThreadsCountParameterTypes6 = new Class[] {
528                            long.class, long.class, int.class, boolean.class, boolean.class
529                    };
530            private static final Class<?>[] _getThreadsParameterTypes7 = new Class[] {
531                            long.class, long.class, int.class, int.class, int.class
532                    };
533            private static final Class<?>[] _getThreadsCountParameterTypes8 = new Class[] {
534                            long.class, long.class, int.class
535                    };
536            private static final Class<?>[] _lockThreadParameterTypes9 = new Class[] {
537                            long.class
538                    };
539            private static final Class<?>[] _moveThreadParameterTypes10 = new Class[] {
540                            long.class, long.class
541                    };
542            private static final Class<?>[] _splitThreadParameterTypes11 = new Class[] {
543                            long.class, com.liferay.portal.service.ServiceContext.class
544                    };
545            private static final Class<?>[] _unlockThreadParameterTypes12 = new Class[] {
546                            long.class
547                    };
548    }