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.MBBanServiceUtil;
25
26
63 public class MBBanServiceHttp {
64 public static com.liferay.portlet.messageboards.model.MBBan addBan(
65 HttpPrincipal httpPrincipal, long banUserId,
66 com.liferay.portal.service.ServiceContext serviceContext)
67 throws com.liferay.portal.PortalException,
68 com.liferay.portal.SystemException {
69 try {
70 MethodKey methodKey = new MethodKey(MBBanServiceUtil.class.getName(),
71 "addBan", _addBanParameterTypes0);
72
73 MethodHandler methodHandler = new MethodHandler(methodKey,
74 banUserId, serviceContext);
75
76 Object returnObj = null;
77
78 try {
79 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
80 }
81 catch (Exception e) {
82 if (e instanceof com.liferay.portal.PortalException) {
83 throw (com.liferay.portal.PortalException)e;
84 }
85
86 if (e instanceof com.liferay.portal.SystemException) {
87 throw (com.liferay.portal.SystemException)e;
88 }
89
90 throw new com.liferay.portal.SystemException(e);
91 }
92
93 return (com.liferay.portlet.messageboards.model.MBBan)returnObj;
94 }
95 catch (com.liferay.portal.SystemException se) {
96 _log.error(se, se);
97
98 throw se;
99 }
100 }
101
102 public static void deleteBan(HttpPrincipal httpPrincipal, long banUserId,
103 com.liferay.portal.service.ServiceContext serviceContext)
104 throws com.liferay.portal.PortalException,
105 com.liferay.portal.SystemException {
106 try {
107 MethodKey methodKey = new MethodKey(MBBanServiceUtil.class.getName(),
108 "deleteBan", _deleteBanParameterTypes1);
109
110 MethodHandler methodHandler = new MethodHandler(methodKey,
111 banUserId, serviceContext);
112
113 try {
114 TunnelUtil.invoke(httpPrincipal, methodHandler);
115 }
116 catch (Exception e) {
117 if (e instanceof com.liferay.portal.PortalException) {
118 throw (com.liferay.portal.PortalException)e;
119 }
120
121 if (e instanceof com.liferay.portal.SystemException) {
122 throw (com.liferay.portal.SystemException)e;
123 }
124
125 throw new com.liferay.portal.SystemException(e);
126 }
127 }
128 catch (com.liferay.portal.SystemException se) {
129 _log.error(se, se);
130
131 throw se;
132 }
133 }
134
135 private static Log _log = LogFactoryUtil.getLog(MBBanServiceHttp.class);
136 private static final Class<?>[] _addBanParameterTypes0 = new Class[] {
137 long.class, com.liferay.portal.service.ServiceContext.class
138 };
139 private static final Class<?>[] _deleteBanParameterTypes1 = new Class[] {
140 long.class, com.liferay.portal.service.ServiceContext.class
141 };
142 }