1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.ReferenceRegistry;
19  
20  /**
21   * <a href="RoleFinderUtil.java.html"><b><i>View Source</i></b></a>
22   *
23   * @author Brian Wing Shun Chan
24   */
25  public class RoleFinderUtil {
26      public static int countByR_U(long roleId, long userId)
27          throws com.liferay.portal.SystemException {
28          return getFinder().countByR_U(roleId, userId);
29      }
30  
31      public static int countByU_G_R(long userId, long groupId, long roleId)
32          throws com.liferay.portal.SystemException {
33          return getFinder().countByU_G_R(userId, groupId, roleId);
34      }
35  
36      public static int countByC_N_D_T(long companyId, java.lang.String name,
37          java.lang.String description, java.lang.Integer type,
38          java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
39          throws com.liferay.portal.SystemException {
40          return getFinder()
41                     .countByC_N_D_T(companyId, name, description, type, params);
42      }
43  
44      public static java.util.List<com.liferay.portal.model.Role> findBySystem(
45          long companyId) throws com.liferay.portal.SystemException {
46          return getFinder().findBySystem(companyId);
47      }
48  
49      public static java.util.List<com.liferay.portal.model.Role> findByUserGroupGroupRole(
50          long userId, long groupId) throws com.liferay.portal.SystemException {
51          return getFinder().findByUserGroupGroupRole(userId, groupId);
52      }
53  
54      public static java.util.List<com.liferay.portal.model.Role> findByUserGroupRole(
55          long userId, long groupId) throws com.liferay.portal.SystemException {
56          return getFinder().findByUserGroupRole(userId, groupId);
57      }
58  
59      public static com.liferay.portal.model.Role findByC_N(long companyId,
60          java.lang.String name)
61          throws com.liferay.portal.NoSuchRoleException,
62              com.liferay.portal.SystemException {
63          return getFinder().findByC_N(companyId, name);
64      }
65  
66      public static java.util.List<com.liferay.portal.model.Role> findByU_G(
67          long userId, long groupId) throws com.liferay.portal.SystemException {
68          return getFinder().findByU_G(userId, groupId);
69      }
70  
71      public static java.util.List<com.liferay.portal.model.Role> findByU_G(
72          long userId, long[] groupIds) throws com.liferay.portal.SystemException {
73          return getFinder().findByU_G(userId, groupIds);
74      }
75  
76      public static java.util.List<com.liferay.portal.model.Role> findByU_G(
77          long userId, java.util.List<com.liferay.portal.model.Group> groups)
78          throws com.liferay.portal.SystemException {
79          return getFinder().findByU_G(userId, groups);
80      }
81  
82      public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
83          long companyId, java.lang.String name, java.lang.String description,
84          java.lang.Integer type,
85          java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
86          int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
87          throws com.liferay.portal.SystemException {
88          return getFinder()
89                     .findByC_N_D_T(companyId, name, description, type, params,
90              start, end, obc);
91      }
92  
93      public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> findByC_N_S_P(
94          long companyId, java.lang.String name, int scope,
95          java.lang.String primKey) throws com.liferay.portal.SystemException {
96          return getFinder().findByC_N_S_P(companyId, name, scope, primKey);
97      }
98  
99      public static RoleFinder getFinder() {
100         if (_finder == null) {
101             _finder = (RoleFinder)PortalBeanLocatorUtil.locate(RoleFinder.class.getName());
102 
103             ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
104         }
105 
106         return _finder;
107     }
108 
109     public void setFinder(RoleFinder finder) {
110         _finder = finder;
111 
112         ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
113     }
114 
115     private static RoleFinder _finder;
116 }