use of org.eclipse.dataspaceconnector.azure.cosmos.CosmosDbApiImpl in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosContractNegotiationStoreExtension method initialize.
@Override
public void initialize(ServiceExtensionContext context) {
var configuration = new CosmosContractNegotiationStoreConfig(context);
Vault vault = context.getService(Vault.class);
var cosmosDbApi = new CosmosDbApiImpl(vault, configuration);
var store = new CosmosContractNegotiationStore(cosmosDbApi, context.getTypeManager(), (RetryPolicy<Object>) context.getService(RetryPolicy.class), configuration.getPartitionKey());
context.registerService(ContractNegotiationStore.class, store);
context.getTypeManager().registerTypes(ContractNegotiationDocument.class);
context.getService(HealthCheckService.class).addReadinessProvider(() -> cosmosDbApi.get().forComponent(name()));
}
use of org.eclipse.dataspaceconnector.azure.cosmos.CosmosDbApiImpl in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosAssetIndexExtension method initialize.
@Override
public void initialize(ServiceExtensionContext context) {
var configuration = new AssetIndexCosmosConfig(context);
Vault vault = context.getService(Vault.class);
var cosmosDbApi = new CosmosDbApiImpl(vault, configuration);
var assetIndex = new CosmosAssetIndex(cosmosDbApi, configuration.getPartitionKey(), context.getTypeManager(), context.getService(RetryPolicy.class));
context.registerService(AssetIndex.class, assetIndex);
context.registerService(AssetLoader.class, assetIndex);
context.registerService(DataAddressResolver.class, assetIndex);
context.getService(HealthCheckService.class).addReadinessProvider(() -> cosmosDbApi.get().forComponent(name()));
context.getTypeManager().registerTypes(AssetDocument.class);
}
use of org.eclipse.dataspaceconnector.azure.cosmos.CosmosDbApiImpl in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosContractDefinitionStoreIntegrationTest method setUp.
@BeforeEach
void setUp() {
var containerName = CONTAINER_PREFIX + UUID.randomUUID();
CosmosContainerResponse containerIfNotExists = database.createContainerIfNotExists(containerName, "/partitionKey");
container = database.getContainer(containerIfNotExists.getProperties().getId());
assertThat(database).describedAs("CosmosDB database is null - did something go wrong during initialization?").isNotNull();
var cosmosDbApi = new CosmosDbApiImpl(container, true);
store = new CosmosContractDefinitionStore(cosmosDbApi, typeManager, new RetryPolicy<>().withMaxRetries(3).withBackoff(1, 5, ChronoUnit.SECONDS), TEST_PARTITION_KEY);
}
use of org.eclipse.dataspaceconnector.azure.cosmos.CosmosDbApiImpl in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosFederatedCacheNodeDirectoryIntegrationTest method setUp.
@BeforeEach
void setUp() {
var containerIfNotExists = database.createContainerIfNotExists(CONTAINER_NAME, "/partitionKey");
container = database.getContainer(containerIfNotExists.getProperties().getId());
assertThat(database).describedAs("CosmosDB database is null - did something go wrong during initialization?").isNotNull();
typeManager = new TypeManager();
typeManager.registerTypes(FederatedCacheNode.class, FederatedCacheNodeDocument.class);
var cosmosDbApi = new CosmosDbApiImpl(container, true);
store = new CosmosFederatedCacheNodeDirectory(cosmosDbApi, TEST_PARTITION_KEY, typeManager, new RetryPolicy<>());
}
use of org.eclipse.dataspaceconnector.azure.cosmos.CosmosDbApiImpl in project DataSpaceConnector by eclipse-dataspaceconnector.
the class CosmosPolicyStoreIntegrationTest method setUp.
@BeforeEach
void setUp() {
var containerName = CONTAINER_PREFIX + UUID.randomUUID();
CosmosContainerResponse containerIfNotExists = database.createContainerIfNotExists(containerName, "/partitionKey");
container = database.getContainer(containerIfNotExists.getProperties().getId());
assertThat(database).describedAs("CosmosDB database is null - did something go wrong during initialization?").isNotNull();
var cosmosDbApi = new CosmosDbApiImpl(container, true);
store = new CosmosPolicyStore(cosmosDbApi, typeManager, new RetryPolicy<>().withMaxRetries(3).withBackoff(1, 5, ChronoUnit.SECONDS), TEST_PARTITION_KEY);
}
Aggregations