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.AddressServiceUtil;
26
27
64 public class AddressServiceHttp {
65 public static com.liferay.portal.model.Address addAddress(
66 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
67 java.lang.String street1, java.lang.String street2,
68 java.lang.String street3, java.lang.String city, java.lang.String zip,
69 long regionId, long countryId, int typeId, boolean mailing,
70 boolean primary)
71 throws com.liferay.portal.kernel.exception.PortalException,
72 com.liferay.portal.kernel.exception.SystemException {
73 try {
74 Object paramObj0 = className;
75
76 if (className == null) {
77 paramObj0 = new NullWrapper("java.lang.String");
78 }
79
80 Object paramObj1 = new LongWrapper(classPK);
81
82 Object paramObj2 = street1;
83
84 if (street1 == null) {
85 paramObj2 = new NullWrapper("java.lang.String");
86 }
87
88 Object paramObj3 = street2;
89
90 if (street2 == null) {
91 paramObj3 = new NullWrapper("java.lang.String");
92 }
93
94 Object paramObj4 = street3;
95
96 if (street3 == null) {
97 paramObj4 = new NullWrapper("java.lang.String");
98 }
99
100 Object paramObj5 = city;
101
102 if (city == null) {
103 paramObj5 = new NullWrapper("java.lang.String");
104 }
105
106 Object paramObj6 = zip;
107
108 if (zip == null) {
109 paramObj6 = new NullWrapper("java.lang.String");
110 }
111
112 Object paramObj7 = new LongWrapper(regionId);
113
114 Object paramObj8 = new LongWrapper(countryId);
115
116 Object paramObj9 = new IntegerWrapper(typeId);
117
118 Object paramObj10 = new BooleanWrapper(mailing);
119
120 Object paramObj11 = new BooleanWrapper(primary);
121
122 MethodWrapper methodWrapper = new MethodWrapper(AddressServiceUtil.class.getName(),
123 "addAddress",
124 new Object[] {
125 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
126 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
127 paramObj10, paramObj11
128 });
129
130 Object returnObj = null;
131
132 try {
133 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
134 }
135 catch (Exception e) {
136 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
137 throw (com.liferay.portal.kernel.exception.PortalException)e;
138 }
139
140 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
141 throw (com.liferay.portal.kernel.exception.SystemException)e;
142 }
143
144 throw new com.liferay.portal.kernel.exception.SystemException(e);
145 }
146
147 return (com.liferay.portal.model.Address)returnObj;
148 }
149 catch (com.liferay.portal.kernel.exception.SystemException se) {
150 _log.error(se, se);
151
152 throw se;
153 }
154 }
155
156 public static void deleteAddress(HttpPrincipal httpPrincipal, long addressId)
157 throws com.liferay.portal.kernel.exception.PortalException,
158 com.liferay.portal.kernel.exception.SystemException {
159 try {
160 Object paramObj0 = new LongWrapper(addressId);
161
162 MethodWrapper methodWrapper = new MethodWrapper(AddressServiceUtil.class.getName(),
163 "deleteAddress", new Object[] { paramObj0 });
164
165 try {
166 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 catch (com.liferay.portal.kernel.exception.SystemException se) {
181 _log.error(se, se);
182
183 throw se;
184 }
185 }
186
187 public static com.liferay.portal.model.Address getAddress(
188 HttpPrincipal httpPrincipal, long addressId)
189 throws com.liferay.portal.kernel.exception.PortalException,
190 com.liferay.portal.kernel.exception.SystemException {
191 try {
192 Object paramObj0 = new LongWrapper(addressId);
193
194 MethodWrapper methodWrapper = new MethodWrapper(AddressServiceUtil.class.getName(),
195 "getAddress", new Object[] { paramObj0 });
196
197 Object returnObj = null;
198
199 try {
200 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
201 }
202 catch (Exception e) {
203 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
204 throw (com.liferay.portal.kernel.exception.PortalException)e;
205 }
206
207 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
208 throw (com.liferay.portal.kernel.exception.SystemException)e;
209 }
210
211 throw new com.liferay.portal.kernel.exception.SystemException(e);
212 }
213
214 return (com.liferay.portal.model.Address)returnObj;
215 }
216 catch (com.liferay.portal.kernel.exception.SystemException se) {
217 _log.error(se, se);
218
219 throw se;
220 }
221 }
222
223 public static java.util.List<com.liferay.portal.model.Address> getAddresses(
224 HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
225 throws com.liferay.portal.kernel.exception.PortalException,
226 com.liferay.portal.kernel.exception.SystemException {
227 try {
228 Object paramObj0 = className;
229
230 if (className == null) {
231 paramObj0 = new NullWrapper("java.lang.String");
232 }
233
234 Object paramObj1 = new LongWrapper(classPK);
235
236 MethodWrapper methodWrapper = new MethodWrapper(AddressServiceUtil.class.getName(),
237 "getAddresses", new Object[] { paramObj0, paramObj1 });
238
239 Object returnObj = null;
240
241 try {
242 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
243 }
244 catch (Exception e) {
245 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
246 throw (com.liferay.portal.kernel.exception.PortalException)e;
247 }
248
249 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
250 throw (com.liferay.portal.kernel.exception.SystemException)e;
251 }
252
253 throw new com.liferay.portal.kernel.exception.SystemException(e);
254 }
255
256 return (java.util.List<com.liferay.portal.model.Address>)returnObj;
257 }
258 catch (com.liferay.portal.kernel.exception.SystemException se) {
259 _log.error(se, se);
260
261 throw se;
262 }
263 }
264
265 public static com.liferay.portal.model.Address updateAddress(
266 HttpPrincipal httpPrincipal, long addressId, java.lang.String street1,
267 java.lang.String street2, java.lang.String street3,
268 java.lang.String city, java.lang.String zip, long regionId,
269 long countryId, int typeId, boolean mailing, boolean primary)
270 throws com.liferay.portal.kernel.exception.PortalException,
271 com.liferay.portal.kernel.exception.SystemException {
272 try {
273 Object paramObj0 = new LongWrapper(addressId);
274
275 Object paramObj1 = street1;
276
277 if (street1 == null) {
278 paramObj1 = new NullWrapper("java.lang.String");
279 }
280
281 Object paramObj2 = street2;
282
283 if (street2 == null) {
284 paramObj2 = new NullWrapper("java.lang.String");
285 }
286
287 Object paramObj3 = street3;
288
289 if (street3 == null) {
290 paramObj3 = new NullWrapper("java.lang.String");
291 }
292
293 Object paramObj4 = city;
294
295 if (city == null) {
296 paramObj4 = new NullWrapper("java.lang.String");
297 }
298
299 Object paramObj5 = zip;
300
301 if (zip == null) {
302 paramObj5 = new NullWrapper("java.lang.String");
303 }
304
305 Object paramObj6 = new LongWrapper(regionId);
306
307 Object paramObj7 = new LongWrapper(countryId);
308
309 Object paramObj8 = new IntegerWrapper(typeId);
310
311 Object paramObj9 = new BooleanWrapper(mailing);
312
313 Object paramObj10 = new BooleanWrapper(primary);
314
315 MethodWrapper methodWrapper = new MethodWrapper(AddressServiceUtil.class.getName(),
316 "updateAddress",
317 new Object[] {
318 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
319 paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
320 paramObj10
321 });
322
323 Object returnObj = null;
324
325 try {
326 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
327 }
328 catch (Exception e) {
329 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
330 throw (com.liferay.portal.kernel.exception.PortalException)e;
331 }
332
333 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
334 throw (com.liferay.portal.kernel.exception.SystemException)e;
335 }
336
337 throw new com.liferay.portal.kernel.exception.SystemException(e);
338 }
339
340 return (com.liferay.portal.model.Address)returnObj;
341 }
342 catch (com.liferay.portal.kernel.exception.SystemException se) {
343 _log.error(se, se);
344
345 throw se;
346 }
347 }
348
349 private static Log _log = LogFactoryUtil.getLog(AddressServiceHttp.class);
350 }