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