Package io.inversion.cosmosdb
Class CosmosDb
- java.lang.Object
-
- io.inversion.Rule<T>
-
- io.inversion.Db<CosmosDb>
-
- io.inversion.cosmosdb.CosmosDb
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringdbprotected com.microsoft.azure.documentdb.DocumentClientdocumentClientstatic java.lang.StringINDEX_TYPE_PARTITION_KEYprotected java.lang.Stringkeyprotected java.lang.Stringuri
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.microsoft.azure.documentdb.DocumentClientbuildDocumentClient(java.lang.String uri, java.lang.String key, com.microsoft.azure.documentdb.ConnectionPolicy connectionPolicy)protected voiddeleteRow(io.inversion.Collection collection, java.util.Map<java.lang.String,java.lang.Object> indexValues)Deletes a single specific resource.voiddoDelete(io.inversion.Collection table, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> indexValues)io.inversion.ResultsdoSelect(io.inversion.Collection collection, java.util.List<io.inversion.rql.Term> columnMappedTerms)Finds the resource keys on the other side of the relationshipjava.util.List<java.lang.String>doUpsert(io.inversion.Collection table, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows)protected java.lang.StringgetCollectionUri(io.inversion.Collection table)java.lang.StringgetDb()com.microsoft.azure.documentdb.DocumentClientgetDocumentClient()java.lang.StringgetKey()java.lang.StringgetUri()booleanisAllowCrossPartitionQueries()java.lang.StringupsertRow(io.inversion.Collection collection, java.util.Map<java.lang.String,java.lang.Object> row)CosmosDbwithAllowCrossPartitionQueries(boolean allowCrossPartitionQueries)CosmosDbwithDb(java.lang.String db)CosmosDbwithDocumentClient(com.microsoft.azure.documentdb.DocumentClient documentClient)CosmosDbwithKey(java.lang.String key)CosmosDbwithUri(java.lang.String uri)-
Methods inherited from class io.inversion.Db
beautifyCollectionName, beautifyName, buildCollections, buildRelationships, castDbOutput, castJsonInput, castJsonInput, configApi, configDb, delete, doPatch, doShutdown, doShutdown, doStartup, excludeTable, filterOutJsonProperty, getCollection, getCollectionByTableName, getCollections, getProperty, getType, isBootstrap, isDryRun, isRunning, isType, makeRelationshipName, mapToColumnNames, mapToColumnNames, mapToJsonNames, patch, removeCollection, select, shutdown, shutdown, startup, upsert, withBootstrap, withCollection, withCollections, withDryRun, withExcludeColumns, withIncludeColumns, withIncludeTable, withIncludeTables, withType
-
Methods inherited from class io.inversion.Rule
afterWiringComplete, checkLazyConfig, compareTo, doLazyConfig, getAllExcludePaths, getAllIncludeMethods, getAllIncludePaths, getDefaultIncludeMatchers, getDescription, getExcludeMatchers, getIncludeMatchers, getName, getOrder, getParams, match, match, matches, matches, toString, withDescription, withExcludeOn, withExcludeOn, withIncludeOn, withIncludeOn, withName, withOrder, withParam, withParams
-
-
-
-
Field Detail
-
INDEX_TYPE_PARTITION_KEY
public static final java.lang.String INDEX_TYPE_PARTITION_KEY
- See Also:
- Constant Field Values
-
uri
protected java.lang.String uri
-
db
protected java.lang.String db
-
key
protected java.lang.String key
-
documentClient
protected transient com.microsoft.azure.documentdb.DocumentClient documentClient
-
-
Method Detail
-
buildDocumentClient
public static com.microsoft.azure.documentdb.DocumentClient buildDocumentClient(java.lang.String uri, java.lang.String key, com.microsoft.azure.documentdb.ConnectionPolicy connectionPolicy)
-
doSelect
public io.inversion.Results doSelect(io.inversion.Collection collection, java.util.List<io.inversion.rql.Term> columnMappedTerms) throws io.inversion.ApiExceptionFinds the resource keys on the other side of the relationship- Overrides:
doSelectin classio.inversion.Db<CosmosDb>- Parameters:
collection- the collection to querycolumnMappedTerms- the query terms- Returns:
- Map key=sourceResourceKey, value=relatedResourceKey
- Throws:
io.inversion.ApiException- if selection fails for any reason
-
doUpsert
public java.util.List<java.lang.String> doUpsert(io.inversion.Collection table, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rows) throws io.inversion.ApiException- Overrides:
doUpsertin classio.inversion.Db<CosmosDb>- Throws:
io.inversion.ApiException
-
upsertRow
public java.lang.String upsertRow(io.inversion.Collection collection, java.util.Map<java.lang.String,java.lang.Object> row) throws io.inversion.ApiException- Throws:
io.inversion.ApiException
-
doDelete
public void doDelete(io.inversion.Collection table, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> indexValues) throws io.inversion.ApiException- Overrides:
doDeletein classio.inversion.Db<CosmosDb>- Throws:
io.inversion.ApiException
-
deleteRow
protected void deleteRow(io.inversion.Collection collection, java.util.Map<java.lang.String,java.lang.Object> indexValues) throws io.inversion.ApiExceptionDeletes a single specific resource.Rest url format for Cosmos deletions - https://{databaseaccount}.documents.azure.com/dbs/{db}/colls/{coll}/docs/{doc}
- Parameters:
collection- the collection to deleteindexValues- identifiers for the documents to delete- Throws:
io.inversion.ApiException- See Also:
- CosmosDb Resource URI Syntax
-
getCollectionUri
protected java.lang.String getCollectionUri(io.inversion.Collection table)
-
getUri
public java.lang.String getUri()
-
withUri
public CosmosDb withUri(java.lang.String uri)
-
getDb
public java.lang.String getDb()
-
withDb
public CosmosDb withDb(java.lang.String db)
-
getKey
public java.lang.String getKey()
-
withKey
public CosmosDb withKey(java.lang.String key)
-
isAllowCrossPartitionQueries
public boolean isAllowCrossPartitionQueries()
-
withAllowCrossPartitionQueries
public CosmosDb withAllowCrossPartitionQueries(boolean allowCrossPartitionQueries)
-
withDocumentClient
public CosmosDb withDocumentClient(com.microsoft.azure.documentdb.DocumentClient documentClient)
-
getDocumentClient
public com.microsoft.azure.documentdb.DocumentClient getDocumentClient()
-
-