001    /**
002     * Copyright (c) 2000-2013 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 RoleFinderUtil {
027            public static int countByR_U(long roleId, long userId)
028                    throws com.liferay.portal.kernel.exception.SystemException {
029                    return getFinder().countByR_U(roleId, userId);
030            }
031    
032            public static int countByU_G_R(long userId, long groupId, long roleId)
033                    throws com.liferay.portal.kernel.exception.SystemException {
034                    return getFinder().countByU_G_R(userId, groupId, roleId);
035            }
036    
037            public static int countByC_N_D_T(long companyId, java.lang.String name,
038                    java.lang.String description, java.lang.Integer[] types,
039                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
040                    boolean andOperator)
041                    throws com.liferay.portal.kernel.exception.SystemException {
042                    return getFinder()
043                                       .countByC_N_D_T(companyId, name, description, types, params,
044                            andOperator);
045            }
046    
047            public static int countByC_N_D_T(long companyId, java.lang.String[] names,
048                    java.lang.String[] descriptions, java.lang.Integer[] types,
049                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
050                    boolean andOperator)
051                    throws com.liferay.portal.kernel.exception.SystemException {
052                    return getFinder()
053                                       .countByC_N_D_T(companyId, names, descriptions, types,
054                            params, andOperator);
055            }
056    
057            public static int countByKeywords(long companyId,
058                    java.lang.String keywords, java.lang.Integer[] types)
059                    throws com.liferay.portal.kernel.exception.SystemException {
060                    return getFinder().countByKeywords(companyId, keywords, types);
061            }
062    
063            public static int countByKeywords(long companyId,
064                    java.lang.String keywords, java.lang.Integer[] types,
065                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
066                    throws com.liferay.portal.kernel.exception.SystemException {
067                    return getFinder().countByKeywords(companyId, keywords, types, params);
068            }
069    
070            public static java.util.List<com.liferay.portal.model.Role> findBySystem(
071                    long companyId)
072                    throws com.liferay.portal.kernel.exception.SystemException {
073                    return getFinder().findBySystem(companyId);
074            }
075    
076            public static java.util.List<com.liferay.portal.model.Role> findByUserGroupGroupRole(
077                    long userId, long groupId)
078                    throws com.liferay.portal.kernel.exception.SystemException {
079                    return getFinder().findByUserGroupGroupRole(userId, groupId);
080            }
081    
082            public static java.util.List<com.liferay.portal.model.Role> findByUserGroupRole(
083                    long userId, long groupId)
084                    throws com.liferay.portal.kernel.exception.SystemException {
085                    return getFinder().findByUserGroupRole(userId, groupId);
086            }
087    
088            public static com.liferay.portal.model.Role findByC_N(long companyId,
089                    java.lang.String name)
090                    throws com.liferay.portal.NoSuchRoleException,
091                            com.liferay.portal.kernel.exception.SystemException {
092                    return getFinder().findByC_N(companyId, name);
093            }
094    
095            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
096                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
097                    throws com.liferay.portal.kernel.exception.SystemException {
098                    return getFinder().findByU_G(userId, groups);
099            }
100    
101            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
102                    long userId, long groupId)
103                    throws com.liferay.portal.kernel.exception.SystemException {
104                    return getFinder().findByU_G(userId, groupId);
105            }
106    
107            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
108                    long userId, long[] groupIds)
109                    throws com.liferay.portal.kernel.exception.SystemException {
110                    return getFinder().findByU_G(userId, groupIds);
111            }
112    
113            public static java.util.List<com.liferay.portal.model.Role> findByR_N_A(
114                    long resourceBlockId, java.lang.String className,
115                    java.lang.String actionId)
116                    throws com.liferay.portal.kernel.exception.SystemException {
117                    return getFinder().findByR_N_A(resourceBlockId, className, actionId);
118            }
119    
120            public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
121                    long companyId, java.lang.String name, java.lang.String description,
122                    java.lang.Integer[] types,
123                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
124                    boolean andOperator, int start, int end,
125                    com.liferay.portal.kernel.util.OrderByComparator obc)
126                    throws com.liferay.portal.kernel.exception.SystemException {
127                    return getFinder()
128                                       .findByC_N_D_T(companyId, name, description, types, params,
129                            andOperator, start, end, obc);
130            }
131    
132            public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
133                    long companyId, java.lang.String[] names,
134                    java.lang.String[] descriptions, java.lang.Integer[] types,
135                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
136                    boolean andOperator, int start, int end,
137                    com.liferay.portal.kernel.util.OrderByComparator obc)
138                    throws com.liferay.portal.kernel.exception.SystemException {
139                    return getFinder()
140                                       .findByC_N_D_T(companyId, names, descriptions, types,
141                            params, andOperator, start, end, obc);
142            }
143    
144            public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> findByC_N_S_P(
145                    long companyId, java.lang.String name, int scope,
146                    java.lang.String primKey)
147                    throws com.liferay.portal.kernel.exception.SystemException {
148                    return getFinder().findByC_N_S_P(companyId, name, scope, primKey);
149            }
150    
151            public static java.util.List<com.liferay.portal.model.Role> findByC_N_S_P_A(
152                    long companyId, java.lang.String name, int scope,
153                    java.lang.String primKey, java.lang.String actionId)
154                    throws com.liferay.portal.kernel.exception.SystemException {
155                    return getFinder()
156                                       .findByC_N_S_P_A(companyId, name, scope, primKey, actionId);
157            }
158    
159            public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
160                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
161                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getFinder()
164                                       .findByKeywords(companyId, keywords, types, start, end, obc);
165            }
166    
167            public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
168                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
169                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
170                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
171                    throws com.liferay.portal.kernel.exception.SystemException {
172                    return getFinder()
173                                       .findByKeywords(companyId, keywords, types, params, start,
174                            end, obc);
175            }
176    
177            public static RoleFinder getFinder() {
178                    if (_finder == null) {
179                            _finder = (RoleFinder)PortalBeanLocatorUtil.locate(RoleFinder.class.getName());
180    
181                            ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
182                    }
183    
184                    return _finder;
185            }
186    
187            public void setFinder(RoleFinder finder) {
188                    _finder = finder;
189    
190                    ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
191            }
192    
193            private static RoleFinder _finder;
194    }