AsyncDocumentClient.Builder Classe
- java.
lang. Object - com.
microsoft. azure. cosmosdb. rx. AsyncDocumentClient. Builder
- com.
public class Builder
Classe auxiliar para criar AsyncDocumentClient instâncias como representação lógica do serviço de banco de dados do Azure Cosmos DB.
ConnectionPolicy connectionPolicy = new ConnectionPolicy();
connectionPolicy.setConnectionMode(ConnectionMode.Direct);
AsyncDocumentClient client = new AsyncDocumentClient.Builder()
.withServiceEndpoint(serviceEndpoint)
.withMasterKeyOrResourceToken(masterKey)
.withConnectionPolicy(connectionPolicy)
.withConsistencyLevel(ConsistencyLevel.Session)
.build();
Resumo do método
Detalhes do método
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)
Parâmetros:
setConnectionPolicy
public void setConnectionPolicy(ConnectionPolicy connectionPolicy)
Parâmetros:
setDesiredConsistencyLevel
public void setDesiredConsistencyLevel(ConsistencyLevel desiredConsistencyLevel)
Parâmetros:
setMasterKeyOrResourceToken
public void setMasterKeyOrResourceToken(String masterKeyOrResourceToken)
Parâmetros:
setPermissionFeed
public void setPermissionFeed(List
Parâmetros:
setServiceEndpoint
public void setServiceEndpoint(URI serviceEndpoint)
Parâmetros:
setTokenResolver
public void setTokenResolver(TokenResolver tokenResolver)
Parâmetros:
withConfigs
public Builder withConfigs(Configs configs)
Parâmetros:
withConnectionPolicy
public Builder withConnectionPolicy(ConnectionPolicy connectionPolicy)
Parâmetros:
withConsistencyLevel
public Builder withConsistencyLevel(ConsistencyLevel desiredConsistencyLevel)
Parâmetros:
withMasterKey
public Builder withMasterKey(String masterKeyOrResourceToken)
O novo método comMasterKeyOrResourceToken usará master chave ou token de recurso e executará a autenticação para acessar o recurso.
<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>
Parâmetros:
Retornos:
withMasterKeyOrResourceToken
public Builder withMasterKeyOrResourceToken(String masterKeyOrResourceToken)
Esse método aceitará a chave master , além disso, também pode consumir o token de recurso também para autenticação.
Parâmetros:
Retornos:
withPermissionFeed
public Builder withPermissionFeed(List
Esse método aceitará a lista de permissões , que contém os tokens de recurso necessários para acessar recursos.
Parâmetros:
Retornos:
withServiceEndpoint
public Builder withServiceEndpoint(String serviceEndpoint)
Parâmetros:
withTokenResolver
public Builder withTokenResolver(TokenResolver tokenResolver)
Esse método aceitará tokenResolver, que é a função rx, ele usa argumentos
T1 requestVerb(String),
T2 resourceIdOrFullName(String),
T3 resourceType(com.microsoft.azure.cosmosdb.internal.ResourceType),
Cabeçalhos de solicitação T4 (Cadeia de Caracteres de Mapa<, Cadeia de Caracteres>)
e retornar
R authenticationToken(String)
Parâmetros:
Retornos:
Aplica-se a
Azure SDK for Java