class OpenAMResourceSetStore implements ResourceSetStore {

    @Override
    public ResourceSetDescription read(String resourceSetId, ResourceSetFilter filter) throws NotFoundException,
            ServerException {
        Set<ResourceSetDescription> resourceSets =
                query(QueryFilter.equalTo(ResourceSetTokenField.RESOURCE_SET_ID, resourceSetId));

        if(filter != null) {
            resourceSets = filter.filter(resourceSets);
        }
        if(!resourceSets.isEmpty()) {
            return resourceSets.iterator().next();
        }

        throw new NotFoundException("Resource set does not exist with id " + resourceSetId);
    }

    @Inject public  OpenAMResourceSetStore(@Assisted String realm, OAuth2ProviderSettingsFactory providerSettingsFactory,
            OAuth2UrisFactory<RealmInfo> oauth2UrisFactory, TokenIdGenerator idGenerator,
            @DataLayer(ConnectionType.RESOURCE_SETS) TokenDataStore delegate);

}