Package org.rapidcontext.core.type
Class Plugin
java.lang.Object
org.rapidcontext.core.storage.StorableObject
org.rapidcontext.core.type.Plugin
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe dictionary key for the plug-in copyright notice.static final StringThe dictionary key for the plug-in build date.static final StringThe dictionary key for the plug-in description text.static final StringThe dictionary key for the plug-in name.static final StringThe dictionary key for the plug-in build version.static final PathThe plug-in object storage path.static final PathThe storage path to mounted plug-in caches.static final PathThe storage path to mounted plug-in storages.Fields inherited from class org.rapidcontext.core.storage.StorableObject
dict, KEY_ACTIVATED_TIME, KEY_CLASSNAME, KEY_ID, KEY_TYPE, PREFIX_COMPUTED, PREFIX_HIDDEN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathReturns the plug-in cache path for a specified plug-in id.static PathconfigPath(String pluginId) Returns the object path for a plug-in configuration object.static PathinstancePath(String pluginId) Returns the object path for a loaded and initialized plug-in.static DictNormalizes a plug-in data object if needed.static StringReturns the plug-in identifier for a storage object.static PathstoragePath(String pluginId) Returns the plug-in storage path for a specified plug-in id.version()Returns the plug-in version number (if available).
-
Field Details
-
KEY_NAME
The dictionary key for the plug-in name.- See Also:
-
KEY_DESCRIPTION
The dictionary key for the plug-in description text.- See Also:
-
KEY_VERSION
The dictionary key for the plug-in build version.- See Also:
-
KEY_DATE
The dictionary key for the plug-in build date.- See Also:
-
KEY_COPYRIGHT
The dictionary key for the plug-in copyright notice.- See Also:
-
PATH
The plug-in object storage path. -
PATH_STORAGE
The storage path to mounted plug-in storages. -
PATH_CACHE
The storage path to mounted plug-in caches.
-
-
Constructor Details
-
Plugin
Creates a new plug-in from a serialized representation.- Parameters:
id- the object identifiertype- the object type namedict- the serialized representation
-
-
Method Details
-
storagePath
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
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
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
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
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
-
normalize
Normalizes a plug-in data object if needed. This method will modify legacy data into the proper keys and values.- Parameters:
id- the object identifierdict- the storage data- Returns:
- the storage data (possibly modified)
-
version
Returns the plug-in version number (if available).- Returns:
- the plug-in version number, or null if not available
-