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.kernel.util.NullWrapper;
22 import com.liferay.portal.security.auth.HttpPrincipal;
23 import com.liferay.portal.service.http.TunnelUtil;
24
25 import com.liferay.portlet.messageboards.service.MBBanServiceUtil;
26
27
64 public class MBBanServiceHttp {
65 public static com.liferay.portlet.messageboards.model.MBBan addBan(
66 HttpPrincipal httpPrincipal, long banUserId,
67 com.liferay.portal.service.ServiceContext serviceContext)
68 throws com.liferay.portal.kernel.exception.PortalException,
69 com.liferay.portal.kernel.exception.SystemException {
70 try {
71 Object paramObj0 = new LongWrapper(banUserId);
72
73 Object paramObj1 = serviceContext;
74
75 if (serviceContext == null) {
76 paramObj1 = new NullWrapper(
77 "com.liferay.portal.service.ServiceContext");
78 }
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.kernel.exception.PortalException) {
90 throw (com.liferay.portal.kernel.exception.PortalException)e;
91 }
92
93 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
94 throw (com.liferay.portal.kernel.exception.SystemException)e;
95 }
96
97 throw new com.liferay.portal.kernel.exception.SystemException(e);
98 }
99
100 return (com.liferay.portlet.messageboards.model.MBBan)returnObj;
101 }
102 catch (com.liferay.portal.kernel.exception.SystemException se) {
103 _log.error(se, se);
104
105 throw se;
106 }
107 }
108
109 public static void deleteBan(HttpPrincipal httpPrincipal, long banUserId,
110 com.liferay.portal.service.ServiceContext serviceContext)
111 throws com.liferay.portal.kernel.exception.PortalException,
112 com.liferay.portal.kernel.exception.SystemException {
113 try {
114 Object paramObj0 = new LongWrapper(banUserId);
115
116 Object paramObj1 = serviceContext;
117
118 if (serviceContext == null) {
119 paramObj1 = new NullWrapper(
120 "com.liferay.portal.service.ServiceContext");
121 }
122
123 MethodWrapper methodWrapper = new MethodWrapper(MBBanServiceUtil.class.getName(),
124 "deleteBan", new Object[] { paramObj0, paramObj1 });
125
126 try {
127 TunnelUtil.invoke(httpPrincipal, methodWrapper);
128 }
129 catch (Exception e) {
130 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
131 throw (com.liferay.portal.kernel.exception.PortalException)e;
132 }
133
134 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
135 throw (com.liferay.portal.kernel.exception.SystemException)e;
136 }
137
138 throw new com.liferay.portal.kernel.exception.SystemException(e);
139 }
140 }
141 catch (com.liferay.portal.kernel.exception.SystemException se) {
142 _log.error(se, se);
143
144 throw se;
145 }
146 }
147
148 private static Log _log = LogFactoryUtil.getLog(MBBanServiceHttp.class);
149 }