PageRenderTime 53ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/portal-impl/src/com/liferay/portal/service/http/MembershipRequestServiceHttp.java

http://github.com/liferay/liferay-portal
Java | 229 lines | 147 code | 42 blank | 40 comment | 4 complexity | 6fb84754f7147cf834c610c35d76f9a8 MD5 | raw file
Possible License(s): LGPL-2.0
  1. /**
  2. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.portal.service.http;
  15. import com.liferay.portal.kernel.log.Log;
  16. import com.liferay.portal.kernel.log.LogFactoryUtil;
  17. import com.liferay.portal.kernel.security.auth.HttpPrincipal;
  18. import com.liferay.portal.kernel.service.MembershipRequestServiceUtil;
  19. import com.liferay.portal.kernel.service.http.TunnelUtil;
  20. import com.liferay.portal.kernel.util.MethodHandler;
  21. import com.liferay.portal.kernel.util.MethodKey;
  22. /**
  23. * Provides the HTTP utility for the
  24. * <code>MembershipRequestServiceUtil</code> service
  25. * utility. The
  26. * static methods of this class calls the same methods of the service utility.
  27. * However, the signatures are different because it requires an additional
  28. * <code>HttpPrincipal</code> parameter.
  29. *
  30. * <p>
  31. * The benefits of using the HTTP utility is that it is fast and allows for
  32. * tunneling without the cost of serializing to text. The drawback is that it
  33. * only works with Java.
  34. * </p>
  35. *
  36. * <p>
  37. * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
  38. * configure security.
  39. * </p>
  40. *
  41. * <p>
  42. * The HTTP utility is only generated for remote services.
  43. * </p>
  44. *
  45. * @author Brian Wing Shun Chan
  46. * @see MembershipRequestServiceSoap
  47. * @generated
  48. */
  49. public class MembershipRequestServiceHttp {
  50. public static com.liferay.portal.kernel.model.MembershipRequest
  51. addMembershipRequest(
  52. HttpPrincipal httpPrincipal, long groupId, String comments,
  53. com.liferay.portal.kernel.service.ServiceContext serviceContext)
  54. throws com.liferay.portal.kernel.exception.PortalException {
  55. try {
  56. MethodKey methodKey = new MethodKey(
  57. MembershipRequestServiceUtil.class, "addMembershipRequest",
  58. _addMembershipRequestParameterTypes0);
  59. MethodHandler methodHandler = new MethodHandler(
  60. methodKey, groupId, comments, serviceContext);
  61. Object returnObj = null;
  62. try {
  63. returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
  64. }
  65. catch (Exception exception) {
  66. if (exception instanceof
  67. com.liferay.portal.kernel.exception.PortalException) {
  68. throw (com.liferay.portal.kernel.exception.PortalException)
  69. exception;
  70. }
  71. throw new com.liferay.portal.kernel.exception.SystemException(
  72. exception);
  73. }
  74. return (com.liferay.portal.kernel.model.MembershipRequest)returnObj;
  75. }
  76. catch (com.liferay.portal.kernel.exception.SystemException
  77. systemException) {
  78. _log.error(systemException, systemException);
  79. throw systemException;
  80. }
  81. }
  82. public static void deleteMembershipRequests(
  83. HttpPrincipal httpPrincipal, long groupId, long statusId)
  84. throws com.liferay.portal.kernel.exception.PortalException {
  85. try {
  86. MethodKey methodKey = new MethodKey(
  87. MembershipRequestServiceUtil.class, "deleteMembershipRequests",
  88. _deleteMembershipRequestsParameterTypes1);
  89. MethodHandler methodHandler = new MethodHandler(
  90. methodKey, groupId, statusId);
  91. try {
  92. TunnelUtil.invoke(httpPrincipal, methodHandler);
  93. }
  94. catch (Exception exception) {
  95. if (exception instanceof
  96. com.liferay.portal.kernel.exception.PortalException) {
  97. throw (com.liferay.portal.kernel.exception.PortalException)
  98. exception;
  99. }
  100. throw new com.liferay.portal.kernel.exception.SystemException(
  101. exception);
  102. }
  103. }
  104. catch (com.liferay.portal.kernel.exception.SystemException
  105. systemException) {
  106. _log.error(systemException, systemException);
  107. throw systemException;
  108. }
  109. }
  110. public static com.liferay.portal.kernel.model.MembershipRequest
  111. getMembershipRequest(
  112. HttpPrincipal httpPrincipal, long membershipRequestId)
  113. throws com.liferay.portal.kernel.exception.PortalException {
  114. try {
  115. MethodKey methodKey = new MethodKey(
  116. MembershipRequestServiceUtil.class, "getMembershipRequest",
  117. _getMembershipRequestParameterTypes2);
  118. MethodHandler methodHandler = new MethodHandler(
  119. methodKey, membershipRequestId);
  120. Object returnObj = null;
  121. try {
  122. returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
  123. }
  124. catch (Exception exception) {
  125. if (exception instanceof
  126. com.liferay.portal.kernel.exception.PortalException) {
  127. throw (com.liferay.portal.kernel.exception.PortalException)
  128. exception;
  129. }
  130. throw new com.liferay.portal.kernel.exception.SystemException(
  131. exception);
  132. }
  133. return (com.liferay.portal.kernel.model.MembershipRequest)returnObj;
  134. }
  135. catch (com.liferay.portal.kernel.exception.SystemException
  136. systemException) {
  137. _log.error(systemException, systemException);
  138. throw systemException;
  139. }
  140. }
  141. public static void updateStatus(
  142. HttpPrincipal httpPrincipal, long membershipRequestId,
  143. String reviewComments, long statusId,
  144. com.liferay.portal.kernel.service.ServiceContext serviceContext)
  145. throws com.liferay.portal.kernel.exception.PortalException {
  146. try {
  147. MethodKey methodKey = new MethodKey(
  148. MembershipRequestServiceUtil.class, "updateStatus",
  149. _updateStatusParameterTypes3);
  150. MethodHandler methodHandler = new MethodHandler(
  151. methodKey, membershipRequestId, reviewComments, statusId,
  152. serviceContext);
  153. try {
  154. TunnelUtil.invoke(httpPrincipal, methodHandler);
  155. }
  156. catch (Exception exception) {
  157. if (exception instanceof
  158. com.liferay.portal.kernel.exception.PortalException) {
  159. throw (com.liferay.portal.kernel.exception.PortalException)
  160. exception;
  161. }
  162. throw new com.liferay.portal.kernel.exception.SystemException(
  163. exception);
  164. }
  165. }
  166. catch (com.liferay.portal.kernel.exception.SystemException
  167. systemException) {
  168. _log.error(systemException, systemException);
  169. throw systemException;
  170. }
  171. }
  172. private static Log _log = LogFactoryUtil.getLog(
  173. MembershipRequestServiceHttp.class);
  174. private static final Class<?>[] _addMembershipRequestParameterTypes0 =
  175. new Class[] {
  176. long.class, String.class,
  177. com.liferay.portal.kernel.service.ServiceContext.class
  178. };
  179. private static final Class<?>[] _deleteMembershipRequestsParameterTypes1 =
  180. new Class[] {long.class, long.class};
  181. private static final Class<?>[] _getMembershipRequestParameterTypes2 =
  182. new Class[] {long.class};
  183. private static final Class<?>[] _updateStatusParameterTypes3 = new Class[] {
  184. long.class, String.class, long.class,
  185. com.liferay.portal.kernel.service.ServiceContext.class
  186. };
  187. }