Interface MetadataManager
- All Known Implementing Classes:
MetadataManagerImpl
public interface MetadataManager
-
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> pluginKeys) 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.voidremovePlugin(String pluginName) Removes the plugin (custom element implementation) with the specified identifier and its metadata.
-
Method Details
-
getElementTypes
Obtains all the types of elements with its meta-configuration available in the system.- Returns:
- Collection of element types.
- Throws:
InternalErrorException- if a severe error occurs.
-
getElementSubTypes
Collection<String> getElementSubTypes(String type) throws InstanceNotFoundException, InternalErrorException Obtains all the subTypes for the given element type with its meta-configuration available in the system.- Parameters:
type-- 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
Collection<MetaConfiguration> getMetaConfigurations(String type) throws InstanceNotFoundException, InternalErrorException Obtains 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.- Parameters:
type-- Returns:
- Collection of MetaConfiguration
- Throws:
InstanceNotFoundException- if no element with the specified type could be found.InternalErrorException- if a severe error occurs.
-
getMetaConfiguration
MetaConfiguration getMetaConfiguration(String type, String subType) throws InstanceNotFoundException, InternalErrorException Obtains theMetaConfigurationfor the element matching the specified type and subType.- Parameters:
type-subType-- Returns:
- MetaConfiguration
- Throws:
InstanceNotFoundException- if no element with the specified type and subType could be found.InternalErrorException- if a severe error occurs.
-
addPlugin
PluginInfo addPlugin(String fileName, byte[] fileContents) throws DuplicateInstanceException, InternalErrorException Adds 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
- 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
PluginInfo getPluginDetails(String pluginName) throws InstanceNotFoundException, InternalErrorException Obtains the plugin details(custom element implementation) of the specified identifier.- 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
Obtains the collection of plugins (custom element implementations ) registered in the application.- Returns:
- a Collection of
PluginInfo. - Throws:
InternalErrorException
-
removePlugin
Removes 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.- Parameters:
pluginName-- Throws:
InstanceNotFoundException- if the plugin does not exist.InternalErrorException- if a severe error occurs.
-
getPluginClass
Returns the class implementing the the plugin (custom element implementation).- Parameters:
pluginName-- 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
Class<?> getPluginClass(MetaConfiguration metaConfig) throws InstanceNotFoundException, InternalErrorException Returns the class implementing the plugin (custom element implementation).- Parameters:
metaConfig-- 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
Writes the collection of plugins files to the given folder.- Parameters:
folder-
-
exportPlugins
Writes the collection of plugins files to the given folder.- Parameters:
folder-pluginKeys- Collectionwith the names of the plugins that will be exported.
-
importPlugins
Loads plugins files from the given folder.- Parameters:
folder-replace- 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).
-