/modules/apps/archived/screens-service/src/main/java/com/liferay/screens/service/http/ScreensDDLRecordServiceHttp.java

http://github.com/liferay/liferay-portal · Java · 286 lines · 190 code · 56 blank · 40 comment · 5 complexity · aea3b1ee1709ea0b6d05dc065ba9d4c5 MD5 · raw file

  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.screens.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.http.TunnelUtil;
  19. import com.liferay.portal.kernel.util.MethodHandler;
  20. import com.liferay.portal.kernel.util.MethodKey;
  21. import com.liferay.screens.service.ScreensDDLRecordServiceUtil;
  22. /**
  23. * Provides the HTTP utility for the
  24. * <code>ScreensDDLRecordServiceUtil</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 José Manuel Navarro
  46. * @see ScreensDDLRecordServiceSoap
  47. * @generated
  48. */
  49. public class ScreensDDLRecordServiceHttp {
  50. public static com.liferay.portal.kernel.json.JSONObject getDDLRecord(
  51. HttpPrincipal httpPrincipal, long ddlRecordId,
  52. java.util.Locale locale)
  53. throws com.liferay.portal.kernel.exception.PortalException {
  54. try {
  55. MethodKey methodKey = new MethodKey(
  56. ScreensDDLRecordServiceUtil.class, "getDDLRecord",
  57. _getDDLRecordParameterTypes0);
  58. MethodHandler methodHandler = new MethodHandler(
  59. methodKey, ddlRecordId, locale);
  60. Object returnObj = null;
  61. try {
  62. returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
  63. }
  64. catch (Exception exception) {
  65. if (exception instanceof
  66. com.liferay.portal.kernel.exception.PortalException) {
  67. throw (com.liferay.portal.kernel.exception.PortalException)
  68. exception;
  69. }
  70. throw new com.liferay.portal.kernel.exception.SystemException(
  71. exception);
  72. }
  73. return (com.liferay.portal.kernel.json.JSONObject)returnObj;
  74. }
  75. catch (com.liferay.portal.kernel.exception.SystemException
  76. systemException) {
  77. _log.error(systemException, systemException);
  78. throw systemException;
  79. }
  80. }
  81. public static com.liferay.portal.kernel.json.JSONArray getDDLRecords(
  82. HttpPrincipal httpPrincipal, long ddlRecordSetId,
  83. java.util.Locale locale, int start, int end,
  84. com.liferay.portal.kernel.util.OrderByComparator
  85. <com.liferay.dynamic.data.lists.model.DDLRecord>
  86. orderByComparator)
  87. throws com.liferay.portal.kernel.exception.PortalException {
  88. try {
  89. MethodKey methodKey = new MethodKey(
  90. ScreensDDLRecordServiceUtil.class, "getDDLRecords",
  91. _getDDLRecordsParameterTypes1);
  92. MethodHandler methodHandler = new MethodHandler(
  93. methodKey, ddlRecordSetId, locale, start, end,
  94. orderByComparator);
  95. Object returnObj = null;
  96. try {
  97. returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
  98. }
  99. catch (Exception exception) {
  100. if (exception instanceof
  101. com.liferay.portal.kernel.exception.PortalException) {
  102. throw (com.liferay.portal.kernel.exception.PortalException)
  103. exception;
  104. }
  105. throw new com.liferay.portal.kernel.exception.SystemException(
  106. exception);
  107. }
  108. return (com.liferay.portal.kernel.json.JSONArray)returnObj;
  109. }
  110. catch (com.liferay.portal.kernel.exception.SystemException
  111. systemException) {
  112. _log.error(systemException, systemException);
  113. throw systemException;
  114. }
  115. }
  116. public static com.liferay.portal.kernel.json.JSONArray getDDLRecords(
  117. HttpPrincipal httpPrincipal, long ddlRecordSetId, long userId,
  118. java.util.Locale locale, int start, int end,
  119. com.liferay.portal.kernel.util.OrderByComparator
  120. <com.liferay.dynamic.data.lists.model.DDLRecord>
  121. orderByComparator)
  122. throws com.liferay.portal.kernel.exception.PortalException {
  123. try {
  124. MethodKey methodKey = new MethodKey(
  125. ScreensDDLRecordServiceUtil.class, "getDDLRecords",
  126. _getDDLRecordsParameterTypes2);
  127. MethodHandler methodHandler = new MethodHandler(
  128. methodKey, ddlRecordSetId, userId, locale, start, end,
  129. orderByComparator);
  130. Object returnObj = null;
  131. try {
  132. returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
  133. }
  134. catch (Exception exception) {
  135. if (exception instanceof
  136. com.liferay.portal.kernel.exception.PortalException) {
  137. throw (com.liferay.portal.kernel.exception.PortalException)
  138. exception;
  139. }
  140. throw new com.liferay.portal.kernel.exception.SystemException(
  141. exception);
  142. }
  143. return (com.liferay.portal.kernel.json.JSONArray)returnObj;
  144. }
  145. catch (com.liferay.portal.kernel.exception.SystemException
  146. systemException) {
  147. _log.error(systemException, systemException);
  148. throw systemException;
  149. }
  150. }
  151. public static int getDDLRecordsCount(
  152. HttpPrincipal httpPrincipal, long ddlRecordSetId)
  153. throws com.liferay.portal.kernel.exception.PortalException {
  154. try {
  155. MethodKey methodKey = new MethodKey(
  156. ScreensDDLRecordServiceUtil.class, "getDDLRecordsCount",
  157. _getDDLRecordsCountParameterTypes3);
  158. MethodHandler methodHandler = new MethodHandler(
  159. methodKey, ddlRecordSetId);
  160. Object returnObj = null;
  161. try {
  162. returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
  163. }
  164. catch (Exception exception) {
  165. if (exception instanceof
  166. com.liferay.portal.kernel.exception.PortalException) {
  167. throw (com.liferay.portal.kernel.exception.PortalException)
  168. exception;
  169. }
  170. throw new com.liferay.portal.kernel.exception.SystemException(
  171. exception);
  172. }
  173. return ((Integer)returnObj).intValue();
  174. }
  175. catch (com.liferay.portal.kernel.exception.SystemException
  176. systemException) {
  177. _log.error(systemException, systemException);
  178. throw systemException;
  179. }
  180. }
  181. public static int getDDLRecordsCount(
  182. HttpPrincipal httpPrincipal, long ddlRecordSetId, long userId)
  183. throws com.liferay.portal.kernel.exception.PortalException {
  184. try {
  185. MethodKey methodKey = new MethodKey(
  186. ScreensDDLRecordServiceUtil.class, "getDDLRecordsCount",
  187. _getDDLRecordsCountParameterTypes4);
  188. MethodHandler methodHandler = new MethodHandler(
  189. methodKey, ddlRecordSetId, userId);
  190. Object returnObj = null;
  191. try {
  192. returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
  193. }
  194. catch (Exception exception) {
  195. if (exception instanceof
  196. com.liferay.portal.kernel.exception.PortalException) {
  197. throw (com.liferay.portal.kernel.exception.PortalException)
  198. exception;
  199. }
  200. throw new com.liferay.portal.kernel.exception.SystemException(
  201. exception);
  202. }
  203. return ((Integer)returnObj).intValue();
  204. }
  205. catch (com.liferay.portal.kernel.exception.SystemException
  206. systemException) {
  207. _log.error(systemException, systemException);
  208. throw systemException;
  209. }
  210. }
  211. private static Log _log = LogFactoryUtil.getLog(
  212. ScreensDDLRecordServiceHttp.class);
  213. private static final Class<?>[] _getDDLRecordParameterTypes0 = new Class[] {
  214. long.class, java.util.Locale.class
  215. };
  216. private static final Class<?>[] _getDDLRecordsParameterTypes1 =
  217. new Class[] {
  218. long.class, java.util.Locale.class, int.class, int.class,
  219. com.liferay.portal.kernel.util.OrderByComparator.class
  220. };
  221. private static final Class<?>[] _getDDLRecordsParameterTypes2 =
  222. new Class[] {
  223. long.class, long.class, java.util.Locale.class, int.class,
  224. int.class, com.liferay.portal.kernel.util.OrderByComparator.class
  225. };
  226. private static final Class<?>[] _getDDLRecordsCountParameterTypes3 =
  227. new Class[] {long.class};
  228. private static final Class<?>[] _getDDLRecordsCountParameterTypes4 =
  229. new Class[] {long.class, long.class};
  230. }