Example usage for javax.management.relation RoleNotFoundException RoleNotFoundException

List of usage examples for javax.management.relation RoleNotFoundException RoleNotFoundException

Introduction

In this page you can find the example usage for javax.management.relation RoleNotFoundException RoleNotFoundException.

Prototype

public RoleNotFoundException(String message) 

Source Link

Document

Constructor with given message put in exception.

Usage

From source file:com.adito.activedirectory.ActiveDirectoryUserDatabase.java

public Role getRole(String groupName) throws UserDatabaseException, RoleNotFoundException {
    if (logger.isDebugEnabled()) {
        logger.debug("Getting group " + groupName);
    }//from  ww w.  j  a  v  a2 s  .c om

    if (!groupContainer.containsPrincipal(groupName)) {
        loadRoles(groupName, false);
    }
    if (!groupContainer.containsPrincipal(groupName)) {
        throw new RoleNotFoundException(groupName + " is not a valid group!");
    }

    ActiveDirectoryGroup group = groupContainer.retrievePrincipal(groupName);
    groupContainer.buildHierarchy(group.getOriginalDn());
    return group;
}

From source file:com.adito.ldap.LdapUserDatabase.java

/**
 * (non-Javadoc)//from w w w .ja  v  a  2  s.c  o m
 *
 * @see com.adito.security.UserDatabase#getRole(java.lang.String)
 */
public Role getRole(String groupName) throws UserDatabaseException, RoleNotFoundException {
    if (logger.isDebugEnabled()) {
        logger.debug("Getting group " + groupName);
    }

    if (!groupContainer.containsPrincipal(groupName)) {
        loadRoles(groupName, false);

    }
    if (!groupContainer.containsPrincipal(groupName)) {
        throw new RoleNotFoundException(groupName + " is not a valid group!");
    }
    return groupContainer.retrievePrincipal(groupName);
}