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