use of org.eclipse.dataspaceconnector.catalog.spi.FederatedCacheNodeDirectory in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosFederatedCacheNodeDirectoryExtension method initialize.
@Override
public void initialize(ServiceExtensionContext context) {
var configuration = new FederatedCacheNodeDirectoryCosmosConfig(context);
var cosmosDbApi = new CosmosDbApiImpl(configuration, clientProvider.createClient(vault, configuration));
FederatedCacheNodeDirectory directory = new CosmosFederatedCacheNodeDirectory(cosmosDbApi, configuration.getPartitionKey(), context.getTypeManager(), context.getService(RetryPolicy.class));
context.registerService(FederatedCacheNodeDirectory.class, directory);
context.getTypeManager().registerTypes(FederatedCacheNodeDocument.class);
context.getService(HealthCheckService.class).addReadinessProvider(() -> cosmosDbApi.get().forComponent(name()));
}
Aggregations