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.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.http.TunnelUtil;
23
24 import com.liferay.portlet.messageboards.service.MBThreadServiceUtil;
25
26
63 public class MBThreadServiceHttp {
64 public static void deleteThread(HttpPrincipal httpPrincipal, long threadId)
65 throws com.liferay.portal.PortalException,
66 com.liferay.portal.SystemException {
67 try {
68 MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
69 "deleteThread", _deleteThreadParameterTypes0);
70
71 MethodHandler methodHandler = new MethodHandler(methodKey, threadId);
72
73 try {
74 TunnelUtil.invoke(httpPrincipal, methodHandler);
75 }
76 catch (Exception e) {
77 if (e instanceof com.liferay.portal.PortalException) {
78 throw (com.liferay.portal.PortalException)e;
79 }
80
81 if (e instanceof com.liferay.portal.SystemException) {
82 throw (com.liferay.portal.SystemException)e;
83 }
84
85 throw new com.liferay.portal.SystemException(e);
86 }
87 }
88 catch (com.liferay.portal.SystemException se) {
89 _log.error(se, se);
90
91 throw se;
92 }
93 }
94
95 public static com.liferay.portal.model.Lock lockThread(
96 HttpPrincipal httpPrincipal, long threadId)
97 throws com.liferay.portal.PortalException,
98 com.liferay.portal.SystemException {
99 try {
100 MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
101 "lockThread", _lockThreadParameterTypes1);
102
103 MethodHandler methodHandler = new MethodHandler(methodKey, threadId);
104
105 Object returnObj = null;
106
107 try {
108 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
109 }
110 catch (Exception e) {
111 if (e instanceof com.liferay.portal.PortalException) {
112 throw (com.liferay.portal.PortalException)e;
113 }
114
115 if (e instanceof com.liferay.portal.SystemException) {
116 throw (com.liferay.portal.SystemException)e;
117 }
118
119 throw new com.liferay.portal.SystemException(e);
120 }
121
122 return (com.liferay.portal.model.Lock)returnObj;
123 }
124 catch (com.liferay.portal.SystemException se) {
125 _log.error(se, se);
126
127 throw se;
128 }
129 }
130
131 public static com.liferay.portlet.messageboards.model.MBThread moveThread(
132 HttpPrincipal httpPrincipal, long categoryId, long threadId)
133 throws com.liferay.portal.PortalException,
134 com.liferay.portal.SystemException {
135 try {
136 MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
137 "moveThread", _moveThreadParameterTypes2);
138
139 MethodHandler methodHandler = new MethodHandler(methodKey,
140 categoryId, threadId);
141
142 Object returnObj = null;
143
144 try {
145 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
146 }
147 catch (Exception e) {
148 if (e instanceof com.liferay.portal.PortalException) {
149 throw (com.liferay.portal.PortalException)e;
150 }
151
152 if (e instanceof com.liferay.portal.SystemException) {
153 throw (com.liferay.portal.SystemException)e;
154 }
155
156 throw new com.liferay.portal.SystemException(e);
157 }
158
159 return (com.liferay.portlet.messageboards.model.MBThread)returnObj;
160 }
161 catch (com.liferay.portal.SystemException se) {
162 _log.error(se, se);
163
164 throw se;
165 }
166 }
167
168 public static com.liferay.portlet.messageboards.model.MBThread splitThread(
169 HttpPrincipal httpPrincipal, long messageId,
170 com.liferay.portal.service.ServiceContext serviceContext)
171 throws com.liferay.portal.PortalException,
172 com.liferay.portal.SystemException {
173 try {
174 MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
175 "splitThread", _splitThreadParameterTypes3);
176
177 MethodHandler methodHandler = new MethodHandler(methodKey,
178 messageId, serviceContext);
179
180 Object returnObj = null;
181
182 try {
183 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
184 }
185 catch (Exception e) {
186 if (e instanceof com.liferay.portal.PortalException) {
187 throw (com.liferay.portal.PortalException)e;
188 }
189
190 if (e instanceof com.liferay.portal.SystemException) {
191 throw (com.liferay.portal.SystemException)e;
192 }
193
194 throw new com.liferay.portal.SystemException(e);
195 }
196
197 return (com.liferay.portlet.messageboards.model.MBThread)returnObj;
198 }
199 catch (com.liferay.portal.SystemException se) {
200 _log.error(se, se);
201
202 throw se;
203 }
204 }
205
206 public static void unlockThread(HttpPrincipal httpPrincipal, long threadId)
207 throws com.liferay.portal.PortalException,
208 com.liferay.portal.SystemException {
209 try {
210 MethodKey methodKey = new MethodKey(MBThreadServiceUtil.class.getName(),
211 "unlockThread", _unlockThreadParameterTypes4);
212
213 MethodHandler methodHandler = new MethodHandler(methodKey, threadId);
214
215 try {
216 TunnelUtil.invoke(httpPrincipal, methodHandler);
217 }
218 catch (Exception e) {
219 if (e instanceof com.liferay.portal.PortalException) {
220 throw (com.liferay.portal.PortalException)e;
221 }
222
223 if (e instanceof com.liferay.portal.SystemException) {
224 throw (com.liferay.portal.SystemException)e;
225 }
226
227 throw new com.liferay.portal.SystemException(e);
228 }
229 }
230 catch (com.liferay.portal.SystemException se) {
231 _log.error(se, se);
232
233 throw se;
234 }
235 }
236
237 private static Log _log = LogFactoryUtil.getLog(MBThreadServiceHttp.class);
238 private static final Class<?>[] _deleteThreadParameterTypes0 = new Class[] {
239 long.class
240 };
241 private static final Class<?>[] _lockThreadParameterTypes1 = new Class[] {
242 long.class
243 };
244 private static final Class<?>[] _moveThreadParameterTypes2 = new Class[] {
245 long.class, long.class
246 };
247 private static final Class<?>[] _splitThreadParameterTypes3 = new Class[] {
248 long.class, com.liferay.portal.service.ServiceContext.class
249 };
250 private static final Class<?>[] _unlockThreadParameterTypes4 = new Class[] {
251 long.class
252 };
253 }