Interface MetadataManager

All Known Implementing Classes:
MetadataManagerImpl

public interface MetadataManager
  • Method Details

    • getElementTypes

      Collection<String> getElementTypes() throws InternalErrorException
      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

      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

      Obtains a Collection of 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.
      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 the MetaConfiguration for 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
      otherwise the plugin will not be registered.
      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 PluginInfo specifying 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 PluginInfo specifying 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

      void removePlugin(String pluginName) throws InstanceNotFoundException, InternalErrorException
      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

      Class<?> getPluginClass(String pluginName) throws InstanceNotFoundException, InternalErrorException
      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

      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

      void exportPlugins(String folder)
      Writes the collection of plugins files to the given folder.
      Parameters:
      folder -
    • exportPlugins

      void exportPlugins(String folder, Collection<String> pluginKeys)
      Writes the collection of plugins files to the given folder.
      Parameters:
      folder -
      pluginKeys - Collection with the names of the plugins that will be exported.
    • importPlugins

      Collection<String> importPlugins(String folder, boolean replace)
      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).