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