Search in sources :

Example 1 with UmaException

use of org.forgerock.openam.uma.UmaException in project OpenAM by OpenRock.

the class UmaAuditLogger method getResourceSet.

private ResourceSetDescription getResourceSet(String resourceSetId, OAuth2ProviderSettings providerSettings) throws UmaException {
    try {
        ResourceSetStore store = providerSettings.getResourceSetStore();
        Set<ResourceSetDescription> results = store.query(QueryFilter.equalTo(ResourceSetTokenField.RESOURCE_SET_ID, resourceSetId));
        if (results.size() != 1) {
            throw new UmaException(400, "invalid_resource_set_id", "Could not find Resource Set, " + resourceSetId);
        }
        return results.iterator().next();
    } catch (org.forgerock.oauth2.core.exceptions.ServerException e) {
        throw new UmaException(400, "invalid_resource_set_id", e.getMessage());
    }
}
Also used : ResourceSetStore(org.forgerock.oauth2.resources.ResourceSetStore) UmaException(org.forgerock.openam.uma.UmaException) ResourceSetDescription(org.forgerock.oauth2.resources.ResourceSetDescription)

Aggregations

ResourceSetDescription (org.forgerock.oauth2.resources.ResourceSetDescription)1 ResourceSetStore (org.forgerock.oauth2.resources.ResourceSetStore)1 UmaException (org.forgerock.openam.uma.UmaException)1