AsyncDocumentClient.Builder Class
- java.
lang. Object - com.
microsoft. azure. cosmosdb. rx. AsyncDocumentClient. Builder
- com.
public class Builder
Helper class to build AsyncDocumentClient instances as logical representation of the Azure Cosmos DB database service.
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.setConnectionMode(ConnectionMode.Direct);
AsyncDocumentClient client = new AsyncDocumentClient.Builder()
.withServiceEndpoint(serviceEndpoint)
.withMasterKeyOrResourceToken(masterKey)
.withConnectionPolicy(connectionPolicy)
.withConsistencyLevel(ConsistencyLevel.Session)
.build();
Method Summary
Method Details
build
public AsyncDocumentClient build()
getConfigs
public Configs getConfigs()
getConnectionPolicy
public ConnectionPolicy getConnectionPolicy()
getDesiredConsistencyLevel
public ConsistencyLevel getDesiredConsistencyLevel()
getMasterKeyOrResourceToken
public String getMasterKeyOrResourceToken()
getPermissionFeed
public List
getServiceEndpoint
public URI getServiceEndpoint()
getTokenResolver
public TokenResolver getTokenResolver()
setConfigs
public void setConfigs(Configs configs)
Parameters:
setConnectionPolicy
public void setConnectionPolicy(ConnectionPolicy connectionPolicy)
Parameters:
setDesiredConsistencyLevel
public void setDesiredConsistencyLevel(ConsistencyLevel desiredConsistencyLevel)
Parameters:
setMasterKeyOrResourceToken
public void setMasterKeyOrResourceToken(String masterKeyOrResourceToken)
Parameters:
setPermissionFeed
public void setPermissionFeed(List
Parameters:
setServiceEndpoint
public void setServiceEndpoint(URI serviceEndpoint)
Parameters:
setTokenResolver
public void setTokenResolver(TokenResolver tokenResolver)
Parameters:
withConfigs
public Builder withConfigs(Configs configs)
Parameters:
withConnectionPolicy
public Builder withConnectionPolicy(ConnectionPolicy connectionPolicy)
Parameters:
withConsistencyLevel
public Builder withConsistencyLevel(ConsistencyLevel desiredConsistencyLevel)
Parameters:
withMasterKey
public Builder withMasterKey(String masterKeyOrResourceToken)
New method withMasterKeyOrResourceToken will take either master key or resource token and perform authentication for accessing resource.
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="com.microsoft.azure.cosmosdb.rx.AsyncDocumentClient.Builder.withMasterKeyOrResourceToken(String)" data-throw-if-not-resolved="false" data-raw-source="withMasterKeyOrResourceToken(String)"></xref> instead. </p>
</xrefdescription>
Parameters:
Returns:
withMasterKeyOrResourceToken
public Builder withMasterKeyOrResourceToken(String masterKeyOrResourceToken)
This method will accept the master key , additionally it can also consume resource token too for authentication.
Parameters:
Returns:
withPermissionFeed
public Builder withPermissionFeed(List
This method will accept the permission list , which contains the resource tokens needed to access resources.
Parameters:
Returns:
withServiceEndpoint
public Builder withServiceEndpoint(String serviceEndpoint)
Parameters:
withTokenResolver
public Builder withTokenResolver(TokenResolver tokenResolver)
This method will accept tokenResolver which is rx function, it takes arguments
T1 requestVerb(String),
T2 resourceIdOrFullName(String),
T3 resourceType(com.microsoft.azure.cosmosdb.internal.ResourceType),
T4 request headers(Map<String, String>)
and return
R authenticationToken(String)
Parameters:
Returns:
Applies to
Azure SDK for Java