/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */

package com.liferay.portal.service.persistence;

import aQute.bnd.annotation.ProviderType;

import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.util.ReferenceRegistry;

/**
 * @author Brian Wing Shun Chan
 */
@ProviderType
public class RoleFinderUtil {
	public static int countByGroupRoleAndTeamRole(long companyId,
		java.lang.String keywords,
		java.util.List<java.lang.String> excludedNames, int[] types,
		long excludedTeamRoleId, long teamGroupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .countByGroupRoleAndTeamRole(companyId, keywords,
			excludedNames, types, excludedTeamRoleId, teamGroupId);
	}

	public static int countByKeywords(long companyId,
		java.lang.String keywords, java.lang.Integer[] types)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().countByKeywords(companyId, keywords, types);
	}

	public static int countByKeywords(long companyId,
		java.lang.String keywords, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().countByKeywords(companyId, keywords, types, params);
	}

	public static int countByR_U(long roleId, long userId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().countByR_U(roleId, userId);
	}

	public static int countByU_G_R(long userId, long groupId, long roleId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().countByU_G_R(userId, groupId, roleId);
	}

	public static int countByC_N_D_T(long companyId, java.lang.String name,
		java.lang.String description, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .countByC_N_D_T(companyId, name, description, types, params,
			andOperator);
	}

	public static int countByC_N_D_T(long companyId, java.lang.String[] names,
		java.lang.String[] descriptions, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .countByC_N_D_T(companyId, names, descriptions, types,
			params, andOperator);
	}

	public static int filterCountByC_N_D_T(long companyId,
		java.lang.String[] names, java.lang.String[] descriptions,
		java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterCountByC_N_D_T(companyId, names, descriptions, types,
			params, andOperator);
	}

	public static java.util.List<com.liferay.portal.model.Role> filterFindByC_N_D_T(
		long companyId, java.lang.String[] names,
		java.lang.String[] descriptions, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator obc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterFindByC_N_D_T(companyId, names, descriptions, types,
			params, andOperator, start, end, obc);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByUserGroupRole(
		long userId, long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByUserGroupRole(userId, groupId);
	}

	public static int countByUserGroupGroupRole(long userId, long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().countByUserGroupGroupRole(userId, groupId);
	}

	public static int filterCountByGroupRoleAndTeamRole(long companyId,
		java.lang.String keywords,
		java.util.List<java.lang.String> excludedNames, int[] types,
		long excludedTeamRoleId, long teamGroupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterCountByGroupRoleAndTeamRole(companyId, keywords,
			excludedNames, types, excludedTeamRoleId, teamGroupId);
	}

	public static java.util.List<com.liferay.portal.model.Role> filterFindByKeywords(
		long companyId, java.lang.String keywords, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterFindByKeywords(companyId, keywords, types, params,
			start, end, obc);
	}

	public static java.util.List<com.liferay.portal.model.Role> filterFindByC_N_D_T(
		long companyId, java.lang.String name, java.lang.String description,
		java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator obc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterFindByC_N_D_T(companyId, name, description, types,
			params, andOperator, start, end, obc);
	}

	public static java.util.List<com.liferay.portal.model.Role> filterFindByGroupRoleAndTeamRole(
		long companyId, java.lang.String keywords,
		java.util.List<java.lang.String> excludedNames, int[] types,
		long excludedTeamRoleId, long teamGroupId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterFindByGroupRoleAndTeamRole(companyId, keywords,
			excludedNames, types, excludedTeamRoleId, teamGroupId, start, end);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByGroupRoleAndTeamRole(
		long companyId, java.lang.String keywords,
		java.util.List<java.lang.String> excludedNames, int[] types,
		long excludedTeamRoleId, long teamGroupId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .findByGroupRoleAndTeamRole(companyId, keywords,
			excludedNames, types, excludedTeamRoleId, teamGroupId, start, end);
	}

	public static java.util.List<com.liferay.portal.model.Role> findBySystem(
		long companyId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findBySystem(companyId);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByUserGroupGroupRole(
		long userId, long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByUserGroupGroupRole(userId, groupId);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByUserGroupGroupRole(
		long userId, long groupId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByUserGroupGroupRole(userId, groupId, start, end);
	}

	public static com.liferay.portal.model.Role findByC_N(long companyId,
		java.lang.String name)
		throws com.liferay.portal.NoSuchRoleException,
			com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByC_N(companyId, name);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByU_G(
		long userId, java.util.List<com.liferay.portal.model.Group> groups)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByU_G(userId, groups);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByU_G(
		long userId, long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByU_G(userId, groupId);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByU_G(
		long userId, long[] groupIds)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByU_G(userId, groupIds);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByR_N_A(
		long resourceBlockId, java.lang.String className,
		java.lang.String actionId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByR_N_A(resourceBlockId, className, actionId);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
		long companyId, java.lang.String name, java.lang.String description,
		java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator obc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .findByC_N_D_T(companyId, name, description, types, params,
			andOperator, start, end, obc);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
		long companyId, java.lang.String[] names,
		java.lang.String[] descriptions, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator obc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .findByC_N_D_T(companyId, names, descriptions, types,
			params, andOperator, start, end, obc);
	}

	public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> findByC_N_S_P(
		long companyId, java.lang.String name, int scope,
		java.lang.String primKey)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder().findByC_N_S_P(companyId, name, scope, primKey);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByC_N_S_P_A(
		long companyId, java.lang.String name, int scope,
		java.lang.String primKey, java.lang.String actionId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .findByC_N_S_P_A(companyId, name, scope, primKey, actionId);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
		long companyId, java.lang.String keywords, java.lang.Integer[] types,
		int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .findByKeywords(companyId, keywords, types, start, end, obc);
	}

	public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
		long companyId, java.lang.String keywords, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .findByKeywords(companyId, keywords, types, params, start,
			end, obc);
	}

	public static int filterCountByKeywords(long companyId,
		java.lang.String keywords, java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterCountByKeywords(companyId, keywords, types, params);
	}

	public static int filterCountByC_N_D_T(long companyId,
		java.lang.String name, java.lang.String description,
		java.lang.Integer[] types,
		java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
		boolean andOperator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getFinder()
				   .filterCountByC_N_D_T(companyId, name, description, types,
			params, andOperator);
	}

	public static RoleFinder getFinder() {
		if (_finder == null) {
			_finder = (RoleFinder)PortalBeanLocatorUtil.locate(RoleFinder.class.getName());

			ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
		}

		return _finder;
	}

	public void setFinder(RoleFinder finder) {
		_finder = finder;

		ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
	}

	private static RoleFinder _finder;
}