public interface StargateBridgeClient
| Modifier and Type | Method and Description |
|---|---|
default boolean |
authorizeSchemaRead(Schema.SchemaRead schemaRead)
Convenience method to call
authorizeSchemaReads(List) with a single element. |
default CompletionStage<Boolean> |
authorizeSchemaReadAsync(Schema.SchemaRead schemaRead)
Convenience method to call
authorizeSchemaReadsAsync(List) with a single element. |
default List<Boolean> |
authorizeSchemaReads(List<Schema.SchemaRead> schemaReads) |
CompletionStage<List<Boolean>> |
authorizeSchemaReadsAsync(List<Schema.SchemaRead> schemaReads)
Checks whether this client is authorized to describe a set of schema elements.
|
String |
decorateKeyspaceName(String keyspaceName)
Converts a keyspace name used by this client to the "global" one actually used by the
persistence backend.
|
default QueryOuterClass.Response |
executeBatch(QueryOuterClass.Batch batch) |
CompletionStage<QueryOuterClass.Response> |
executeBatchAsync(QueryOuterClass.Batch batch)
Executes a CQL batch.
|
default QueryOuterClass.Response |
executeQuery(QueryOuterClass.Query query) |
CompletionStage<QueryOuterClass.Response> |
executeQueryAsync(QueryOuterClass.Query query)
Executes a CQL query.
|
default List<Schema.CqlKeyspaceDescribe> |
getAllKeyspaces() |
CompletionStage<List<Schema.CqlKeyspaceDescribe>> |
getAllKeyspacesAsync()
Gets the metadata describing all the keyspaces that are visible to this client.
|
default Optional<Schema.CqlKeyspaceDescribe> |
getKeyspace(String keyspaceName,
boolean checkIfAuthorized) |
CompletionStage<Optional<Schema.CqlKeyspaceDescribe>> |
getKeyspaceAsync(String keyspaceName,
boolean checkIfAuthorized)
Gets the metadata describing the given keyspace.
|
default Optional<Schema.CqlTable> |
getTable(String keyspaceName,
String tableName,
boolean checkIfAuthorized) |
CompletionStage<Optional<Schema.CqlTable>> |
getTableAsync(String keyspaceName,
String tableName,
boolean checkIfAuthorized)
Gets the metadata describing the given table.
|
default List<Schema.CqlTable> |
getTables(String keyspaceName) |
CompletionStage<List<Schema.CqlTable>> |
getTablesAsync(String keyspaceName)
Gets the metadata describing all the tables that are visible to this client in the given
keyspace.
|
CompletionStage<QueryOuterClass.Response> executeQueryAsync(QueryOuterClass.Query query)
Authorization is automatically handled by the persistence backend.
default QueryOuterClass.Response executeQuery(QueryOuterClass.Query query)
#executeQueryAsync(Query)CompletionStage<QueryOuterClass.Response> executeBatchAsync(QueryOuterClass.Batch batch)
Authorization is automatically handled by the persistence backend.
default QueryOuterClass.Response executeBatch(QueryOuterClass.Batch batch)
#executeBatchAsync(Batch)CompletionStage<Optional<Schema.CqlKeyspaceDescribe>> getKeyspaceAsync(String keyspaceName, boolean checkIfAuthorized)
checkIfAuthorized - whether to check if the current user is allowed to describe this
keyspace (this requires an additional background call to the bridge). This is an
optimization: if you only use the schema metadata to build a DML query that will be
executed immediately after, you can skip authorization since #executeQueryAsync(Query) does it automatically. However, if there is no other query and
you build a client response directly from the metadata, then authorization should be done
by this method.UnauthorizedKeyspaceException - (wrapped in the returned future) if checkIfAuthorized is set, and the client is not allowed to access this keyspace. However,
this check is shallow: if the caller surfaces keyspace elements (tables, UDTs...) to the
end user, it must authorize them individually with authorizeSchemaReads(List).default Optional<Schema.CqlKeyspaceDescribe> getKeyspace(String keyspaceName, boolean checkIfAuthorized) throws UnauthorizedKeyspaceException
UnauthorizedKeyspaceExceptiongetKeyspaceAsync(String, boolean)CompletionStage<List<Schema.CqlKeyspaceDescribe>> getAllKeyspacesAsync()
This method automatically filters out unauthorized keyspaces. However, this check is
shallow: if the caller surfaces keyspace elements (tables, UDTs...) to the end user, it must
authorize them individually with authorizeSchemaReads(List).
default List<Schema.CqlKeyspaceDescribe> getAllKeyspaces()
getAllKeyspacesAsync()String decorateKeyspaceName(String keyspaceName)
Schema.CqlKeyspace#getGlobalName() from Schema.CqlKeyspace#getName().CompletionStage<Optional<Schema.CqlTable>> getTableAsync(String keyspaceName, String tableName, boolean checkIfAuthorized)
checkIfAuthorized - see explanations in getKeyspaceAsync(String, boolean).UnauthorizedTableException - (wrapped in the returned future) if checkIfAuthorized is set, and the client is not allowed to access this table.default Optional<Schema.CqlTable> getTable(String keyspaceName, String tableName, boolean checkIfAuthorized) throws UnauthorizedTableException
UnauthorizedTableExceptiongetTableAsync(String, String, boolean)CompletionStage<List<Schema.CqlTable>> getTablesAsync(String keyspaceName)
This method automatically filters out unauthorized tables.
default List<Schema.CqlTable> getTables(String keyspaceName)
getTableAsync(String, String, boolean)CompletionStage<List<Boolean>> authorizeSchemaReadsAsync(List<Schema.SchemaRead> schemaReads)
SchemaReadsdefault List<Boolean> authorizeSchemaReads(List<Schema.SchemaRead> schemaReads)
authorizeSchemaReadsAsync(List),
SchemaReadsdefault CompletionStage<Boolean> authorizeSchemaReadAsync(Schema.SchemaRead schemaRead)
authorizeSchemaReadsAsync(List) with a single element.SchemaReadsdefault boolean authorizeSchemaRead(Schema.SchemaRead schemaRead)
authorizeSchemaReads(List) with a single element.SchemaReadsCopyright © 2022. All rights reserved.