Class OsgiAIConfigurationPluginImpl
- java.lang.Object
-
- com.composum.ai.backend.slingbase.impl.OsgiAIConfigurationPluginImpl
-
- All Implemented Interfaces:
AIConfigurationPlugin
public class OsgiAIConfigurationPluginImpl extends Object implements AIConfigurationPlugin
This implementation sources its configurations from the OSGI environment, specifically from instances ofGPTPermissionConfiguration
. We use a factory to allow multiple instances of the configuration; if there are no configuration entries in the factory we use the (single) configuration of this service as fallback - which might just be the defaults.- See Also:
AIConfigurationPlugin
,GPTPermissionConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description protected List<OsgiAIConfigurationPluginFactory>
factoryList
-
Constructor Summary
Constructors Constructor Description OsgiAIConfigurationPluginImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
activate(GPTPermissionConfiguration configuration)
List<GPTPermissionConfiguration>
allowedServices(org.apache.sling.api.SlingHttpServletRequest request, String contentPath)
Determines the allowed services based on the provided request, content path, and editor URL.protected void
deactivate()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.composum.ai.backend.slingbase.AIConfigurationPlugin
getGPTConfiguration, getGPTConfigurationMap, getGPTPromptLibraryPaths, getGPTPromptLibraryPathsDefault
-
-
-
-
Field Detail
-
factoryList
protected volatile List<OsgiAIConfigurationPluginFactory> factoryList
-
-
Method Detail
-
activate
protected void activate(GPTPermissionConfiguration configuration)
-
deactivate
protected void deactivate()
-
allowedServices
@Nullable public List<GPTPermissionConfiguration> allowedServices(org.apache.sling.api.SlingHttpServletRequest request, String contentPath)
Description copied from interface:AIConfigurationPlugin
Determines the allowed services based on the provided request, content path, and editor URL.- Specified by:
allowedServices
in interfaceAIConfigurationPlugin
- Parameters:
request
- The SlingHttpServletRequest representing the current request.contentPath
- The path of the content being edited.- Returns:
- A set of allowed services; null if this plugin doesn't implement this method.
- See Also:
GPTPermissionInfo.SERVICE_CATEGORIZE
,GPTPermissionInfo.SERVICE_CREATE
,GPTPermissionInfo.SERVICE_SIDEPANEL
,GPTPermissionInfo.SERVICE_TRANSLATE
-
-