1
19
20 package com.liferay.portlet.messageboards.service.http;
21
22 import com.liferay.portal.kernel.log.Log;
23 import com.liferay.portal.kernel.log.LogFactoryUtil;
24 import com.liferay.portal.kernel.util.LongWrapper;
25 import com.liferay.portal.kernel.util.MethodWrapper;
26 import com.liferay.portal.security.auth.HttpPrincipal;
27 import com.liferay.portal.service.http.TunnelUtil;
28
29 import com.liferay.portlet.messageboards.service.MBBanServiceUtil;
30
31
70 public class MBBanServiceHttp {
71 public static com.liferay.portlet.messageboards.model.MBBan addBan(
72 HttpPrincipal httpPrincipal, long plid, long banUserId)
73 throws com.liferay.portal.PortalException,
74 com.liferay.portal.SystemException {
75 try {
76 Object paramObj0 = new LongWrapper(plid);
77
78 Object paramObj1 = new LongWrapper(banUserId);
79
80 MethodWrapper methodWrapper = new MethodWrapper(MBBanServiceUtil.class.getName(),
81 "addBan", new Object[] { paramObj0, paramObj1 });
82
83 Object returnObj = null;
84
85 try {
86 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
87 }
88 catch (Exception e) {
89 if (e instanceof com.liferay.portal.PortalException) {
90 throw (com.liferay.portal.PortalException)e;
91 }
92
93 if (e instanceof com.liferay.portal.SystemException) {
94 throw (com.liferay.portal.SystemException)e;
95 }
96
97 throw new com.liferay.portal.SystemException(e);
98 }
99
100 return (com.liferay.portlet.messageboards.model.MBBan)returnObj;
101 }
102 catch (com.liferay.portal.SystemException se) {
103 _log.error(se, se);
104
105 throw se;
106 }
107 }
108
109 public static void deleteBan(HttpPrincipal httpPrincipal, long plid,
110 long banUserId)
111 throws com.liferay.portal.PortalException,
112 com.liferay.portal.SystemException {
113 try {
114 Object paramObj0 = new LongWrapper(plid);
115
116 Object paramObj1 = new LongWrapper(banUserId);
117
118 MethodWrapper methodWrapper = new MethodWrapper(MBBanServiceUtil.class.getName(),
119 "deleteBan", new Object[] { paramObj0, paramObj1 });
120
121 try {
122 TunnelUtil.invoke(httpPrincipal, methodWrapper);
123 }
124 catch (Exception e) {
125 if (e instanceof com.liferay.portal.PortalException) {
126 throw (com.liferay.portal.PortalException)e;
127 }
128
129 if (e instanceof com.liferay.portal.SystemException) {
130 throw (com.liferay.portal.SystemException)e;
131 }
132
133 throw new com.liferay.portal.SystemException(e);
134 }
135 }
136 catch (com.liferay.portal.SystemException se) {
137 _log.error(se, se);
138
139 throw se;
140 }
141 }
142
143 private static Log _log = LogFactoryUtil.getLog(MBBanServiceHttp.class);
144 }