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 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 com.liferay.portal.model.Region getRegion(long regionId)
048                    throws com.liferay.portal.kernel.exception.PortalException,
049                            com.liferay.portal.kernel.exception.SystemException {
050                    return getService().getRegion(regionId);
051            }
052    
053            public static java.util.List<com.liferay.portal.model.Region> getRegions()
054                    throws com.liferay.portal.kernel.exception.SystemException {
055                    return getService().getRegions();
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)
066                    throws com.liferay.portal.kernel.exception.SystemException {
067                    return getService().getRegions(countryId);
068            }
069    
070            public static java.util.List<com.liferay.portal.model.Region> getRegions(
071                    long countryId, boolean active)
072                    throws com.liferay.portal.kernel.exception.SystemException {
073                    return getService().getRegions(countryId, active);
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    }