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 layout branch remote service. This utility wraps {@link com.liferay.portal.service.impl.LayoutBranchServiceImpl} 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 LayoutBranchService
030     * @see com.liferay.portal.service.base.LayoutBranchServiceBaseImpl
031     * @see com.liferay.portal.service.impl.LayoutBranchServiceImpl
032     * @generated
033     */
034    public class LayoutBranchServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.LayoutBranchServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portal.model.LayoutBranch addLayoutBranch(
041                    long layoutRevisionId, java.lang.String name,
042                    java.lang.String description, boolean master,
043                    com.liferay.portal.service.ServiceContext serviceContext)
044                    throws com.liferay.portal.kernel.exception.PortalException,
045                            com.liferay.portal.kernel.exception.SystemException {
046                    return getService()
047                                       .addLayoutBranch(layoutRevisionId, name, description,
048                            master, serviceContext);
049            }
050    
051            public static void deleteLayoutBranch(long layoutBranchId)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    getService().deleteLayoutBranch(layoutBranchId);
055            }
056    
057            public static com.liferay.portal.model.LayoutBranch updateLayoutBranch(
058                    long layoutBranchId, java.lang.String name,
059                    java.lang.String description,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    return getService()
064                                       .updateLayoutBranch(layoutBranchId, name, description,
065                            serviceContext);
066            }
067    
068            public static LayoutBranchService getService() {
069                    if (_service == null) {
070                            _service = (LayoutBranchService)PortalBeanLocatorUtil.locate(LayoutBranchService.class.getName());
071    
072                            ReferenceRegistry.registerReference(LayoutBranchServiceUtil.class,
073                                    "_service");
074                            MethodCache.remove(LayoutBranchService.class);
075                    }
076    
077                    return _service;
078            }
079    
080            public void setService(LayoutBranchService service) {
081                    MethodCache.remove(LayoutBranchService.class);
082    
083                    _service = service;
084    
085                    ReferenceRegistry.registerReference(LayoutBranchServiceUtil.class,
086                            "_service");
087                    MethodCache.remove(LayoutBranchService.class);
088            }
089    
090            private static LayoutBranchService _service;
091    }