public interface Repository<T extends ManagedEntity>
ManagedEntity like
NamedDataSource, NamedSchema, and NamedQuery.| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Class<?> clazz)
Check if the given type of entity can be managed by this repository.
|
T |
get(String id)
Get entity from repository by id.
|
Class<T> |
getEntityClass()
Get class of managed entities.
|
default T |
getOrCreate(String id)
Get or create entity from repository by id.
|
List<UsageStats> |
getUsageStats()
Get usage statistics of the repository.
|
void |
put(String id,
T entity)
Put a named entity into the repository.
|
void |
registerType(String type,
Extension<T> extension)
Register new type of entity to be manged in this repository.
|
String |
resolve(String name)
Resolve given name.
|
Class<T> getEntityClass()
boolean accept(Class<?> clazz)
clazz - class of the entityString resolve(String name)
jdbc:clickhouse:{{ ch-server.somedomain }}/system will be resolved to
something like jdbc:clickhouse:127.0.0.1:8123/system.name - name to resolveList<UsageStats> getUsageStats()
void registerType(String type, Extension<T> extension)
type - type of entity, defaults to extension class nameextension - extension for instantiate new type of entityvoid put(String id, T entity)
id - id of the entity, could be nullentity - non-null entity to be addedT get(String id)
id - id of the entityCopyright © 2019–2021. All rights reserved.