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.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.http.TunnelUtil;
023
024 import com.liferay.portlet.messageboards.service.MBMessageFlagServiceUtil;
025
026
056 public class MBMessageFlagServiceHttp {
057 public static void addAnswerFlag(HttpPrincipal httpPrincipal, long messageId)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 MethodKey methodKey = new MethodKey(MBMessageFlagServiceUtil.class.getName(),
062 "addAnswerFlag", long.class);
063
064 MethodHandler methodHandler = new MethodHandler(methodKey, messageId);
065
066 try {
067 TunnelUtil.invoke(httpPrincipal, methodHandler);
068 }
069 catch (Exception e) {
070 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071 throw (com.liferay.portal.kernel.exception.PortalException)e;
072 }
073
074 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075 throw (com.liferay.portal.kernel.exception.SystemException)e;
076 }
077
078 throw new com.liferay.portal.kernel.exception.SystemException(e);
079 }
080 }
081 catch (com.liferay.portal.kernel.exception.SystemException se) {
082 _log.error(se, se);
083
084 throw se;
085 }
086 }
087
088 public static void deleteAnswerFlag(HttpPrincipal httpPrincipal,
089 long messageId)
090 throws com.liferay.portal.kernel.exception.PortalException,
091 com.liferay.portal.kernel.exception.SystemException {
092 try {
093 MethodKey methodKey = new MethodKey(MBMessageFlagServiceUtil.class.getName(),
094 "deleteAnswerFlag", long.class);
095
096 MethodHandler methodHandler = new MethodHandler(methodKey, messageId);
097
098 try {
099 TunnelUtil.invoke(httpPrincipal, methodHandler);
100 }
101 catch (Exception e) {
102 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
103 throw (com.liferay.portal.kernel.exception.PortalException)e;
104 }
105
106 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
107 throw (com.liferay.portal.kernel.exception.SystemException)e;
108 }
109
110 throw new com.liferay.portal.kernel.exception.SystemException(e);
111 }
112 }
113 catch (com.liferay.portal.kernel.exception.SystemException se) {
114 _log.error(se, se);
115
116 throw se;
117 }
118 }
119
120 private static Log _log = LogFactoryUtil.getLog(MBMessageFlagServiceHttp.class);
121 }