1
14
15 package com.liferay.portlet.messageboards.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.LongWrapper;
20 import com.liferay.portal.kernel.util.MethodWrapper;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.http.TunnelUtil;
23
24 import com.liferay.portlet.messageboards.service.MBMessageFlagServiceUtil;
25
26
63 public class MBMessageFlagServiceHttp {
64 public static void addAnswerFlag(HttpPrincipal httpPrincipal, long messageId)
65 throws com.liferay.portal.kernel.exception.PortalException,
66 com.liferay.portal.kernel.exception.SystemException {
67 try {
68 Object paramObj0 = new LongWrapper(messageId);
69
70 MethodWrapper methodWrapper = new MethodWrapper(MBMessageFlagServiceUtil.class.getName(),
71 "addAnswerFlag", new Object[] { paramObj0 });
72
73 try {
74 TunnelUtil.invoke(httpPrincipal, methodWrapper);
75 }
76 catch (Exception e) {
77 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
78 throw (com.liferay.portal.kernel.exception.PortalException)e;
79 }
80
81 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
82 throw (com.liferay.portal.kernel.exception.SystemException)e;
83 }
84
85 throw new com.liferay.portal.kernel.exception.SystemException(e);
86 }
87 }
88 catch (com.liferay.portal.kernel.exception.SystemException se) {
89 _log.error(se, se);
90
91 throw se;
92 }
93 }
94
95 public static void deleteAnswerFlag(HttpPrincipal httpPrincipal,
96 long messageId)
97 throws com.liferay.portal.kernel.exception.PortalException,
98 com.liferay.portal.kernel.exception.SystemException {
99 try {
100 Object paramObj0 = new LongWrapper(messageId);
101
102 MethodWrapper methodWrapper = new MethodWrapper(MBMessageFlagServiceUtil.class.getName(),
103 "deleteAnswerFlag", new Object[] { paramObj0 });
104
105 try {
106 TunnelUtil.invoke(httpPrincipal, methodWrapper);
107 }
108 catch (Exception e) {
109 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
110 throw (com.liferay.portal.kernel.exception.PortalException)e;
111 }
112
113 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
114 throw (com.liferay.portal.kernel.exception.SystemException)e;
115 }
116
117 throw new com.liferay.portal.kernel.exception.SystemException(e);
118 }
119 }
120 catch (com.liferay.portal.kernel.exception.SystemException se) {
121 _log.error(se, se);
122
123 throw se;
124 }
125 }
126
127 private static Log _log = LogFactoryUtil.getLog(MBMessageFlagServiceHttp.class);
128 }