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.
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The dictionary key for the plug-in copyright notice.static final String
The dictionary key for the plug-in build date.static final String
The dictionary key for the plug-in description text.static final String
The dictionary key for the plug-in name.static final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
The dictionary key for the plug-in build version.static final Path
The plug-in object storage path.static final Path
The storage path to mounted plug-in caches.static final Path
The 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 Path
Returns the plug-in cache path for a specified plug-in id.static Path
configPath
(String pluginId) Returns the object path for a plug-in configuration object.static Path
instancePath
(String pluginId) Returns the object path for a loaded and initialized plug-in.static Dict
Normalizes a plug-in data object if needed.static String
Returns the plug-in identifier for a storage object.static Path
storagePath
(String pluginId) Returns the plug-in storage path for a specified plug-in id.version()
Returns the plug-in version number (if available).static String
Deprecated, for removal: This API element is subject to removal in a future version.Use #version() on the instance instead.Methods inherited from class org.rapidcontext.core.storage.StorableObject
activate, activatedTime, destroy, id, init, isActive, isModified, passivate, path, serialize, sterilize, toString, type
-
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_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
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
-
version
Deprecated, for removal: This API element is subject to removal in a future version.Use #version() on the instance instead.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 usepluginId
- the unique plug-in id- Returns:
- the loaded plug-in version number, or null if not loaded or available
-
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
-