Class SchemaManager
java.lang.Object
io.stargate.sgv2.api.common.schema.SchemaManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Boolean>authorizeInternal(StargateBridge bridge, io.stargate.bridge.proto.Schema.SchemaRead schemaRead) io.smallrye.mutiny.Uni<Boolean>authorizeKeyspaceInternal(StargateBridge bridge, String keyspaceName) io.smallrye.mutiny.Uni<Boolean>authorizeTableInternal(StargateBridge bridge, String keyspaceName, String tableName) protected io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>cacheKeyspace(String keyspaceName, Optional<String> tenantId, io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe keyspace) protected io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>fetchKeyspace(String keyspaceName, Optional<String> tenantId, StargateBridge bridge) io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>getKeyspace(String keyspace) Get the keyspace from the bridge.io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>getKeyspaceAuthorized(String keyspace) Get the keyspace from the bridge.io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>Get all keyspace from the bridge.io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>Get all keyspace from the bridge.io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlTable>getTable(String keyspace, String table, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get the table from the bridge.io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlTable>getTableAuthorized(String keyspace, String table, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get the table from the bridge.io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlTable>getTables(String keyspace, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get all tables of a keyspace from the bridge.io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlTable>getTablesAuthorized(String keyspace, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get all authorized tables from the bridge.protected io.smallrye.mutiny.Uni<Void>invalidateKeyspace(String keyspaceName, Optional<String> tenantId)
-
Constructor Details
-
SchemaManager
public SchemaManager()
-
-
Method Details
-
getKeyspace
public io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe> getKeyspace(String keyspace) Get the keyspace from the bridge. Note that this method is not doing any authorization.- Parameters:
keyspace- Keyspace name- Returns:
- Uni containing Schema.CqlKeyspaceDescribe or
nullitem in case keyspace does not exist.
-
getKeyspaces
public io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe> getKeyspaces()Get all keyspace from the bridge. Note that this method is not doing any authorization.- Returns:
- Multi containing Schema.CqlKeyspaceDescribe
-
getTable
public io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlTable> getTable(String keyspace, String table, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get the table from the bridge. Note that this method is not doing any authorization.- Parameters:
keyspace- Keyspace nametable- Table namemissingKeyspace- Function of the keyspace in case it's not existing. Usually there to provide a failure.- Returns:
- Uni containing Schema.CqlTable or
nullitem in case the table does not exist.
-
getTables
public io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlTable> getTables(String keyspace, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get all tables of a keyspace from the bridge.- Parameters:
keyspace- Keyspace namemissingKeyspace- Function of the keyspace in case it's not existing. Usually there to provide a failure.- Returns:
- Multi of Schema.CqlTable
-
getKeyspaceAuthorized
public io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe> getKeyspaceAuthorized(String keyspace) Get the keyspace from the bridge. Prior to getting the keyspace it will execute the schema authorization request.Emits a failure in case:
- Not authorized, with
UnauthorizedKeyspaceException
- Parameters:
keyspace- Keyspace name- Returns:
- Uni containing Schema.CqlKeyspaceDescribe or
nullitem in case keyspace does not exist.
- Not authorized, with
-
getKeyspacesAuthorized
public io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe> getKeyspacesAuthorized()Get all keyspace from the bridge. Prior to getting each keyspace it will execute the schema authorization request (single request for all available keyspace).- Returns:
- Multi containing Schema.CqlKeyspaceDescribe
-
getTableAuthorized
public io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlTable> getTableAuthorized(String keyspace, String table, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get the table from the bridge. Prior to getting the keyspace it will execute the schema authorization request.Emits a failure in case:
- Not authorized, with
UnauthorizedTableException
- Parameters:
keyspace- Keyspace nametable- Table namemissingKeyspace- Function of the keyspace in case it's not existing. Usually there to provide a failure.- Returns:
- Uni containing Schema.CqlTable or
nullitem in case the table does not exist.
- Not authorized, with
-
getTablesAuthorized
public io.smallrye.mutiny.Multi<io.stargate.bridge.proto.Schema.CqlTable> getTablesAuthorized(String keyspace, Function<String, io.smallrye.mutiny.Uni<? extends io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe>> missingKeyspace) Get all authorized tables from the bridge.Emits a failure in case:
- Not authorized, with
UnauthorizedTableException
- Parameters:
keyspace- Keyspace namemissingKeyspace- Function of the keyspace in case it's not existing. Usually there to provide a failure.- Returns:
- Multi of Schema.CqlTable
- Not authorized, with
-
authorizeKeyspaceInternal
public io.smallrye.mutiny.Uni<Boolean> authorizeKeyspaceInternal(StargateBridge bridge, String keyspaceName) -
authorizeTableInternal
public io.smallrye.mutiny.Uni<Boolean> authorizeTableInternal(StargateBridge bridge, String keyspaceName, String tableName) -
authorizeInternal
public io.smallrye.mutiny.Uni<Boolean> authorizeInternal(StargateBridge bridge, io.stargate.bridge.proto.Schema.SchemaRead schemaRead) -
fetchKeyspace
protected io.smallrye.mutiny.Uni<io.stargate.bridge.proto.Schema.CqlKeyspaceDescribe> fetchKeyspace(String keyspaceName, Optional<String> tenantId, StargateBridge bridge) -
cacheKeyspace
-
invalidateKeyspace
-