public class MetadataManagerImpl extends java.lang.Object implements MetadataManager
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JAR_EXTENSION |
protected static java.lang.String |
pluginsFolder |
static java.lang.String |
REGEXP |
| Constructor and Description |
|---|
MetadataManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
PluginInfo |
addPlugin(java.lang.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(java.lang.String folder)
Writes the collection of plugins files to the given folder.
|
void |
exportPlugins(java.lang.String folder,
java.util.Collection<java.lang.String> pluginNames)
Writes the collection of plugins files to the given folder.
|
java.util.Collection<java.lang.String> |
getElementSubTypes(java.lang.String type)
Obtains all the subTypes for the given element type with its meta-configuration available in the
system.
|
java.util.Collection<java.lang.String> |
getElementTypes()
Obtains all the types of elements with its meta-configuration available in the system.
|
MetaConfiguration |
getMetaConfiguration(java.lang.String type,
java.lang.String subType)
Obtains the
MetaConfiguration for the element matching the specified type and
subType. |
java.util.Collection<MetaConfiguration> |
getMetaConfigurations(java.lang.String type)
Obtains a Collection of
MetaConfiguration. |
java.lang.Class<?> |
getPluginClass(MetaConfiguration metaConfig)
Returns the class implementing the plugin (custom element implementation).
|
java.lang.Class<?> |
getPluginClass(java.lang.String pluginName)
Returns the class implementing the the plugin (custom element implementation).
|
PluginInfo |
getPluginDetails(java.lang.String pluginName)
Obtains the plugin details(custom element implementation) of the specified identifier.
|
java.util.Collection<PluginInfo> |
getPlugins()
Obtains the collection of plugins (custom element implementations ) registered in the
application.
|
java.util.Collection<java.lang.String> |
importPlugins(java.lang.String folder,
boolean replace)
Loads plugins files from the given folder.
|
protected void |
loadPluginsMetadata()
Loads the meta-configuration from the plugins directory.
|
void |
removePlugin(java.lang.String pluginName)
Removes the plugin (custom element implementation) with the specified identifier and its
metadata.
|
public static final java.lang.String JAR_EXTENSION
public static final java.lang.String REGEXP
protected static java.lang.String pluginsFolder
public MetadataManagerImpl()
throws InternalErrorException
InternalErrorExceptionprotected void loadPluginsMetadata()
public java.util.Collection<java.lang.String> getElementTypes()
throws InternalErrorException
MetadataManagergetElementTypes in interface MetadataManagerInternalErrorException - if a severe error occurs.public java.util.Collection<java.lang.String> getElementSubTypes(java.lang.String type)
throws InstanceNotFoundException,
InternalErrorException
MetadataManagergetElementSubTypes in interface MetadataManagerInstanceNotFoundException - if no element with the specified type could be found.InternalErrorException - if a severe error occurs.public java.util.Collection<MetaConfiguration> getMetaConfigurations(java.lang.String type) throws InstanceNotFoundException, InternalErrorException
MetadataManagerMetaConfiguration. 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 MetadataManagerInstanceNotFoundException - if no element with the specified type could be found.InternalErrorException - if a severe error occurs.public MetaConfiguration getMetaConfiguration(java.lang.String type, java.lang.String subType) throws InstanceNotFoundException, InternalErrorException
MetadataManagerMetaConfiguration for the element matching the specified type and
subType.getMetaConfiguration in interface MetadataManagerInstanceNotFoundException - if no element with the specified type and subType could be
found.InternalErrorException - if a severe error occurs.public PluginInfo addPlugin(java.lang.String fileName, byte[] fileContents) throws DuplicateInstanceException, InternalErrorException
MetadataManageraddPlugin in interface MetadataManagerfileName - 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(java.lang.String pluginName) throws InstanceNotFoundException, InternalErrorException
MetadataManagergetPluginDetails in interface MetadataManagerpluginName - 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.InternalErrorExceptionpublic java.util.Collection<PluginInfo> getPlugins() throws InternalErrorException
MetadataManagergetPlugins in interface MetadataManagerPluginInfo.InternalErrorExceptionpublic void removePlugin(java.lang.String pluginName)
throws InstanceNotFoundException,
InternalErrorException
MetadataManagerremovePlugin in interface MetadataManagerInstanceNotFoundException - if the plugin does not exist.InternalErrorException - if a severe error occurs.public java.lang.Class<?> getPluginClass(MetaConfiguration metaConfig) throws InstanceNotFoundException, InternalErrorException
MetadataManagergetPluginClass in interface MetadataManagerInstanceNotFoundException - if the plugin does not exist.InternalErrorException - if a severe error occurs.public java.lang.Class<?> getPluginClass(java.lang.String pluginName)
throws InstanceNotFoundException,
InternalErrorException
MetadataManagergetPluginClass in interface MetadataManagerInstanceNotFoundException - if the plugin does not exist.InternalErrorException - if a severe error occurs.public void exportPlugins(java.lang.String folder)
MetadataManagerexportPlugins in interface MetadataManagerpublic void exportPlugins(java.lang.String folder,
java.util.Collection<java.lang.String> pluginNames)
MetadataManagerexportPlugins in interface MetadataManagerpluginNames - Collectionpublic java.util.Collection<java.lang.String> importPlugins(java.lang.String folder,
boolean replace)
MetadataManagerimportPlugins in interface MetadataManagerreplace - if any existing plugin in the application should be replaced, and false otherwise.Copyright © 2024 Denodo Technologies. All rights reserved.