1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
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  /**
22   * <a href="AddressServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link AddressService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       AddressService
39   * @generated
40   */
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 }