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());
}
}
Aggregations