Package com.azure.data.cosmos
Class CosmosKeyCredential
- java.lang.Object
-
- com.azure.data.cosmos.CosmosKeyCredential
-
public class CosmosKeyCredential extends Object
Cosmos Key Credential is used to store key credentials, in order to support dynamic key rotation. Singleton instance should be used to support multiple keys. Azure client library for Cosmos ensures to use the updated key provided in the same singleton instance which was used when buildingCosmosClient
-
-
Constructor Summary
Constructors Constructor Description CosmosKeyCredential(String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
key()
Returns the key stored in Cosmos Key CredentialCosmosKeyCredential
key(String key)
Sets the key to be used in CosmosKeyCredentialint
keyHashCode()
CosmosKeyCredential stores the computed hashcode of the key for performance improvements.
-
-
-
Constructor Detail
-
CosmosKeyCredential
public CosmosKeyCredential(String key)
-
-
Method Detail
-
key
public String key()
Returns the key stored in Cosmos Key Credential- Returns:
- key
-
key
public CosmosKeyCredential key(String key)
Sets the key to be used in CosmosKeyCredential- Parameters:
key
- key to be used in CosmosKeyCredential- Returns:
- current CosmosKeyCredential
-
keyHashCode
public int keyHashCode()
CosmosKeyCredential stores the computed hashcode of the key for performance improvements.- Returns:
- hashcode of the key
-
-