001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 region remote service. This utility wraps {@link com.liferay.portal.service.impl.RegionServiceImpl} 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 RegionService
030     * @see com.liferay.portal.service.base.RegionServiceBaseImpl
031     * @see com.liferay.portal.service.impl.RegionServiceImpl
032     * @generated
033     */
034    public class RegionServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.RegionServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portal.model.Region addRegion(long countryId,
041                    java.lang.String regionCode, java.lang.String name, boolean active)
042                    throws com.liferay.portal.kernel.exception.PortalException,
043                            com.liferay.portal.kernel.exception.SystemException {
044                    return getService().addRegion(countryId, regionCode, name, active);
045            }
046    
047            public static java.util.List<com.liferay.portal.model.Region> getRegions()
048                    throws com.liferay.portal.kernel.exception.SystemException {
049                    return getService().getRegions();
050            }
051    
052            public static java.util.List<com.liferay.portal.model.Region> getRegions(
053                    long countryId)
054                    throws com.liferay.portal.kernel.exception.SystemException {
055                    return getService().getRegions(countryId);
056            }
057    
058            public static java.util.List<com.liferay.portal.model.Region> getRegions(
059                    boolean active)
060                    throws com.liferay.portal.kernel.exception.SystemException {
061                    return getService().getRegions(active);
062            }
063    
064            public static java.util.List<com.liferay.portal.model.Region> getRegions(
065                    long countryId, boolean active)
066                    throws com.liferay.portal.kernel.exception.SystemException {
067                    return getService().getRegions(countryId, active);
068            }
069    
070            public static com.liferay.portal.model.Region getRegion(long regionId)
071                    throws com.liferay.portal.kernel.exception.PortalException,
072                            com.liferay.portal.kernel.exception.SystemException {
073                    return getService().getRegion(regionId);
074            }
075    
076            public static RegionService getService() {
077                    if (_service == null) {
078                            _service = (RegionService)PortalBeanLocatorUtil.locate(RegionService.class.getName());
079    
080                            ReferenceRegistry.registerReference(RegionServiceUtil.class,
081                                    "_service");
082                            MethodCache.remove(RegionService.class);
083                    }
084    
085                    return _service;
086            }
087    
088            public void setService(RegionService service) {
089                    MethodCache.remove(RegionService.class);
090    
091                    _service = service;
092    
093                    ReferenceRegistry.registerReference(RegionServiceUtil.class, "_service");
094                    MethodCache.remove(RegionService.class);
095            }
096    
097            private static RegionService _service;
098    }