class OpenAMResourceSetStore implements ResourceSetStore {

    @Override
    public Set<ResourceSetDescription> query(QueryFilter<String> query) throws ServerException {
        Set<ResourceSetDescription> results;
        try {
            results = delegate.query(QueryFilter.and(query,
                    QueryFilter.equalTo(ResourceSetTokenField.REALM, realm)));
        } catch (org.forgerock.openam.sm.datalayer.store.ServerException e) {
            throw new ServerException(e);
        }
        return results;
    }

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

}