Package net.officefloor.nosql.cosmosdb
Class CosmosDbConnect
- java.lang.Object
-
- net.officefloor.nosql.cosmosdb.CosmosDbConnect
-
public class CosmosDbConnect extends java.lang.Object
CosmosDatabase
connect functionality.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_KEY
Property
name for the key.static java.lang.String
PROPERTY_URL
Property
name for the URL for theCosmosClient
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.azure.cosmos.CosmosClientBuilder
createCosmosClientBuilder(SourceContext context)
Creates theCosmosClientBuilder
to connect toCosmosDatabase
/CosmosAsyncDatabase
.static void
setCosmosDbFactory(CosmosDbFactory cosmosDbFactory)
Sets using theCosmosDbFactory
.
-
-
-
Field Detail
-
PROPERTY_URL
public static final java.lang.String PROPERTY_URL
Property
name for the URL for theCosmosClient
.- See Also:
- Constant Field Values
-
PROPERTY_KEY
public static final java.lang.String PROPERTY_KEY
Property
name for the key.- See Also:
- Constant Field Values
-
-
Method Detail
-
setCosmosDbFactory
public static void setCosmosDbFactory(CosmosDbFactory cosmosDbFactory)
Sets using the
CosmosDbFactory
.This is typically used for testing to allow overriding the
CosmosDbFactory
being used.- Parameters:
cosmosDbFactory
-CosmosDbFactory
. May benull
to not override.
-
createCosmosClientBuilder
public static com.azure.cosmos.CosmosClientBuilder createCosmosClientBuilder(SourceContext context) throws java.lang.Exception
Creates theCosmosClientBuilder
to connect toCosmosDatabase
/CosmosAsyncDatabase
.- Parameters:
context
-SourceContext
.- Returns:
CosmosClientBuilder
.- Throws:
java.lang.Exception
- If fails to connect.
-
-