001    /**
002     * Copyright (c) 2000-2012 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.bookmarks.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.bookmarks.service.BookmarksEntryServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.bookmarks.service.BookmarksEntryServiceUtil} 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       BookmarksEntryServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.bookmarks.service.BookmarksEntryServiceUtil
054     * @generated
055     */
056    public class BookmarksEntryServiceHttp {
057            public static com.liferay.portlet.bookmarks.model.BookmarksEntry addEntry(
058                    HttpPrincipal httpPrincipal, long groupId, long folderId,
059                    java.lang.String name, java.lang.String url,
060                    java.lang.String description,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    try {
065                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
066                                            "addEntry", _addEntryParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
069                                            folderId, name, url, description, serviceContext);
070    
071                            Object returnObj = null;
072    
073                            try {
074                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
075                            }
076                            catch (Exception e) {
077                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
078                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
079                                    }
080    
081                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
082                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
083                                    }
084    
085                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
086                            }
087    
088                            return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
089                    }
090                    catch (com.liferay.portal.kernel.exception.SystemException se) {
091                            _log.error(se, se);
092    
093                            throw se;
094                    }
095            }
096    
097            public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    try {
101                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
102                                            "deleteEntry", _deleteEntryParameterTypes1);
103    
104                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
105    
106                            try {
107                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
108                            }
109                            catch (Exception e) {
110                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
111                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
112                                    }
113    
114                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
115                                            throw (com.liferay.portal.kernel.exception.SystemException)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 java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getEntries(
129                    HttpPrincipal httpPrincipal, long groupId, long folderId, int start,
130                    int end) throws com.liferay.portal.kernel.exception.SystemException {
131                    try {
132                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
133                                            "getEntries", _getEntriesParameterTypes2);
134    
135                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
136                                            folderId, 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.SystemException) {
145                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
146                                    }
147    
148                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
149                            }
150    
151                            return (java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry>)returnObj;
152                    }
153                    catch (com.liferay.portal.kernel.exception.SystemException se) {
154                            _log.error(se, se);
155    
156                            throw se;
157                    }
158            }
159    
160            public static java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getEntries(
161                    HttpPrincipal httpPrincipal, long groupId, long folderId, int start,
162                    int end,
163                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
164                    throws com.liferay.portal.kernel.exception.SystemException {
165                    try {
166                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
167                                            "getEntries", _getEntriesParameterTypes3);
168    
169                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
170                                            folderId, start, end, orderByComparator);
171    
172                            Object returnObj = null;
173    
174                            try {
175                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
176                            }
177                            catch (Exception e) {
178                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
179                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
180                                    }
181    
182                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
183                            }
184    
185                            return (java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry>)returnObj;
186                    }
187                    catch (com.liferay.portal.kernel.exception.SystemException se) {
188                            _log.error(se, se);
189    
190                            throw se;
191                    }
192            }
193    
194            public static int getEntriesCount(HttpPrincipal httpPrincipal,
195                    long groupId, long folderId)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    try {
198                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
199                                            "getEntriesCount", _getEntriesCountParameterTypes4);
200    
201                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
202                                            folderId);
203    
204                            Object returnObj = null;
205    
206                            try {
207                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
208                            }
209                            catch (Exception e) {
210                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
211                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
212                                    }
213    
214                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
215                            }
216    
217                            return ((Integer)returnObj).intValue();
218                    }
219                    catch (com.liferay.portal.kernel.exception.SystemException se) {
220                            _log.error(se, se);
221    
222                            throw se;
223                    }
224            }
225    
226            public static com.liferay.portlet.bookmarks.model.BookmarksEntry getEntry(
227                    HttpPrincipal httpPrincipal, long entryId)
228                    throws com.liferay.portal.kernel.exception.PortalException,
229                            com.liferay.portal.kernel.exception.SystemException {
230                    try {
231                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
232                                            "getEntry", _getEntryParameterTypes5);
233    
234                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
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.bookmarks.model.BookmarksEntry)returnObj;
254                    }
255                    catch (com.liferay.portal.kernel.exception.SystemException se) {
256                            _log.error(se, se);
257    
258                            throw se;
259                    }
260            }
261    
262            public static int getFoldersEntriesCount(HttpPrincipal httpPrincipal,
263                    long groupId, java.util.List<java.lang.Long> folderIds)
264                    throws com.liferay.portal.kernel.exception.SystemException {
265                    try {
266                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
267                                            "getFoldersEntriesCount",
268                                            _getFoldersEntriesCountParameterTypes6);
269    
270                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
271                                            folderIds);
272    
273                            Object returnObj = null;
274    
275                            try {
276                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
277                            }
278                            catch (Exception e) {
279                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
280                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
281                                    }
282    
283                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
284                            }
285    
286                            return ((Integer)returnObj).intValue();
287                    }
288                    catch (com.liferay.portal.kernel.exception.SystemException se) {
289                            _log.error(se, se);
290    
291                            throw se;
292                    }
293            }
294    
295            public static java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getGroupEntries(
296                    HttpPrincipal httpPrincipal, long groupId, int start, int end)
297                    throws com.liferay.portal.kernel.exception.SystemException {
298                    try {
299                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
300                                            "getGroupEntries", _getGroupEntriesParameterTypes7);
301    
302                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
303                                            start, end);
304    
305                            Object returnObj = null;
306    
307                            try {
308                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
309                            }
310                            catch (Exception e) {
311                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
312                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
313                                    }
314    
315                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
316                            }
317    
318                            return (java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry>)returnObj;
319                    }
320                    catch (com.liferay.portal.kernel.exception.SystemException se) {
321                            _log.error(se, se);
322    
323                            throw se;
324                    }
325            }
326    
327            public static java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry> getGroupEntries(
328                    HttpPrincipal httpPrincipal, long groupId, long userId, int start,
329                    int end) throws com.liferay.portal.kernel.exception.SystemException {
330                    try {
331                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
332                                            "getGroupEntries", _getGroupEntriesParameterTypes8);
333    
334                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
335                                            userId, start, end);
336    
337                            Object returnObj = null;
338    
339                            try {
340                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
341                            }
342                            catch (Exception e) {
343                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
344                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
345                                    }
346    
347                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
348                            }
349    
350                            return (java.util.List<com.liferay.portlet.bookmarks.model.BookmarksEntry>)returnObj;
351                    }
352                    catch (com.liferay.portal.kernel.exception.SystemException se) {
353                            _log.error(se, se);
354    
355                            throw se;
356                    }
357            }
358    
359            public static int getGroupEntriesCount(HttpPrincipal httpPrincipal,
360                    long groupId)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    try {
363                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
364                                            "getGroupEntriesCount", _getGroupEntriesCountParameterTypes9);
365    
366                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
367    
368                            Object returnObj = null;
369    
370                            try {
371                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
372                            }
373                            catch (Exception e) {
374                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
375                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
376                                    }
377    
378                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
379                            }
380    
381                            return ((Integer)returnObj).intValue();
382                    }
383                    catch (com.liferay.portal.kernel.exception.SystemException se) {
384                            _log.error(se, se);
385    
386                            throw se;
387                    }
388            }
389    
390            public static int getGroupEntriesCount(HttpPrincipal httpPrincipal,
391                    long groupId, long userId)
392                    throws com.liferay.portal.kernel.exception.SystemException {
393                    try {
394                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
395                                            "getGroupEntriesCount",
396                                            _getGroupEntriesCountParameterTypes10);
397    
398                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
399                                            userId);
400    
401                            Object returnObj = null;
402    
403                            try {
404                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
405                            }
406                            catch (Exception e) {
407                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
408                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
409                                    }
410    
411                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
412                            }
413    
414                            return ((Integer)returnObj).intValue();
415                    }
416                    catch (com.liferay.portal.kernel.exception.SystemException se) {
417                            _log.error(se, se);
418    
419                            throw se;
420                    }
421            }
422    
423            public static com.liferay.portlet.bookmarks.model.BookmarksEntry openEntry(
424                    HttpPrincipal httpPrincipal, long entryId)
425                    throws com.liferay.portal.kernel.exception.PortalException,
426                            com.liferay.portal.kernel.exception.SystemException {
427                    try {
428                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
429                                            "openEntry", _openEntryParameterTypes11);
430    
431                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
432    
433                            Object returnObj = null;
434    
435                            try {
436                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
437                            }
438                            catch (Exception e) {
439                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
440                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
441                                    }
442    
443                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
444                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
445                                    }
446    
447                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
448                            }
449    
450                            return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
451                    }
452                    catch (com.liferay.portal.kernel.exception.SystemException se) {
453                            _log.error(se, se);
454    
455                            throw se;
456                    }
457            }
458    
459            public static void subscribeEntry(HttpPrincipal httpPrincipal, long entryId)
460                    throws com.liferay.portal.kernel.exception.PortalException,
461                            com.liferay.portal.kernel.exception.SystemException {
462                    try {
463                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
464                                            "subscribeEntry", _subscribeEntryParameterTypes12);
465    
466                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
467    
468                            try {
469                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
470                            }
471                            catch (Exception e) {
472                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
473                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
474                                    }
475    
476                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
477                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
478                                    }
479    
480                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
481                            }
482                    }
483                    catch (com.liferay.portal.kernel.exception.SystemException se) {
484                            _log.error(se, se);
485    
486                            throw se;
487                    }
488            }
489    
490            public static void unsubscribeEntry(HttpPrincipal httpPrincipal,
491                    long entryId)
492                    throws com.liferay.portal.kernel.exception.PortalException,
493                            com.liferay.portal.kernel.exception.SystemException {
494                    try {
495                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
496                                            "unsubscribeEntry", _unsubscribeEntryParameterTypes13);
497    
498                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
499    
500                            try {
501                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
502                            }
503                            catch (Exception e) {
504                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
505                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
506                                    }
507    
508                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
509                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
510                                    }
511    
512                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
513                            }
514                    }
515                    catch (com.liferay.portal.kernel.exception.SystemException se) {
516                            _log.error(se, se);
517    
518                            throw se;
519                    }
520            }
521    
522            public static com.liferay.portlet.bookmarks.model.BookmarksEntry updateEntry(
523                    HttpPrincipal httpPrincipal, long entryId, long groupId, long folderId,
524                    java.lang.String name, java.lang.String url,
525                    java.lang.String description,
526                    com.liferay.portal.service.ServiceContext serviceContext)
527                    throws com.liferay.portal.kernel.exception.PortalException,
528                            com.liferay.portal.kernel.exception.SystemException {
529                    try {
530                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
531                                            "updateEntry", _updateEntryParameterTypes14);
532    
533                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
534                                            groupId, folderId, name, url, description, serviceContext);
535    
536                            Object returnObj = null;
537    
538                            try {
539                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
540                            }
541                            catch (Exception e) {
542                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
543                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
544                                    }
545    
546                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
547                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
548                                    }
549    
550                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
551                            }
552    
553                            return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
554                    }
555                    catch (com.liferay.portal.kernel.exception.SystemException se) {
556                            _log.error(se, se);
557    
558                            throw se;
559                    }
560            }
561    
562            private static Log _log = LogFactoryUtil.getLog(BookmarksEntryServiceHttp.class);
563            private static final Class<?>[] _addEntryParameterTypes0 = new Class[] {
564                            long.class, long.class, java.lang.String.class,
565                            java.lang.String.class, java.lang.String.class,
566                            com.liferay.portal.service.ServiceContext.class
567                    };
568            private static final Class<?>[] _deleteEntryParameterTypes1 = new Class[] {
569                            long.class
570                    };
571            private static final Class<?>[] _getEntriesParameterTypes2 = new Class[] {
572                            long.class, long.class, int.class, int.class
573                    };
574            private static final Class<?>[] _getEntriesParameterTypes3 = new Class[] {
575                            long.class, long.class, int.class, int.class,
576                            com.liferay.portal.kernel.util.OrderByComparator.class
577                    };
578            private static final Class<?>[] _getEntriesCountParameterTypes4 = new Class[] {
579                            long.class, long.class
580                    };
581            private static final Class<?>[] _getEntryParameterTypes5 = new Class[] {
582                            long.class
583                    };
584            private static final Class<?>[] _getFoldersEntriesCountParameterTypes6 = new Class[] {
585                            long.class, java.util.List.class
586                    };
587            private static final Class<?>[] _getGroupEntriesParameterTypes7 = new Class[] {
588                            long.class, int.class, int.class
589                    };
590            private static final Class<?>[] _getGroupEntriesParameterTypes8 = new Class[] {
591                            long.class, long.class, int.class, int.class
592                    };
593            private static final Class<?>[] _getGroupEntriesCountParameterTypes9 = new Class[] {
594                            long.class
595                    };
596            private static final Class<?>[] _getGroupEntriesCountParameterTypes10 = new Class[] {
597                            long.class, long.class
598                    };
599            private static final Class<?>[] _openEntryParameterTypes11 = new Class[] {
600                            long.class
601                    };
602            private static final Class<?>[] _subscribeEntryParameterTypes12 = new Class[] {
603                            long.class
604                    };
605            private static final Class<?>[] _unsubscribeEntryParameterTypes13 = new Class[] {
606                            long.class
607                    };
608            private static final Class<?>[] _updateEntryParameterTypes14 = new Class[] {
609                            long.class, long.class, long.class, java.lang.String.class,
610                            java.lang.String.class, java.lang.String.class,
611                            com.liferay.portal.service.ServiceContext.class
612                    };
613    }