001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the remote service utility for Address. This utility wraps
024     * {@link com.liferay.portal.service.impl.AddressServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on a remote server. Methods of this service are expected to have security
027     * checks based on the propagated JAAS credentials because this service can be
028     * accessed remotely.
029     *
030     * @author Brian Wing Shun Chan
031     * @see AddressService
032     * @see com.liferay.portal.service.base.AddressServiceBaseImpl
033     * @see com.liferay.portal.service.impl.AddressServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class AddressServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.AddressServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * @deprecated As of 6.2.0, replaced by {@link #addAddress(String, long,
046            String, String, String, String, String, long, long, int,
047            boolean, boolean, ServiceContext)}
048            */
049            @Deprecated
050            public static com.liferay.portal.model.Address addAddress(
051                    java.lang.String className, long classPK, java.lang.String street1,
052                    java.lang.String street2, java.lang.String street3,
053                    java.lang.String city, java.lang.String zip, long regionId,
054                    long countryId, long typeId, boolean mailing, boolean primary)
055                    throws com.liferay.portal.kernel.exception.PortalException {
056                    return getService()
057                                       .addAddress(className, classPK, street1, street2, street3,
058                            city, zip, regionId, countryId, typeId, mailing, primary);
059            }
060    
061            public static com.liferay.portal.model.Address addAddress(
062                    java.lang.String className, long classPK, java.lang.String street1,
063                    java.lang.String street2, java.lang.String street3,
064                    java.lang.String city, java.lang.String zip, long regionId,
065                    long countryId, long typeId, boolean mailing, boolean primary,
066                    com.liferay.portal.service.ServiceContext serviceContext)
067                    throws com.liferay.portal.kernel.exception.PortalException {
068                    return getService()
069                                       .addAddress(className, classPK, street1, street2, street3,
070                            city, zip, regionId, countryId, typeId, mailing, primary,
071                            serviceContext);
072            }
073    
074            public static void deleteAddress(long addressId)
075                    throws com.liferay.portal.kernel.exception.PortalException {
076                    getService().deleteAddress(addressId);
077            }
078    
079            public static com.liferay.portal.model.Address getAddress(long addressId)
080                    throws com.liferay.portal.kernel.exception.PortalException {
081                    return getService().getAddress(addressId);
082            }
083    
084            public static java.util.List<com.liferay.portal.model.Address> getAddresses(
085                    java.lang.String className, long classPK)
086                    throws com.liferay.portal.kernel.exception.PortalException {
087                    return getService().getAddresses(className, classPK);
088            }
089    
090            /**
091            * Returns the OSGi service identifier.
092            *
093            * @return the OSGi service identifier
094            */
095            public static java.lang.String getOSGiServiceIdentifier() {
096                    return getService().getOSGiServiceIdentifier();
097            }
098    
099            public static com.liferay.portal.model.Address updateAddress(
100                    long addressId, java.lang.String street1, java.lang.String street2,
101                    java.lang.String street3, java.lang.String city, java.lang.String zip,
102                    long regionId, long countryId, long typeId, boolean mailing,
103                    boolean primary)
104                    throws com.liferay.portal.kernel.exception.PortalException {
105                    return getService()
106                                       .updateAddress(addressId, street1, street2, street3, city,
107                            zip, regionId, countryId, typeId, mailing, primary);
108            }
109    
110            public static AddressService getService() {
111                    if (_service == null) {
112                            _service = (AddressService)PortalBeanLocatorUtil.locate(AddressService.class.getName());
113    
114                            ReferenceRegistry.registerReference(AddressServiceUtil.class,
115                                    "_service");
116                    }
117    
118                    return _service;
119            }
120    
121            private static AddressService _service;
122    }