001
014
015 package com.liferay.portal.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class AddressServiceUtil {
035
040 public static com.liferay.portal.model.Address addAddress(
041 java.lang.String className, long classPK, java.lang.String street1,
042 java.lang.String street2, java.lang.String street3,
043 java.lang.String city, java.lang.String zip, long regionId,
044 long countryId, int typeId, boolean mailing, boolean primary)
045 throws com.liferay.portal.kernel.exception.PortalException,
046 com.liferay.portal.kernel.exception.SystemException {
047 return getService()
048 .addAddress(className, classPK, street1, street2, street3,
049 city, zip, regionId, countryId, typeId, mailing, primary);
050 }
051
052 public static void deleteAddress(long addressId)
053 throws com.liferay.portal.kernel.exception.PortalException,
054 com.liferay.portal.kernel.exception.SystemException {
055 getService().deleteAddress(addressId);
056 }
057
058 public static com.liferay.portal.model.Address getAddress(long addressId)
059 throws com.liferay.portal.kernel.exception.PortalException,
060 com.liferay.portal.kernel.exception.SystemException {
061 return getService().getAddress(addressId);
062 }
063
064 public static java.util.List<com.liferay.portal.model.Address> getAddresses(
065 java.lang.String className, long classPK)
066 throws com.liferay.portal.kernel.exception.PortalException,
067 com.liferay.portal.kernel.exception.SystemException {
068 return getService().getAddresses(className, classPK);
069 }
070
071 public static com.liferay.portal.model.Address updateAddress(
072 long addressId, java.lang.String street1, java.lang.String street2,
073 java.lang.String street3, java.lang.String city, java.lang.String zip,
074 long regionId, long countryId, int typeId, boolean mailing,
075 boolean primary)
076 throws com.liferay.portal.kernel.exception.PortalException,
077 com.liferay.portal.kernel.exception.SystemException {
078 return getService()
079 .updateAddress(addressId, street1, street2, street3, city,
080 zip, regionId, countryId, typeId, mailing, primary);
081 }
082
083 public static AddressService getService() {
084 if (_service == null) {
085 _service = (AddressService)PortalBeanLocatorUtil.locate(AddressService.class.getName());
086
087 ReferenceRegistry.registerReference(AddressServiceUtil.class,
088 "_service");
089 MethodCache.remove(AddressService.class);
090 }
091
092 return _service;
093 }
094
095 public void setService(AddressService service) {
096 MethodCache.remove(AddressService.class);
097
098 _service = service;
099
100 ReferenceRegistry.registerReference(AddressServiceUtil.class, "_service");
101 MethodCache.remove(AddressService.class);
102 }
103
104 private static AddressService _service;
105 }