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.portlet.softwarecatalog.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 s c license remote service. This utility wraps {@link com.liferay.portlet.softwarecatalog.service.impl.SCLicenseServiceImpl} 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 SCLicenseService
030     * @see com.liferay.portlet.softwarecatalog.service.base.SCLicenseServiceBaseImpl
031     * @see com.liferay.portlet.softwarecatalog.service.impl.SCLicenseServiceImpl
032     * @generated
033     */
034    public class SCLicenseServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.softwarecatalog.service.impl.SCLicenseServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.softwarecatalog.model.SCLicense addLicense(
041                    java.lang.String name, java.lang.String url, boolean openSource,
042                    boolean active, boolean recommended)
043                    throws com.liferay.portal.kernel.exception.PortalException,
044                            com.liferay.portal.kernel.exception.SystemException {
045                    return getService()
046                                       .addLicense(name, url, openSource, active, recommended);
047            }
048    
049            public static void deleteLicense(long licenseId)
050                    throws com.liferay.portal.kernel.exception.PortalException,
051                            com.liferay.portal.kernel.exception.SystemException {
052                    getService().deleteLicense(licenseId);
053            }
054    
055            public static com.liferay.portlet.softwarecatalog.model.SCLicense getLicense(
056                    long licenseId)
057                    throws com.liferay.portal.kernel.exception.PortalException,
058                            com.liferay.portal.kernel.exception.SystemException {
059                    return getService().getLicense(licenseId);
060            }
061    
062            public static com.liferay.portlet.softwarecatalog.model.SCLicense updateLicense(
063                    long licenseId, java.lang.String name, java.lang.String url,
064                    boolean openSource, boolean active, boolean recommended)
065                    throws com.liferay.portal.kernel.exception.PortalException,
066                            com.liferay.portal.kernel.exception.SystemException {
067                    return getService()
068                                       .updateLicense(licenseId, name, url, openSource, active,
069                            recommended);
070            }
071    
072            public static SCLicenseService getService() {
073                    if (_service == null) {
074                            _service = (SCLicenseService)PortalBeanLocatorUtil.locate(SCLicenseService.class.getName());
075    
076                            ReferenceRegistry.registerReference(SCLicenseServiceUtil.class,
077                                    "_service");
078                            MethodCache.remove(SCLicenseService.class);
079                    }
080    
081                    return _service;
082            }
083    
084            public void setService(SCLicenseService service) {
085                    MethodCache.remove(SCLicenseService.class);
086    
087                    _service = service;
088    
089                    ReferenceRegistry.registerReference(SCLicenseServiceUtil.class,
090                            "_service");
091                    MethodCache.remove(SCLicenseService.class);
092            }
093    
094            private static SCLicenseService _service;
095    }