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