1
14
15 package com.liferay.portlet.announcements.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.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.http.TunnelUtil;
23
24 import com.liferay.portlet.announcements.service.AnnouncementsFlagServiceUtil;
25
26
63 public class AnnouncementsFlagServiceHttp {
64 public static void addFlag(HttpPrincipal httpPrincipal, long entryId,
65 int value)
66 throws com.liferay.portal.PortalException,
67 com.liferay.portal.SystemException {
68 try {
69 MethodKey methodKey = new MethodKey(AnnouncementsFlagServiceUtil.class.getName(),
70 "addFlag", _addFlagParameterTypes0);
71
72 MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
73 value);
74
75 try {
76 TunnelUtil.invoke(httpPrincipal, methodHandler);
77 }
78 catch (Exception e) {
79 if (e instanceof com.liferay.portal.PortalException) {
80 throw (com.liferay.portal.PortalException)e;
81 }
82
83 if (e instanceof com.liferay.portal.SystemException) {
84 throw (com.liferay.portal.SystemException)e;
85 }
86
87 throw new com.liferay.portal.SystemException(e);
88 }
89 }
90 catch (com.liferay.portal.SystemException se) {
91 _log.error(se, se);
92
93 throw se;
94 }
95 }
96
97 public static void deleteFlag(HttpPrincipal httpPrincipal, long flagId)
98 throws com.liferay.portal.PortalException,
99 com.liferay.portal.SystemException {
100 try {
101 MethodKey methodKey = new MethodKey(AnnouncementsFlagServiceUtil.class.getName(),
102 "deleteFlag", _deleteFlagParameterTypes1);
103
104 MethodHandler methodHandler = new MethodHandler(methodKey, flagId);
105
106 try {
107 TunnelUtil.invoke(httpPrincipal, methodHandler);
108 }
109 catch (Exception e) {
110 if (e instanceof com.liferay.portal.PortalException) {
111 throw (com.liferay.portal.PortalException)e;
112 }
113
114 if (e instanceof com.liferay.portal.SystemException) {
115 throw (com.liferay.portal.SystemException)e;
116 }
117
118 throw new com.liferay.portal.SystemException(e);
119 }
120 }
121 catch (com.liferay.portal.SystemException se) {
122 _log.error(se, se);
123
124 throw se;
125 }
126 }
127
128 public static com.liferay.portlet.announcements.model.AnnouncementsFlag getFlag(
129 HttpPrincipal httpPrincipal, long entryId, int value)
130 throws com.liferay.portal.PortalException,
131 com.liferay.portal.SystemException {
132 try {
133 MethodKey methodKey = new MethodKey(AnnouncementsFlagServiceUtil.class.getName(),
134 "getFlag", _getFlagParameterTypes2);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey, entryId,
137 value);
138
139 Object returnObj = null;
140
141 try {
142 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
143 }
144 catch (Exception e) {
145 if (e instanceof com.liferay.portal.PortalException) {
146 throw (com.liferay.portal.PortalException)e;
147 }
148
149 if (e instanceof com.liferay.portal.SystemException) {
150 throw (com.liferay.portal.SystemException)e;
151 }
152
153 throw new com.liferay.portal.SystemException(e);
154 }
155
156 return (com.liferay.portlet.announcements.model.AnnouncementsFlag)returnObj;
157 }
158 catch (com.liferay.portal.SystemException se) {
159 _log.error(se, se);
160
161 throw se;
162 }
163 }
164
165 private static Log _log = LogFactoryUtil.getLog(AnnouncementsFlagServiceHttp.class);
166 private static final Class<?>[] _addFlagParameterTypes0 = new Class[] {
167 long.class, int.class
168 };
169 private static final Class<?>[] _deleteFlagParameterTypes1 = new Class[] {
170 long.class
171 };
172 private static final Class<?>[] _getFlagParameterTypes2 = new Class[] {
173 long.class, int.class
174 };
175 }