com.scalar.db.sql.metadata.Metadata Maven / Gradle / Ivy
package com.scalar.db.sql.metadata;
import com.scalar.db.sql.exception.SqlException;
import java.util.Map;
import java.util.Optional;
/** The metadata of ScalarDB. */
public interface Metadata {
/**
* Returns a map of the namespace names and {@link NamespaceMetadata} objects.
*
* @return a map of the namespace names and {@link NamespaceMetadata} objects
* @throws SqlException if an unexpected error happens
*/
Map getNamespaces();
/**
* Returns a {@link NamespaceMetadata} object for the specified namespace
*
* @param namespaceName the name of the target namespace
* @return a {@link NamespaceMetadata} object
* @throws SqlException if an unexpected error happens
*/
Optional getNamespace(String namespaceName);
/**
* Returns a map of the usernames and {@link UserMetadata} objects.
*
* @return a map of the usernames and {@link UserMetadata} objects
* @throws SqlException if an unexpected error happens
*/
Map getUsers();
/**
* Returns a {@link UserMetadata} object for the specified user.
*
* @param username the name of the target user
* @return a {@link UserMetadata} object
* @throws SqlException if an unexpected error happens
*/
Optional getUser(String username);
}