Class MetadataManagerImpl
java.lang.Object
com.denodo.configuration.metadata.manager.MetadataManagerImpl
- All Implemented Interfaces:
MetadataManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a new plugin (custom element implementation) to the plugins register and its metadata to the the meta-configuration register.voidexportPlugins(String folder) Writes the collection of plugins files to the given folder.voidexportPlugins(String folder, Collection<String> pluginNames) Writes the collection of plugins files to the given folder.getElementSubTypes(String type) Obtains all the subTypes for the given element type with its meta-configuration available in the system.Obtains all the types of elements with its meta-configuration available in the system.getMetaConfiguration(String type, String subType) Obtains theMetaConfigurationfor the element matching the specified type and subType.getMetaConfigurations(String type) Obtains a Collection ofMetaConfiguration.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).getPluginDetails(String pluginName) Obtains the plugin details(custom element implementation) of the specified identifier.Obtains the collection of plugins (custom element implementations ) registered in the application.importPlugins(String folder, boolean replace) Loads plugins files from the given folder.protected voidLoads the meta-configuration from the plugins directory.voidremovePlugin(String pluginName) Removes the plugin (custom element implementation) with the specified identifier and its metadata.
-
Field Details
-
JAR_EXTENSION
- See Also:
-
REGEXP
- See Also:
-
pluginsFolder
-
-
Constructor Details
-
MetadataManagerImpl
- Throws:
InternalErrorException
-
-
Method Details
-
loadPluginsMetadata
protected void loadPluginsMetadata()Loads the meta-configuration from the plugins directory. -
getElementTypes
Description copied from interface:MetadataManagerObtains all the types of elements with its meta-configuration available in the system.- Specified by:
getElementTypesin interfaceMetadataManager- Returns:
- Collection of element types.
- Throws:
InternalErrorException- if a severe error occurs.
-
getElementSubTypes
public Collection<String> getElementSubTypes(String type) throws InstanceNotFoundException, InternalErrorException Description copied from interface:MetadataManagerObtains all the subTypes for the given element type with its meta-configuration available in the system.- Specified by:
getElementSubTypesin interfaceMetadataManager- Returns:
- Collection of all the subtypes of the given element type.
- Throws:
InstanceNotFoundException- if no element with the specified type could be found.InternalErrorException- if a severe error occurs.
-
getMetaConfigurations
public Collection<MetaConfiguration> getMetaConfigurations(String type) throws InstanceNotFoundException, InternalErrorException Description copied from interface:MetadataManagerObtains a Collection ofMetaConfiguration. 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.- Specified by:
getMetaConfigurationsin interfaceMetadataManager- Returns:
- Collection of MetaConfiguration
- Throws:
InstanceNotFoundException- if no element with the specified type could be found.InternalErrorException- if a severe error occurs.
-
getMetaConfiguration
public MetaConfiguration getMetaConfiguration(String type, String subType) throws InstanceNotFoundException, InternalErrorException Description copied from interface:MetadataManagerObtains theMetaConfigurationfor the element matching the specified type and subType.- Specified by:
getMetaConfigurationin interfaceMetadataManager- Returns:
- MetaConfiguration
- Throws:
InstanceNotFoundException- if no element with the specified type and subType could be found.InternalErrorException- if a severe error occurs.
-
addPlugin
public PluginInfo addPlugin(String fileName, byte[] fileContents) throws DuplicateInstanceException, InternalErrorException Description copied from interface:MetadataManagerAdds a new plugin (custom element implementation) to the plugins register and its metadata to the the meta-configuration register. The plugin jar file is copied to the plugin folder of the application. The plugin manifest file should include a section started with an attribute with the name as "Name" and value "CustomElement". This section should cointain three attributes:- "PluginType": the type of the custom element the plugin implements
- "PluginName": the unique identifier of the custom element the plugin implements, the name acts as the subtype of the element too
- "PluginClass": the implementation class name of the custom element
- Specified by:
addPluginin interfaceMetadataManager- Parameters:
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.- Returns:
- a
PluginInfospecifying the details of the plugin added. - Throws:
DuplicateInstanceException- if a plugin with the same name already exists.InternalErrorException- if a severe error occurs.
-
getPluginDetails
public PluginInfo getPluginDetails(String pluginName) throws InstanceNotFoundException, InternalErrorException Description copied from interface:MetadataManagerObtains the plugin details(custom element implementation) of the specified identifier.- Specified by:
getPluginDetailsin interfaceMetadataManager- Parameters:
pluginName- the unique identifier of the custom element the plugin implements, the name acts as the subtype of the element too.- Returns:
- a
PluginInfospecifying the details of the plugin. - Throws:
InstanceNotFoundException- if the plugin does not exist.InternalErrorException
-
getPlugins
Description copied from interface:MetadataManagerObtains the collection of plugins (custom element implementations ) registered in the application.- Specified by:
getPluginsin interfaceMetadataManager- Returns:
- a Collection of
PluginInfo. - Throws:
InternalErrorException
-
removePlugin
public void removePlugin(String pluginName) throws InstanceNotFoundException, InternalErrorException Description copied from interface:MetadataManagerRemoves the plugin (custom element implementation) with the specified identifier and its metadata. Also removes all the configuration elements that matches the type and subtype (the plugin name) of the plugin removed.- Specified by:
removePluginin interfaceMetadataManager- Throws:
InstanceNotFoundException- if the plugin does not exist.InternalErrorException- if a severe error occurs.
-
getPluginClass
public Class<?> getPluginClass(MetaConfiguration metaConfig) throws InstanceNotFoundException, InternalErrorException Description copied from interface:MetadataManagerReturns the class implementing the plugin (custom element implementation).- Specified by:
getPluginClassin interfaceMetadataManager- Returns:
- the class implementing the given plugin (a custom element).
- Throws:
InstanceNotFoundException- if the plugin does not exist.InternalErrorException- if a severe error occurs.
-
getPluginClass
public Class<?> getPluginClass(String pluginName) throws InstanceNotFoundException, InternalErrorException Description copied from interface:MetadataManagerReturns the class implementing the the plugin (custom element implementation).- Specified by:
getPluginClassin interfaceMetadataManager- Returns:
- the class implementing the given plugin (a custom element).
- Throws:
InstanceNotFoundException- if the plugin does not exist.InternalErrorException- if a severe error occurs.
-
exportPlugins
Description copied from interface:MetadataManagerWrites the collection of plugins files to the given folder.- Specified by:
exportPluginsin interfaceMetadataManager
-
exportPlugins
Description copied from interface:MetadataManagerWrites the collection of plugins files to the given folder.- Specified by:
exportPluginsin interfaceMetadataManagerpluginNames- Collectionwith the names of the plugins that will be exported.
-
importPlugins
Description copied from interface:MetadataManagerLoads plugins files from the given folder.- Specified by:
importPluginsin interfaceMetadataManagerreplace- if any existing plugin in the application should be replaced, and false otherwise.- Returns:
- Collection
a Collection of warnings informing the plugins that were replaced (if replace is true) or the plugins that were maintained as is (if replaces is false).
-