001    /**
002     * Copyright (c) 2000-present 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.portal.service.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.MembershipRequestServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link MembershipRequestServiceUtil} 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 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 MembershipRequestServiceSoap
050     * @see HttpPrincipal
051     * @see MembershipRequestServiceUtil
052     * @generated
053     */
054    @ProviderType
055    public class MembershipRequestServiceHttp {
056            public static com.liferay.portal.model.MembershipRequest addMembershipRequest(
057                    HttpPrincipal httpPrincipal, long groupId, java.lang.String comments,
058                    com.liferay.portal.service.ServiceContext serviceContext)
059                    throws com.liferay.portal.kernel.exception.PortalException {
060                    try {
061                            MethodKey methodKey = new MethodKey(MembershipRequestServiceUtil.class,
062                                            "addMembershipRequest", _addMembershipRequestParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
065                                            comments, serviceContext);
066    
067                            Object returnObj = null;
068    
069                            try {
070                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
071                            }
072                            catch (Exception e) {
073                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
074                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
075                                    }
076    
077                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
078                            }
079    
080                            return (com.liferay.portal.model.MembershipRequest)returnObj;
081                    }
082                    catch (com.liferay.portal.kernel.exception.SystemException se) {
083                            _log.error(se, se);
084    
085                            throw se;
086                    }
087            }
088    
089            public static void deleteMembershipRequests(HttpPrincipal httpPrincipal,
090                    long groupId, long statusId)
091                    throws com.liferay.portal.kernel.exception.PortalException {
092                    try {
093                            MethodKey methodKey = new MethodKey(MembershipRequestServiceUtil.class,
094                                            "deleteMembershipRequests",
095                                            _deleteMembershipRequestsParameterTypes1);
096    
097                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
098                                            statusId);
099    
100                            try {
101                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
102                            }
103                            catch (Exception e) {
104                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
105                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
106                                    }
107    
108                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
109                            }
110                    }
111                    catch (com.liferay.portal.kernel.exception.SystemException se) {
112                            _log.error(se, se);
113    
114                            throw se;
115                    }
116            }
117    
118            public static com.liferay.portal.model.MembershipRequest getMembershipRequest(
119                    HttpPrincipal httpPrincipal, long membershipRequestId)
120                    throws com.liferay.portal.kernel.exception.PortalException {
121                    try {
122                            MethodKey methodKey = new MethodKey(MembershipRequestServiceUtil.class,
123                                            "getMembershipRequest", _getMembershipRequestParameterTypes2);
124    
125                            MethodHandler methodHandler = new MethodHandler(methodKey,
126                                            membershipRequestId);
127    
128                            Object returnObj = null;
129    
130                            try {
131                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
132                            }
133                            catch (Exception e) {
134                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
135                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
136                                    }
137    
138                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
139                            }
140    
141                            return (com.liferay.portal.model.MembershipRequest)returnObj;
142                    }
143                    catch (com.liferay.portal.kernel.exception.SystemException se) {
144                            _log.error(se, se);
145    
146                            throw se;
147                    }
148            }
149    
150            public static void updateStatus(HttpPrincipal httpPrincipal,
151                    long membershipRequestId, java.lang.String reviewComments,
152                    long statusId, com.liferay.portal.service.ServiceContext serviceContext)
153                    throws com.liferay.portal.kernel.exception.PortalException {
154                    try {
155                            MethodKey methodKey = new MethodKey(MembershipRequestServiceUtil.class,
156                                            "updateStatus", _updateStatusParameterTypes3);
157    
158                            MethodHandler methodHandler = new MethodHandler(methodKey,
159                                            membershipRequestId, reviewComments, statusId,
160                                            serviceContext);
161    
162                            try {
163                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
164                            }
165                            catch (Exception e) {
166                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
167                                            throw (com.liferay.portal.kernel.exception.PortalException)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            private static Log _log = LogFactoryUtil.getLog(MembershipRequestServiceHttp.class);
181            private static final Class<?>[] _addMembershipRequestParameterTypes0 = new Class[] {
182                            long.class, java.lang.String.class,
183                            com.liferay.portal.service.ServiceContext.class
184                    };
185            private static final Class<?>[] _deleteMembershipRequestsParameterTypes1 = new Class[] {
186                            long.class, long.class
187                    };
188            private static final Class<?>[] _getMembershipRequestParameterTypes2 = new Class[] {
189                            long.class
190                    };
191            private static final Class<?>[] _updateStatusParameterTypes3 = new Class[] {
192                            long.class, java.lang.String.class, long.class,
193                            com.liferay.portal.service.ServiceContext.class
194                    };
195    }