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