1
22
23 package com.liferay.portal.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.BooleanWrapper;
28 import com.liferay.portal.kernel.util.IntegerWrapper;
29 import com.liferay.portal.kernel.util.LongWrapper;
30 import com.liferay.portal.kernel.util.MethodWrapper;
31 import com.liferay.portal.kernel.util.NullWrapper;
32 import com.liferay.portal.security.auth.HttpPrincipal;
33 import com.liferay.portal.service.EmailAddressServiceUtil;
34
35
72 public class EmailAddressServiceHttp {
73 public static com.liferay.portal.model.EmailAddress addEmailAddress(
74 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
75 java.lang.String address, int typeId, boolean primary)
76 throws com.liferay.portal.PortalException,
77 com.liferay.portal.SystemException {
78 try {
79 Object paramObj0 = className;
80
81 if (className == null) {
82 paramObj0 = new NullWrapper("java.lang.String");
83 }
84
85 Object paramObj1 = new LongWrapper(classPK);
86
87 Object paramObj2 = address;
88
89 if (address == null) {
90 paramObj2 = new NullWrapper("java.lang.String");
91 }
92
93 Object paramObj3 = new IntegerWrapper(typeId);
94
95 Object paramObj4 = new BooleanWrapper(primary);
96
97 MethodWrapper methodWrapper = new MethodWrapper(EmailAddressServiceUtil.class.getName(),
98 "addEmailAddress",
99 new Object[] {
100 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
101 });
102
103 Object returnObj = null;
104
105 try {
106 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
107 }
108 catch (Exception e) {
109 if (e instanceof com.liferay.portal.PortalException) {
110 throw (com.liferay.portal.PortalException)e;
111 }
112
113 if (e instanceof com.liferay.portal.SystemException) {
114 throw (com.liferay.portal.SystemException)e;
115 }
116
117 throw new com.liferay.portal.SystemException(e);
118 }
119
120 return (com.liferay.portal.model.EmailAddress)returnObj;
121 }
122 catch (com.liferay.portal.SystemException se) {
123 _log.error(se, se);
124
125 throw se;
126 }
127 }
128
129 public static void deleteEmailAddress(HttpPrincipal httpPrincipal,
130 long emailAddressId)
131 throws com.liferay.portal.PortalException,
132 com.liferay.portal.SystemException {
133 try {
134 Object paramObj0 = new LongWrapper(emailAddressId);
135
136 MethodWrapper methodWrapper = new MethodWrapper(EmailAddressServiceUtil.class.getName(),
137 "deleteEmailAddress", new Object[] { paramObj0 });
138
139 try {
140 TunnelUtil.invoke(httpPrincipal, methodWrapper);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.PortalException) {
144 throw (com.liferay.portal.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.SystemException) {
148 throw (com.liferay.portal.SystemException)e;
149 }
150
151 throw new com.liferay.portal.SystemException(e);
152 }
153 }
154 catch (com.liferay.portal.SystemException se) {
155 _log.error(se, se);
156
157 throw se;
158 }
159 }
160
161 public static com.liferay.portal.model.EmailAddress getEmailAddress(
162 HttpPrincipal httpPrincipal, long emailAddressId)
163 throws com.liferay.portal.PortalException,
164 com.liferay.portal.SystemException {
165 try {
166 Object paramObj0 = new LongWrapper(emailAddressId);
167
168 MethodWrapper methodWrapper = new MethodWrapper(EmailAddressServiceUtil.class.getName(),
169 "getEmailAddress", new Object[] { paramObj0 });
170
171 Object returnObj = null;
172
173 try {
174 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
175 }
176 catch (Exception e) {
177 if (e instanceof com.liferay.portal.PortalException) {
178 throw (com.liferay.portal.PortalException)e;
179 }
180
181 if (e instanceof com.liferay.portal.SystemException) {
182 throw (com.liferay.portal.SystemException)e;
183 }
184
185 throw new com.liferay.portal.SystemException(e);
186 }
187
188 return (com.liferay.portal.model.EmailAddress)returnObj;
189 }
190 catch (com.liferay.portal.SystemException se) {
191 _log.error(se, se);
192
193 throw se;
194 }
195 }
196
197 public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses(
198 HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
199 throws com.liferay.portal.PortalException,
200 com.liferay.portal.SystemException {
201 try {
202 Object paramObj0 = className;
203
204 if (className == null) {
205 paramObj0 = new NullWrapper("java.lang.String");
206 }
207
208 Object paramObj1 = new LongWrapper(classPK);
209
210 MethodWrapper methodWrapper = new MethodWrapper(EmailAddressServiceUtil.class.getName(),
211 "getEmailAddresses", new Object[] { paramObj0, paramObj1 });
212
213 Object returnObj = null;
214
215 try {
216 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
217 }
218 catch (Exception e) {
219 if (e instanceof com.liferay.portal.PortalException) {
220 throw (com.liferay.portal.PortalException)e;
221 }
222
223 if (e instanceof com.liferay.portal.SystemException) {
224 throw (com.liferay.portal.SystemException)e;
225 }
226
227 throw new com.liferay.portal.SystemException(e);
228 }
229
230 return (java.util.List<com.liferay.portal.model.EmailAddress>)returnObj;
231 }
232 catch (com.liferay.portal.SystemException se) {
233 _log.error(se, se);
234
235 throw se;
236 }
237 }
238
239 public static com.liferay.portal.model.EmailAddress updateEmailAddress(
240 HttpPrincipal httpPrincipal, long emailAddressId,
241 java.lang.String address, int typeId, boolean primary)
242 throws com.liferay.portal.PortalException,
243 com.liferay.portal.SystemException {
244 try {
245 Object paramObj0 = new LongWrapper(emailAddressId);
246
247 Object paramObj1 = address;
248
249 if (address == null) {
250 paramObj1 = new NullWrapper("java.lang.String");
251 }
252
253 Object paramObj2 = new IntegerWrapper(typeId);
254
255 Object paramObj3 = new BooleanWrapper(primary);
256
257 MethodWrapper methodWrapper = new MethodWrapper(EmailAddressServiceUtil.class.getName(),
258 "updateEmailAddress",
259 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
260
261 Object returnObj = null;
262
263 try {
264 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
265 }
266 catch (Exception e) {
267 if (e instanceof com.liferay.portal.PortalException) {
268 throw (com.liferay.portal.PortalException)e;
269 }
270
271 if (e instanceof com.liferay.portal.SystemException) {
272 throw (com.liferay.portal.SystemException)e;
273 }
274
275 throw new com.liferay.portal.SystemException(e);
276 }
277
278 return (com.liferay.portal.model.EmailAddress)returnObj;
279 }
280 catch (com.liferay.portal.SystemException se) {
281 _log.error(se, se);
282
283 throw se;
284 }
285 }
286
287 private static Log _log = LogFactoryUtil.getLog(EmailAddressServiceHttp.class);
288 }