use of org.forgerock.openam.sm.exceptions.ConnectionCredentialsNotFound in project OpenAM by OpenRock.
the class ServerConfigurationFactory method getServerConfiguration.
/**
* Select the Server Group from the configuration.
*
* If the server group is valid then this ServerConfigurationFactory will select
* the Server Group and Instance for subsequent calls.
*
* @param groupName The name of the server group. For example: "default" or "sms".
* @param authType The type of connection credentials that should be selected.
*
* @throws IllegalStateException If the Server Configuration did not exist for the
* named Server Group or the Server Group did not have credentials for the requested
* connection type.
*/
public ServerGroupConfiguration getServerConfiguration(String groupName, LDAPUser.Type authType) throws ServerConfigurationNotFound, ConnectionCredentialsNotFound {
ServerGroup serverGroup = config.getServerGroup(groupName);
ServerInstance instance = config.getServerInstance(groupName, authType);
if (serverGroup == null) {
throw new ServerConfigurationNotFound(groupName);
}
if (instance == null) {
throw new ConnectionCredentialsNotFound(authType);
}
return new ServerGroupConfiguration(serverGroup, instance);
}
Aggregations