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