Interface SchemaServiceBase
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
SchemaService,SchemaServiceAuthenticatedMutator,SchemaServiceUtilLayer
- All Known Implementing Classes:
SchemaService.Delegating,SchemaServiceBase.Delegating,SchemaServiceEmptyTransientImpl,SchemaServiceEtcdImpl,SchemaServiceKvImpl,SchemaServiceLegacyTransientImpl,StaticSchemaServiceImpl
Provides methods for interacting with the system Schema store. This interface is meant to be extended.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDelegate all method calls to an implementation object. -
Method Summary
Modifier and TypeMethodDescriptionabout()Information about a SchemaService instance.booleanAuthenticate using default authentication.default booleanauthenticate(String user, String password) Authenticate using the given user and password.booleanauthenticate(String user, String password, String operateAs) Authenticate using the given user and password, operating as the operateAs user.default voidclose()default booleancontainsNamespace(String namespace) Find out whether the given namespace is known to the schema service.booleancontainsNamespace(String namespace, boolean includeDeleted) Find out whether the given namespace is known to the schema service.booleancontainsSchema(String namespace, String tableName) Find out if the given schema exists.voiddeleteSchema(String namespace, String tableName) Delete the specified schema.voiddeleteSchema(String namespace, String tableName, String code, String comment) Delete the specified schema.Get a future representing a possibly asynchronous initialization stage.default Collection<String>Get a collection of the namespaces available.listNamespaces(boolean includeDeleted) Get a collection of the namespaces available.default Collection<String>listTableNames(String namespace) Get a collection of all table names in the specified namespace.listTableNames(String namespace, boolean includeDeleted) Get a collection of all table names in the specified namespace.voidremoveNamespace(String namespaceName) Remove the given namespace.voidremoveNamespace(String namespaceName, String code, String comment) Remove the given namespace.default voidshutdown()Shut down the schema service.
-
Method Details
-
about
String about()Information about a SchemaService instance. Useful for debugging.- Returns:
- a string containing information about the instance
-
authenticate
Authenticate using the given user and password. Implementations are not required to allow re-authentication.- Parameters:
user- the user to authenticatepassword- the password for the user- Returns:
- true only if the authentication succeeded
-
authenticate
Authenticate using the given user and password, operating as the operateAs user. Implementations are not required to allow re-authentication.- Parameters:
user- the user to authenticatepassword- the password for the useroperateAs- attempt to operate as this effective user- Returns:
- true only if the authentication succeeded
-
authenticate
boolean authenticate()Authenticate using default authentication. This will be using the default private key or howeverAuthenticationClientManager.getDefault()has been authenticated.- Returns:
- true only if the authentication succeeded
-
containsNamespace
Find out whether the given namespace is known to the schema service.- Parameters:
namespace- the namespace in questionincludeDeleted- true if deleted namespaces should be considered- Returns:
- true if the namespace is found
-
containsNamespace
Find out whether the given namespace is known to the schema service.- Parameters:
namespace- the namespace in question- Returns:
- true if the namespace is found
-
containsSchema
Find out if the given schema exists. Does not check for deleted schemas.- Parameters:
namespace- the namespace of the tabletableName- the table name- Returns:
- true if a schema is found for namespace.tableName
-
listNamespaces
Get a collection of the namespaces available.- Returns:
- a collection of namespace names
-
listNamespaces
Get a collection of the namespaces available.- Parameters:
includeDeleted- true if deleted namespaces should be included- Returns:
- a collection of namespace names
-
listTableNames
Get a collection of all table names in the specified namespace.- Parameters:
namespace- the name of the namespace- Returns:
- a collection of all available schemas in namespace
-
listTableNames
Get a collection of all table names in the specified namespace.- Parameters:
namespace- the name of the namespaceincludeDeleted- tf deleted schemas should be included- Returns:
- a collection of all available schemas in namespace, empty list if namespace does not exit
-
removeNamespace
void removeNamespace(@NotNull String namespaceName, @NotNull String code, @NotNull String comment) throws SchemaException Remove the given namespace. The namespace must be empty (contain no schemas).- Parameters:
namespaceName- the namespace to removecode- pass-thru to kv persistence, indicates the code source of this updatecomment- pass-thru to kv persistence - a comment for this update- Throws:
SchemaException- if the namespace cannot be removed
-
removeNamespace
Remove the given namespace. The namespace must be empty (contain no schemas).- Parameters:
namespaceName- the namespace to remove- Throws:
SchemaException- if the namespace cannot be removed
-
deleteSchema
void deleteSchema(@NotNull String namespace, @NotNull String tableName) throws IllegalArgumentException, SchemaException Delete the specified schema.- Parameters:
namespace- the namespace of the schema to deletetableName- the name of the schema to delete- Throws:
IllegalArgumentException- if the namespace or table could not be foundSchemaException- if the schema could not be deleted
-
deleteSchema
void deleteSchema(@NotNull String namespace, @NotNull String tableName, @NotNull String code, @NotNull String comment) throws IllegalArgumentException, SchemaException Delete the specified schema.- Parameters:
namespace- the namespace of the schema to deletetableName- the name of the schema to deletecode- pass-thru to kv persistence, indicates the code source of this deletecomment- pass-thru to kv persistence - a comment for this delete- Throws:
IllegalArgumentException- if the namespace or table could not be foundSchemaException- if the schema could not be deleted
-
shutdown
default void shutdown()Shut down the schema service. This may involve cleaning up threads and releasing resources. -
close
default void close()- Specified by:
closein interfaceAutoCloseable
-
initializationStage
Get a future representing a possibly asynchronous initialization stage. The initialization stage is finished when the future is done, and does not throw an exception.- Returns:
- a Future representing successful completion of initialization.
-