class OpenAMResourceSetStore implements ResourceSetStore {

    @Override
    public void delete(String resourceSetId, String resourceOwnerId) throws NotFoundException, ServerException {
        try {
            ResourceSetDescription token = read(resourceSetId, resourceOwnerId);
            delegate.delete(token.getId());
        } catch (org.forgerock.openam.sm.datalayer.store.NotFoundException e) {
            throw new NotFoundException("Could not find resource set");
        } catch (org.forgerock.openam.sm.datalayer.store.ServerException e) {
            throw new ServerException(e);
        }
    }

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

}