Example usage for com.liferay.portal.kernel.service RoleLocalServiceUtil getRoleByUuidAndCompanyId

List of usage examples for com.liferay.portal.kernel.service RoleLocalServiceUtil getRoleByUuidAndCompanyId

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service RoleLocalServiceUtil getRoleByUuidAndCompanyId.

Prototype

public static com.liferay.portal.kernel.model.Role getRoleByUuidAndCompanyId(String uuid, long companyId)
        throws com.liferay.portal.kernel.exception.PortalException 

Source Link

Document

Returns the role with the matching UUID and company.

Usage

From source file:com.liferay.exportimport.lar.LayoutCache.java

License:Open Source License

public Role getUuidRole(long companyId, String uuid) throws PortalException {

    Role role = uuidRolesMap.get(uuid);

    if (role == null) {
        try {/*from  w  ww . j av  a2  s  . c  o m*/
            role = RoleLocalServiceUtil.getRoleByUuidAndCompanyId(uuid, companyId);

            uuidRolesMap.put(uuid, role);
        } catch (NoSuchRoleException nsre) {

            // LPS-52675

            if (_log.isDebugEnabled()) {
                _log.debug(nsre, nsre);
            }
        }
    }

    return role;
}