public class MetadataManagerImpl extends Object implements MetadataManager
Modifier and Type | Field and Description |
---|---|
static String |
JAR_EXTENSION |
protected static String |
pluginsFolder |
static String |
REGEXP |
Constructor and Description |
---|
MetadataManagerImpl() |
Modifier and Type | Method and Description |
---|---|
PluginInfo |
addPlugin(String fileName,
byte[] fileContents)
Adds a new plugin (custom element implementation) to the plugins register and its metadata to the
the meta-configuration register.
|
void |
exportPlugins(String folder)
Writes the collection of plugins files to the given folder.
|
void |
exportPlugins(String folder,
Collection<String> pluginNames)
Writes the collection of plugins files to the given folder.
|
Collection<String> |
getElementSubTypes(String type)
Obtains all the subTypes for the given element type with its meta-configuration available in the
system.
|
Collection<String> |
getElementTypes()
Obtains all the types of elements with its meta-configuration available in the system.
|
MetaConfiguration |
getMetaConfiguration(String type,
String subType)
Obtains the
MetaConfiguration for the element matching the specified type and
subType. |
Collection<MetaConfiguration> |
getMetaConfigurations(String type)
Obtains a Collection of
MetaConfiguration . |
Class<?> |
getPluginClass(MetaConfiguration metaConfig)
Returns the class implementing the plugin (custom element implementation).
|
Class<?> |
getPluginClass(String pluginName)
Returns the class implementing the the plugin (custom element implementation).
|
PluginInfo |
getPluginDetails(String pluginName)
Obtains the plugin details(custom element implementation) of the specified identifier.
|
Collection<PluginInfo> |
getPlugins()
Obtains the collection of plugins (custom element implementations ) registered in the
application.
|
Collection<String> |
importPlugins(String folder,
boolean replace)
Loads plugins files from the given folder.
|
protected void |
loadPluginsMetadata()
Loads the meta-configuration from the plugins directory.
|
void |
removePlugin(String pluginName)
Removes the plugin (custom element implementation) with the specified identifier and its
metadata.
|
public static final String JAR_EXTENSION
public static final String REGEXP
protected static String pluginsFolder
public MetadataManagerImpl() throws InternalErrorException
InternalErrorException
protected void loadPluginsMetadata()
public Collection<String> getElementTypes() throws InternalErrorException
MetadataManager
getElementTypes
in interface MetadataManager
InternalErrorException
- if a severe error occurs.public Collection<String> getElementSubTypes(String type) throws InstanceNotFoundException, InternalErrorException
MetadataManager
getElementSubTypes
in interface MetadataManager
InstanceNotFoundException
- if no element with the specified type could be found.InternalErrorException
- if a severe error occurs.public Collection<MetaConfiguration> getMetaConfigurations(String type) throws InstanceNotFoundException, InternalErrorException
MetadataManager
MetaConfiguration
. If the element is categorized according
to its type its meta-configuration is returned. If the element is categorized according to its
type and subtype the meta-configuration of all its subTypes is returned.getMetaConfigurations
in interface MetadataManager
InstanceNotFoundException
- if no element with the specified type could be found.InternalErrorException
- if a severe error occurs.public MetaConfiguration getMetaConfiguration(String type, String subType) throws InstanceNotFoundException, InternalErrorException
MetadataManager
MetaConfiguration
for the element matching the specified type and
subType.getMetaConfiguration
in interface MetadataManager
InstanceNotFoundException
- if no element with the specified type and subType could be
found.InternalErrorException
- if a severe error occurs.public PluginInfo addPlugin(String fileName, byte[] fileContents) throws DuplicateInstanceException, InternalErrorException
MetadataManager
addPlugin
in interface MetadataManager
fileName
- the name of the plugin jar file, that is the last name in the pathname's name
sequence.fileContents
- a byte array with the plugin jar file contents.PluginInfo
specifying the details of the plugin added.DuplicateInstanceException
- if a plugin with the same name already exists.InternalErrorException
- if a severe error occurs.public PluginInfo getPluginDetails(String pluginName) throws InstanceNotFoundException, InternalErrorException
MetadataManager
getPluginDetails
in interface MetadataManager
pluginName
- the unique identifier of the custom element the plugin implements, the name
acts as the subtype of the element too.PluginInfo
specifying the details of the plugin.InstanceNotFoundException
- if the plugin does not exist.InternalErrorException
public Collection<PluginInfo> getPlugins() throws InternalErrorException
MetadataManager
getPlugins
in interface MetadataManager
PluginInfo
.InternalErrorException
public void removePlugin(String pluginName) throws InstanceNotFoundException, InternalErrorException
MetadataManager
removePlugin
in interface MetadataManager
InstanceNotFoundException
- if the plugin does not exist.InternalErrorException
- if a severe error occurs.public Class<?> getPluginClass(MetaConfiguration metaConfig) throws InstanceNotFoundException, InternalErrorException
MetadataManager
getPluginClass
in interface MetadataManager
InstanceNotFoundException
- if the plugin does not exist.InternalErrorException
- if a severe error occurs.public Class<?> getPluginClass(String pluginName) throws InstanceNotFoundException, InternalErrorException
MetadataManager
getPluginClass
in interface MetadataManager
InstanceNotFoundException
- if the plugin does not exist.InternalErrorException
- if a severe error occurs.public void exportPlugins(String folder)
MetadataManager
exportPlugins
in interface MetadataManager
public void exportPlugins(String folder, Collection<String> pluginNames)
MetadataManager
exportPlugins
in interface MetadataManager
pluginNames
- Collectionpublic Collection<String> importPlugins(String folder, boolean replace)
MetadataManager
importPlugins
in interface MetadataManager
replace
- if any existing plugin in the application should be replaced, and false otherwise.Copyright © 2025 Denodo Technologies. All rights reserved.