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