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.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, java.lang.String comments,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    try {
064                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
065                                            "addEntry", long.class, long.class, java.lang.String.class,
066                                            java.lang.String.class, java.lang.String.class,
067                                            com.liferay.portal.service.ServiceContext.class);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
070                                            folderId, name, url, comments, serviceContext);
071    
072                            Object returnObj = null;
073    
074                            try {
075                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076                            }
077                            catch (Exception e) {
078                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
080                                    }
081    
082                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
084                                    }
085    
086                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
087                            }
088    
089                            return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
090                    }
091                    catch (com.liferay.portal.kernel.exception.SystemException se) {
092                            _log.error(se, se);
093    
094                            throw se;
095                    }
096            }
097    
098            public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
099                    throws com.liferay.portal.kernel.exception.PortalException,
100                            com.liferay.portal.kernel.exception.SystemException {
101                    try {
102                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
103                                            "deleteEntry", long.class);
104    
105                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
106    
107                            try {
108                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
109                            }
110                            catch (Exception e) {
111                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
113                                    }
114    
115                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
116                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
117                                    }
118    
119                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
120                            }
121                    }
122                    catch (com.liferay.portal.kernel.exception.SystemException se) {
123                            _log.error(se, se);
124    
125                            throw se;
126                    }
127            }
128    
129            public static com.liferay.portlet.bookmarks.model.BookmarksEntry getEntry(
130                    HttpPrincipal httpPrincipal, long entryId)
131                    throws com.liferay.portal.kernel.exception.PortalException,
132                            com.liferay.portal.kernel.exception.SystemException {
133                    try {
134                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
135                                            "getEntry", long.class);
136    
137                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
138    
139                            Object returnObj = null;
140    
141                            try {
142                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
143                            }
144                            catch (Exception e) {
145                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
146                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
147                                    }
148    
149                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
150                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
151                                    }
152    
153                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
154                            }
155    
156                            return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
157                    }
158                    catch (com.liferay.portal.kernel.exception.SystemException se) {
159                            _log.error(se, se);
160    
161                            throw se;
162                    }
163            }
164    
165            public static com.liferay.portlet.bookmarks.model.BookmarksEntry openEntry(
166                    HttpPrincipal httpPrincipal, long entryId)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    try {
170                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
171                                            "openEntry", long.class);
172    
173                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId);
174    
175                            Object returnObj = null;
176    
177                            try {
178                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
179                            }
180                            catch (Exception e) {
181                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
182                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
183                                    }
184    
185                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
186                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
187                                    }
188    
189                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
190                            }
191    
192                            return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
193                    }
194                    catch (com.liferay.portal.kernel.exception.SystemException se) {
195                            _log.error(se, se);
196    
197                            throw se;
198                    }
199            }
200    
201            public static com.liferay.portlet.bookmarks.model.BookmarksEntry updateEntry(
202                    HttpPrincipal httpPrincipal, long entryId, long groupId, long folderId,
203                    java.lang.String name, java.lang.String url, java.lang.String comments,
204                    com.liferay.portal.service.ServiceContext serviceContext)
205                    throws com.liferay.portal.kernel.exception.PortalException,
206                            com.liferay.portal.kernel.exception.SystemException {
207                    try {
208                            MethodKey methodKey = new MethodKey(BookmarksEntryServiceUtil.class.getName(),
209                                            "updateEntry", long.class, long.class, long.class,
210                                            java.lang.String.class, java.lang.String.class,
211                                            java.lang.String.class,
212                                            com.liferay.portal.service.ServiceContext.class);
213    
214                            MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
215                                            groupId, folderId, name, url, comments, serviceContext);
216    
217                            Object returnObj = null;
218    
219                            try {
220                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
221                            }
222                            catch (Exception e) {
223                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
224                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
225                                    }
226    
227                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
228                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
229                                    }
230    
231                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
232                            }
233    
234                            return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
235                    }
236                    catch (com.liferay.portal.kernel.exception.SystemException se) {
237                            _log.error(se, se);
238    
239                            throw se;
240                    }
241            }
242    
243            private static Log _log = LogFactoryUtil.getLog(BookmarksEntryServiceHttp.class);
244    }