Class Plugin

Direct Known Subclasses:
Plugin

public class Plugin extends StorableObject
A bundle of add-on functionality to the system. The plug-in bundles types, code, JAR files, web files and data objects into a storage bundle that can be loaded and unloaded dynamically. A plug-in is usually distributed as a ZIP file with the '.plugin' file extension.
Version:
1.0
  • Field Details

    • KEY_NAME

      public static final String KEY_NAME
      The dictionary key for the plug-in name.
      See Also:
    • KEY_DESCRIPTION

      public static final String KEY_DESCRIPTION
      The dictionary key for the plug-in description text.
      See Also:
    • KEY_VERSION

      public static final String KEY_VERSION
      The dictionary key for the plug-in build version.
      See Also:
    • KEY_PLATFORM

      @Deprecated(forRemoval=true) public static final String KEY_PLATFORM
      Deprecated, for removal: This API element is subject to removal in a future version.
      The dictionary key for the minimum platform version needed.
      See Also:
    • KEY_DATE

      public static final String KEY_DATE
      The dictionary key for the plug-in build date.
      See Also:
    • PATH

      public static final Path PATH
      The plug-in object storage path.
    • PATH_STORAGE

      public static final Path PATH_STORAGE
      The storage path to mounted plug-in storages.
    • PATH_CACHE

      public static final Path PATH_CACHE
      The storage path to mounted plug-in caches.
  • Constructor Details

    • Plugin

      public Plugin(String id, String type, Dict dict)
      Creates a new plug-in from a serialized representation.
      Parameters:
      id - the object identifier
      type - the object type name
      dict - the serialized representation
  • Method Details

    • storagePath

      public static Path storagePath(String pluginId)
      Returns the plug-in storage path for a specified plug-in id.
      Parameters:
      pluginId - the unique plug-in id
      Returns:
      the plug-in storage path
    • cachePath

      public static Path cachePath(String pluginId)
      Returns the plug-in cache path for a specified plug-in id.
      Parameters:
      pluginId - the unique plug-in id
      Returns:
      the plug-in cache path
    • instancePath

      public static Path instancePath(String pluginId)
      Returns the object path for a loaded and initialized plug-in.
      Parameters:
      pluginId - the unique plug-in id
      Returns:
      the plug-in storage path
    • configPath

      public static Path configPath(String pluginId)
      Returns the object path for a plug-in configuration object. This path with point directly to the mounted plug-in storage.
      Parameters:
      pluginId - the unique plug-in id
      Returns:
      the plug-in storage path
    • source

      public static String source(Metadata meta)
      Returns the plug-in identifier for a storage object. The metadata storage paths will be used to return the first matching plug-in.
      Parameters:
      meta - the metadata object
      Returns:
      the plug-in identifier, or null if not found
    • version

      public static String version(Storage storage, String pluginId)
      Returns the current version for a loaded plug-in. The plug-in instance will be loaded from storage (cache) and its version number will be returned.
      Parameters:
      storage - the storage to use
      pluginId - the unique plug-in id
      Returns:
      the loaded plug-in version number, or null if not loaded or available
    • normalize

      public static Dict normalize(String id, Dict dict)
      Normalizes a plug-in data object if needed. This method will modify legacy data into the proper keys and values.
      Parameters:
      id - the object identifier
      dict - the storage data
      Returns:
      the storage data (possibly modified)
    • version

      public String version()
      Returns the plug-in version number (if available).
      Returns:
      the plug-in version number, or null if not available