protected static class BasePluginRegistryTest.LocatorFixture extends Object implements ConnectorLocator
| Constructor and Description |
|---|
LocatorFixture() |
| Modifier and Type | Method and Description |
|---|---|
StoragePlugins |
bootstrapPlugins()
When starting a new installation, called to load bootstrap
plugins (configurations) that come "out-of-the-box."
|
void |
close() |
Set<Class<? extends StoragePluginConfig>> |
configClasses()
Return the set of known storage plugin configuration classes for which
the user can create configs.
|
Class<? extends StoragePlugin> |
connectorClassFor(Class<? extends StoragePluginConfig> configClass)
Given a configuration class, return the corresponding connector
(plugin) class.
|
StoragePlugin |
create(String name,
StoragePluginConfig config)
Create a connector instance given a named configuration.
|
StoragePlugin |
get(String name)
Retrieve an instance of the named connector with default configuration.
|
void |
init()
Initialize the locator.
|
Collection<StoragePlugin> |
intrinsicPlugins()
Enumerate the intrinsic plugins.
|
void |
onUpgrade()
If
updatedPlugins() returned non-null, then the
registry will call this method after successful update of
the persistent store. |
boolean |
storable() |
StoragePlugins |
updatedPlugins()
Identify plugins to be added to an existing system, typically
on the first run after an upgrade.
|
public void init()
ConnectorLocatorinit in interface ConnectorLocatorpublic StoragePlugins bootstrapPlugins()
ConnectorLocatorbootstrapPlugins in interface ConnectorLocatornull if this locator
does not provide bootstrap pluginspublic StoragePlugins updatedPlugins()
ConnectorLocatorTODO: The current mechanism depends on deleting a file after the first run, which is unreliable. It won't, for example, correctly handle a restored ZK. A better mechanism would store a version number in the persistent store, and pass that version number into this method.
updatedPlugins in interface ConnectorLocatorpublic void onUpgrade()
ConnectorLocatorupdatedPlugins() returned non-null, then the
registry will call this method after successful update of
the persistent store. This method can do any post-update
cleanup, such as deleting the file mentioned above.onUpgrade in interface ConnectorLocatorpublic Collection<StoragePlugin> intrinsicPlugins()
ConnectorLocatorintrinsicPlugins in interface ConnectorLocatorpublic StoragePlugin get(String name)
ConnectorLocatorget in interface ConnectorLocatorname - the name of a connector class (not the name of
a plugin (configuration)public Set<Class<? extends StoragePluginConfig>> configClasses()
ConnectorLocatorconfigClasses in interface ConnectorLocatorpublic StoragePlugin create(String name, StoragePluginConfig config) throws Exception
ConnectorLocatorcreate in interface ConnectorLocatorname - name of the storage plugin (configuration).config - the deserialized Java configuration object.ExecutionSetupException - for all errorsExceptionpublic boolean storable()
storable in interface ConnectorLocatorpublic Class<? extends StoragePlugin> connectorClassFor(Class<? extends StoragePluginConfig> configClass)
ConnectorLocatorconnectorClassFor in interface ConnectorLocatorpublic void close()
close in interface ConnectorLocatorCopyright © 2021 The Apache Software Foundation. All rights reserved.