1
14
15 package com.liferay.portal.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.util.MethodCache;
19 import com.liferay.portal.kernel.util.ReferenceRegistry;
20
21
41 public class AddressServiceUtil {
42 public static com.liferay.portal.model.Address addAddress(
43 java.lang.String className, long classPK, java.lang.String street1,
44 java.lang.String street2, java.lang.String street3,
45 java.lang.String city, java.lang.String zip, long regionId,
46 long countryId, int typeId, boolean mailing, boolean primary)
47 throws com.liferay.portal.PortalException,
48 com.liferay.portal.SystemException {
49 return getService()
50 .addAddress(className, classPK, street1, street2, street3,
51 city, zip, regionId, countryId, typeId, mailing, primary);
52 }
53
54 public static void deleteAddress(long addressId)
55 throws com.liferay.portal.PortalException,
56 com.liferay.portal.SystemException {
57 getService().deleteAddress(addressId);
58 }
59
60 public static com.liferay.portal.model.Address getAddress(long addressId)
61 throws com.liferay.portal.PortalException,
62 com.liferay.portal.SystemException {
63 return getService().getAddress(addressId);
64 }
65
66 public static java.util.List<com.liferay.portal.model.Address> getAddresses(
67 java.lang.String className, long classPK)
68 throws com.liferay.portal.PortalException,
69 com.liferay.portal.SystemException {
70 return getService().getAddresses(className, classPK);
71 }
72
73 public static com.liferay.portal.model.Address updateAddress(
74 long addressId, java.lang.String street1, java.lang.String street2,
75 java.lang.String street3, java.lang.String city, java.lang.String zip,
76 long regionId, long countryId, int typeId, boolean mailing,
77 boolean primary)
78 throws com.liferay.portal.PortalException,
79 com.liferay.portal.SystemException {
80 return getService()
81 .updateAddress(addressId, street1, street2, street3, city,
82 zip, regionId, countryId, typeId, mailing, primary);
83 }
84
85 public static AddressService getService() {
86 if (_service == null) {
87 _service = (AddressService)PortalBeanLocatorUtil.locate(AddressService.class.getName());
88
89 ReferenceRegistry.registerReference(AddressServiceUtil.class,
90 "_service");
91 MethodCache.remove(AddressService.class);
92 }
93
94 return _service;
95 }
96
97 public void setService(AddressService service) {
98 MethodCache.remove(AddressService.class);
99
100 _service = service;
101
102 ReferenceRegistry.registerReference(AddressServiceUtil.class, "_service");
103 MethodCache.remove(AddressService.class);
104 }
105
106 private static AddressService _service;
107 }