001    /**
002     * Copyright (c) 2000-2013 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.persistence;
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     * @author Brian Wing Shun Chan
024     */
025    @ProviderType
026    public class ResourcePermissionFinderUtil {
027            public static int countByR_S(long roleId, int[] scopes)
028                    throws com.liferay.portal.kernel.exception.SystemException {
029                    return getFinder().countByR_S(roleId, scopes);
030            }
031    
032            public static int countByC_N_S_P_R_A(long companyId, java.lang.String name,
033                    int scope, java.lang.String primKey, long[] roleIds, long actionId)
034                    throws com.liferay.portal.kernel.exception.SystemException {
035                    return getFinder()
036                                       .countByC_N_S_P_R_A(companyId, name, scope, primKey,
037                            roleIds, actionId);
038            }
039    
040            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByResource(
041                    long companyId, long groupId, java.lang.String name,
042                    java.lang.String primKey)
043                    throws com.liferay.portal.kernel.exception.SystemException {
044                    return getFinder().findByResource(companyId, groupId, name, primKey);
045            }
046    
047            public static java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
048                    long roleId, int[] scopes, int start, int end)
049                    throws com.liferay.portal.kernel.exception.SystemException {
050                    return getFinder().findByR_S(roleId, scopes, start, end);
051            }
052    
053            public static ResourcePermissionFinder getFinder() {
054                    if (_finder == null) {
055                            _finder = (ResourcePermissionFinder)PortalBeanLocatorUtil.locate(ResourcePermissionFinder.class.getName());
056    
057                            ReferenceRegistry.registerReference(ResourcePermissionFinderUtil.class,
058                                    "_finder");
059                    }
060    
061                    return _finder;
062            }
063    
064            public void setFinder(ResourcePermissionFinder finder) {
065                    _finder = finder;
066    
067                    ReferenceRegistry.registerReference(ResourcePermissionFinderUtil.class,
068                            "_finder");
069            }
070    
071            private static ResourcePermissionFinder _finder;
072    }