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.MBBanServiceUtil;
25
26
63 public class MBBanServiceHttp {
64 public static com.liferay.portlet.messageboards.model.MBBan addBan(
65 HttpPrincipal httpPrincipal, long plid, long banUserId)
66 throws com.liferay.portal.PortalException,
67 com.liferay.portal.SystemException {
68 try {
69 Object paramObj0 = new LongWrapper(plid);
70
71 Object paramObj1 = new LongWrapper(banUserId);
72
73 MethodWrapper methodWrapper = new MethodWrapper(MBBanServiceUtil.class.getName(),
74 "addBan", new Object[] { paramObj0, paramObj1 });
75
76 Object returnObj = null;
77
78 try {
79 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
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 plid,
103 long banUserId)
104 throws com.liferay.portal.PortalException,
105 com.liferay.portal.SystemException {
106 try {
107 Object paramObj0 = new LongWrapper(plid);
108
109 Object paramObj1 = new LongWrapper(banUserId);
110
111 MethodWrapper methodWrapper = new MethodWrapper(MBBanServiceUtil.class.getName(),
112 "deleteBan", new Object[] { paramObj0, paramObj1 });
113
114 try {
115 TunnelUtil.invoke(httpPrincipal, methodWrapper);
116 }
117 catch (Exception e) {
118 if (e instanceof com.liferay.portal.PortalException) {
119 throw (com.liferay.portal.PortalException)e;
120 }
121
122 if (e instanceof com.liferay.portal.SystemException) {
123 throw (com.liferay.portal.SystemException)e;
124 }
125
126 throw new com.liferay.portal.SystemException(e);
127 }
128 }
129 catch (com.liferay.portal.SystemException se) {
130 _log.error(se, se);
131
132 throw se;
133 }
134 }
135
136 private static Log _log = LogFactoryUtil.getLog(MBBanServiceHttp.class);
137 }