001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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    /**
022     * The utility for the address remote service. This utility wraps {@link com.liferay.portal.service.impl.AddressServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see AddressService
030     * @see com.liferay.portal.service.base.AddressServiceBaseImpl
031     * @see com.liferay.portal.service.impl.AddressServiceImpl
032     * @generated
033     */
034    public class AddressServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.AddressServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
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    }