001
014
015 package com.liferay.portlet.messageboards.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.LongWrapper;
020 import com.liferay.portal.kernel.util.MethodWrapper;
021 import com.liferay.portal.kernel.util.NullWrapper;
022 import com.liferay.portal.security.auth.HttpPrincipal;
023 import com.liferay.portal.service.http.TunnelUtil;
024
025 import com.liferay.portlet.messageboards.service.MBBanServiceUtil;
026
027
057 public class MBBanServiceHttp {
058 public static com.liferay.portlet.messageboards.model.MBBan addBan(
059 HttpPrincipal httpPrincipal, long banUserId,
060 com.liferay.portal.service.ServiceContext serviceContext)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 Object paramObj0 = new LongWrapper(banUserId);
065
066 Object paramObj1 = serviceContext;
067
068 if (serviceContext == null) {
069 paramObj1 = new NullWrapper(
070 "com.liferay.portal.service.ServiceContext");
071 }
072
073 MethodWrapper methodWrapper = new MethodWrapper(MBBanServiceUtil.class.getName(),
074 "addBan", new Object[] { paramObj0, paramObj1 });
075
076 Object returnObj = null;
077
078 try {
079 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
080 }
081 catch (Exception e) {
082 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
083 throw (com.liferay.portal.kernel.exception.PortalException)e;
084 }
085
086 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
087 throw (com.liferay.portal.kernel.exception.SystemException)e;
088 }
089
090 throw new com.liferay.portal.kernel.exception.SystemException(e);
091 }
092
093 return (com.liferay.portlet.messageboards.model.MBBan)returnObj;
094 }
095 catch (com.liferay.portal.kernel.exception.SystemException se) {
096 _log.error(se, se);
097
098 throw se;
099 }
100 }
101
102 public static void deleteBan(HttpPrincipal httpPrincipal, long banUserId,
103 com.liferay.portal.service.ServiceContext serviceContext)
104 throws com.liferay.portal.kernel.exception.PortalException,
105 com.liferay.portal.kernel.exception.SystemException {
106 try {
107 Object paramObj0 = new LongWrapper(banUserId);
108
109 Object paramObj1 = serviceContext;
110
111 if (serviceContext == null) {
112 paramObj1 = new NullWrapper(
113 "com.liferay.portal.service.ServiceContext");
114 }
115
116 MethodWrapper methodWrapper = new MethodWrapper(MBBanServiceUtil.class.getName(),
117 "deleteBan", new Object[] { paramObj0, paramObj1 });
118
119 try {
120 TunnelUtil.invoke(httpPrincipal, methodWrapper);
121 }
122 catch (Exception e) {
123 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
124 throw (com.liferay.portal.kernel.exception.PortalException)e;
125 }
126
127 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
128 throw (com.liferay.portal.kernel.exception.SystemException)e;
129 }
130
131 throw new com.liferay.portal.kernel.exception.SystemException(e);
132 }
133 }
134 catch (com.liferay.portal.kernel.exception.SystemException se) {
135 _log.error(se, se);
136
137 throw se;
138 }
139 }
140
141 private static Log _log = LogFactoryUtil.getLog(MBBanServiceHttp.class);
142 }