public interface TenantIndex
extends java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
java.util.Set<io.spine.core.TenantId> |
all()
Obtains the set of all stored tenant IDs.
|
void |
close()
Closes the index for further read or write operations.
|
static TenantIndex |
createDefault()
Creates default implementation of
TenantIndex for a multi-tenant context. |
void |
keep(io.spine.core.TenantId id)
Stores the passed tenant ID in the index.
|
static TenantIndex |
singleTenant()
Obtains a
TenantIndex to be used in single-tenant context. |
void keep(io.spine.core.TenantId id)
java.util.Set<io.spine.core.TenantId> all()
void close()
Implementations may throw specific exceptions.
close
in interface java.lang.AutoCloseable
static TenantIndex createDefault()
TenantIndex
for a multi-tenant context.static TenantIndex singleTenant()
TenantIndex
to be used in single-tenant context.
This rudimentary implementation always returns pre-defined constant TenantId
value, which a single-tenant application does not need to use.