Class CosmosProperties
- java.lang.Object
-
- com.azure.spring.autoconfigure.cosmos.CosmosProperties
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@Validated @ConfigurationProperties("azure.cosmos") public class CosmosProperties extends Object implements org.springframework.beans.factory.InitializingBeanConfiguration properties for Cosmos database, consistency, telemetry, connection, query metrics and diagnostics.
-
-
Field Summary
Fields Modifier and Type Field Description static StringLOCAL_URI_REGEXLocal URI regular expressionsstatic StringURI_REGEXURI regular expression
-
Constructor Summary
Constructors Constructor Description CosmosProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()com.azure.cosmos.ConnectionModegetConnectionMode()Gets the connection mode.com.azure.cosmos.ConsistencyLevelgetConsistencyLevel()Gets the consistency level.StringgetDatabase()Gets the database name.StringgetKey()Gets the key.com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessorgetResponseDiagnosticsProcessor()Gets the response diagnostics processor.StringgetUri()Gets the URI.booleanisAllowTelemetry()Deprecated.Determined by HTTP header User-Agent insteadbooleanisPopulateQueryMetrics()Whether to populate query metrics.booleanisValidateUri()Whether to validate the URI.voidsetAllowTelemetry(boolean allowTelemetry)Sets whether telemetry is allowed.voidsetConnectionMode(com.azure.cosmos.ConnectionMode connectionMode)Sets the connection mode.voidsetConsistencyLevel(com.azure.cosmos.ConsistencyLevel consistencyLevel)Sets the consistency level.voidsetDatabase(String databaseName)Sets the database name.voidsetKey(String key)Sets the key.voidsetPopulateQueryMetrics(boolean populateQueryMetrics)Sets whether to populate query metrics.voidsetResponseDiagnosticsProcessor(com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor responseDiagnosticsProcessor)Sets the response diagnostics processor.voidsetUri(String uri)Sets the URI.voidsetValidateUri(boolean validateUri)Sets whether to validate the URI.
-
-
-
Field Detail
-
URI_REGEX
public static final String URI_REGEX
URI regular expression- See Also:
- Constant Field Values
-
LOCAL_URI_REGEX
public static final String LOCAL_URI_REGEX
Local URI regular expressions- See Also:
- Constant Field Values
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getUri
public String getUri()
Gets the URI.- Returns:
- the URI
-
setUri
public void setUri(String uri)
Sets the URI.- Parameters:
uri- the URI
-
getKey
public String getKey()
Gets the key.- Returns:
- the key
-
setKey
public void setKey(String key)
Sets the key.- Parameters:
key- the key
-
getDatabase
public String getDatabase()
Gets the database name.- Returns:
- the database name
-
setDatabase
public void setDatabase(String databaseName)
Sets the database name.- Parameters:
databaseName- the database name
-
getConsistencyLevel
public com.azure.cosmos.ConsistencyLevel getConsistencyLevel()
Gets the consistency level.- Returns:
- the consistency level
-
setConsistencyLevel
public void setConsistencyLevel(com.azure.cosmos.ConsistencyLevel consistencyLevel)
Sets the consistency level.- Parameters:
consistencyLevel- the consistency level
-
isAllowTelemetry
@Deprecated @DeprecatedConfigurationProperty(reason="Deprecate the telemetry endpoint and use HTTP header User Agent instead.") public boolean isAllowTelemetry()
Deprecated.Determined by HTTP header User-Agent insteadWhether telemetry is allowed.- Returns:
- whether telemetry is allowed
-
setAllowTelemetry
public void setAllowTelemetry(boolean allowTelemetry)
Sets whether telemetry is allowed.- Parameters:
allowTelemetry- whether telemetry is allowed
-
isValidateUri
public boolean isValidateUri()
Whether to validate the URI.- Returns:
- whether to validate the URI
-
setValidateUri
public void setValidateUri(boolean validateUri)
Sets whether to validate the URI.- Parameters:
validateUri- whether to validate the URI
-
isPopulateQueryMetrics
public boolean isPopulateQueryMetrics()
Whether to populate query metrics.- Returns:
- whether to populate query metrics
-
setPopulateQueryMetrics
public void setPopulateQueryMetrics(boolean populateQueryMetrics)
Sets whether to populate query metrics.- Parameters:
populateQueryMetrics- whether to populate query metrics
-
getResponseDiagnosticsProcessor
public com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor getResponseDiagnosticsProcessor()
Gets the response diagnostics processor.- Returns:
- the response diagnostics processor
-
setResponseDiagnosticsProcessor
public void setResponseDiagnosticsProcessor(com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor responseDiagnosticsProcessor)
Sets the response diagnostics processor.- Parameters:
responseDiagnosticsProcessor- the response diagnostics processor
-
getConnectionMode
public com.azure.cosmos.ConnectionMode getConnectionMode()
Gets the connection mode.- Returns:
- the connection mode
-
setConnectionMode
public void setConnectionMode(com.azure.cosmos.ConnectionMode connectionMode)
Sets the connection mode.- Parameters:
connectionMode- the connection mode
-
-