public class ZooKeeperComposedModuleDefinitionRegistry extends java.lang.Object implements WriteableModuleRegistry
WriteableModuleRegistry dedicated to CompositeModuleDefinitions and that
uses ZooKeeper as storage mechanism.
Writes each definition to a node, such as:
/xd/modules/[moduletype]/[modulename] with the node data being a JSON representation of the module
definition.
| Constructor and Description |
|---|
ZooKeeperComposedModuleDefinitionRegistry(ModuleDependencyRepository moduleDependencyRepository,
ZooKeeperConnection zooKeeperConnection) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(ModuleDefinition definition)
Attempt to delete the given definition, if that registry is responsible for it.
|
ModuleDefinition |
findDefinition(java.lang.String name,
ModuleType type)
Lookup a module of the given type with the given name.
|
java.util.List<ModuleDefinition> |
findDefinitions()
Returns all module definitions.
|
java.util.List<ModuleDefinition> |
findDefinitions(ModuleType type)
Searches the registry for the type specified and returns all module definitions that match the type.
|
java.util.List<ModuleDefinition> |
findDefinitions(java.lang.String name)
Searches the registry for the name specified and returns all module definitions that match the name regardless of
module type.
|
boolean |
registerNew(ModuleDefinition definition)
Attempt to register the given definition, if that registry can handle it.
|
@Autowired public ZooKeeperComposedModuleDefinitionRegistry(ModuleDependencyRepository moduleDependencyRepository, ZooKeeperConnection zooKeeperConnection)
public boolean delete(ModuleDefinition definition)
WriteableModuleRegistrydelete in interface WriteableModuleRegistrypublic boolean registerNew(ModuleDefinition definition)
WriteableModuleRegistryregisterNew in interface WriteableModuleRegistrypublic ModuleDefinition findDefinition(java.lang.String name, ModuleType type)
ModuleRegistryfindDefinition in interface ModuleRegistrynull if this registry does not have such a modulepublic java.util.List<ModuleDefinition> findDefinitions(java.lang.String name)
ModuleRegistryfindDefinitions in interface ModuleRegistryname - The module definition name to be searched.public java.util.List<ModuleDefinition> findDefinitions(ModuleType type)
ModuleRegistryfindDefinitions in interface ModuleRegistrytype - The module type name to be searched.public java.util.List<ModuleDefinition> findDefinitions()
ModuleRegistryfindDefinitions in interface ModuleRegistry