Package de.xima.fc.plugin
Class PluginManager
- java.lang.Object
- 
- de.xima.fc.plugin.PluginManager
 
- 
 public class PluginManager extends Object Class for managing plugins- Author:
- XIMA MEDIA GmbH
 
- 
- 
Constructor SummaryConstructors Constructor Description PluginManager()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcreateClientProtocolEntry(UserContext uc, Mandant man, String protocolEntry, Object... params)Creates a client protocol entrystatic voidcreateMandantProtocolEntry(IEntityContext ec, Mandant man, String protocolEntry, Object... params)static voidcreateSystemProtocolEntry(UserContext uc, String protocolEntry, Object... params)Creates a system protocol entrystatic voiddeletePlugin(PluginRuntime prtm)Deprecated.static voiddeletePlugin(String scopeKey, String runtimeKey)Deprecated.static Set<IFCPlugin>getAllPlugins(Mandant man, EPluginTypes type)Deprecated.static <T extends IFCPlugin>
 Set<T>getAllPlugins(Mandant client, Class<T> pluginType)Get a set of plugins with the given interface registered in system-scope OR to the given client.static <T extends IFCPlugin>
 Set<T>getAllPlugins(UUID clientUuid, Class<T> pluginType)Get a set of plugins with the given interface registered in system-scope OR to the given client.static <T extends IFCPlugin>
 Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>>getAllPluginsWithRuntime(Mandant man, Class<T> clazz)static <T extends IFCPlugin>
 Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>>getAllPluginsWithRuntime(UUID clientUuid, Class<T> clazz)static Set<PluginRuntime>getClientPlugins(Mandant client)Gets a list of allplugin runtimesregistered to the given client (not including system plugins!)static <T extends IFCPlugin>
 Set<T>getClientPlugins(Mandant client, Class<T> pluginType)Get a set of plugins with the given interfaces registered to the given clientstatic Set<PluginRuntime>getClientPlugins(UUID clientUuid)Gets a list of allplugin runtimesregistered to the given client (not including system plugins!)static <T extends IFCPlugin>
 Set<T>getClientPlugins(UUID clientUuid, Class<T> pluginType)Get a set of plugins with the given interfaces registered to the given clientstatic <T extends IFCPlugin>
 Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>>getClientPluginsWithRuntime(Mandant client, Class<T> clazz)static <T extends IFCPlugin>
 Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>>getClientPluginsWithRuntime(UUID clientUuid, Class<T> clazz)static IFCPlugingetMandantPluginByName(Mandant man, EPluginTypes type, String pluginName)Deprecated.will be removed!static FilegetMandantPluginJar(Mandant man, String jarName)Deprecated.static List<PluginRuntime>getMandantPlugins(Mandant man)Deprecated.static SortedSet<IFCPlugin>getMandantPlugins(Mandant man, EPluginTypes type)Deprecated.will be removed!static IPluginAuthenticatorTypegetPluginAuthenticatorType(IAuthenticator<?> authenticator)static org.apache.commons.lang3.tuple.Pair<PluginRuntime,IPluginAuthenticatorType>getPluginAuthenticatorTypeWithRuntime(IAuthenticator<?> authenticator)static IFCPlugingetPluginByName(Mandant man, EPluginTypes type, String pluginName)Deprecated.static <T extends IFCPlugin>
 TgetPluginByName(Mandant man, Class<T> clazz, String pluginName)Get a plugin by name andIFCPlugin-interface from client- and system-scopestatic <T extends IFCPlugin>
 org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>getPluginByNameWithRuntime(Mandant man, Class<T> clazz, String pluginName)static <T extends IFCPlugin>
 Map<EPluginScope,Set<String>>getPluginNameMap(Mandant mandant, Class<T> clazz)Deprecated.static Map<EPluginScope,Set<String>>getPluginNameMap(UserContext uc, Mandant mandant, EPluginTypes type)Deprecated.static <T extends IFCPlugin>
 Set<String>getPluginNames(Mandant mandant, Class<T> clazz)static Set<String>getPluginNames(UserContext uc, Mandant mandant, EPluginTypes type)Deprecated.static PluginRuntimegetPluginRuntime(String scopeKey, String runtimeKey)static <T extends IFCPlugin>
 Set<T>getRegisteredPlugins(Class<T> clazz)Get a set with all registered plugins of the givenIFCPlugin-interfacestatic IFCPlugingetSystemPluginByName(EPluginTypes type, String pluginName)Deprecated.static <T extends IFCPlugin>
 TgetSystemPluginByName(Class<T> clazz, String pluginName)Get a system-plugin by name,IFCPlugin-interfacestatic Set<PluginRuntime>getSystemPlugins()Get a List of allPluginRuntimes registered in system-scopestatic SortedSet<IFCPlugin>getSystemPlugins(EPluginTypes type)Deprecated.static <T extends IFCPlugin>
 Set<T>getSystemPlugins(Class<T> clazz)Get a set of plugins with the given interfaces registered in system-scopestatic <T extends IFCPlugin>
 Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>>getSystemPluginsWithRuntime(Class<T> clazz)static PluginRuntimeinitClientPlugin(File pluginJar, Mandant man)Deprecated.static voidinitPlugins()Initialize all plugins stored in the databasestatic PluginRuntimeinitSystemPlugin(File pluginJar)Deprecated.static voidinstall(IPluginEntity<?,?,?> pluginEntity)static booleanisPluginJar(File file)Deprecated.static <T extends IFCPlugin>
 voidregisterClientPlugin(Mandant man, Class<T> clazz, String runtimeKey)Method to register a plugin-class in scope of the given clientstatic voidregisterMandantPlugin(Mandant man, EPluginTypes typ, Class<? extends IFCPlugin> clazz)Deprecated.static <T extends IFCPlugin>
 voidregisterPlugin(boolean isInstall, PluginRuntime prtm, Class<T> clazz)Register a plugin to the given key andPluginRuntimestatic <T extends IFCPlugin>
 voidregisterPlugin(PluginRuntime prtm, Class<T> clazz)static voidregisterSystemPlugin(EPluginTypes typ, Class<? extends IFCPlugin> clazz)Deprecated.static voidregisterSystemPlugin(Class<? extends IFCPlugin> clazz, String runtimeKey)Method to register a plugin-class in system-scopestatic voidreleaseMandantPlugin(Mandant man, PluginRuntime pluginMeta)Deprecated.static voidreleasePlugin(boolean isUninstall, PluginRuntime prtm)static voidreleasePlugin(boolean isUninstall, String scopeKey, String runtimeKey)static voidreleasePlugin(PluginRuntime prtm)static voidreleasePlugin(String scopeKey, String runtimeKey)static voidreleasePlugins()Releases all registered pluginsstatic booleanscanAndRegisterMandantPlugin(Mandant man, PluginRuntime pluginMeta, byte[] jarData)Deprecated.static booleanscanAndRegisterSystemPlugin(PluginRuntime pluginMeta, byte[] jarData)Deprecated.static voidscanForAllPlugins()Deprecated.useinitPlugins()static voidsynchronizePlugin(boolean isInstall, PluginSyncData pluginData)static voiduninstallPlugin(String scopeKey, String runtimeKey)
 
- 
- 
- 
Method Detail- 
initPluginspublic static void initPlugins() Initialize all plugins stored in the database
 - 
synchronizePluginpublic static void synchronizePlugin(boolean isInstall, PluginSyncData pluginData) throws IOException, FCPluginException- Throws:
- IOException
- FCPluginException
 
 - 
registerSystemPluginpublic static void registerSystemPlugin(Class<? extends IFCPlugin> clazz, String runtimeKey) throws FCPluginException Method to register a plugin-class in system-scope- Parameters:
- clazz-- IFCPlugin-class to register
- runtimeKey- Runtime key (UUID) of the plugin to register.
- Throws:
- FCPluginException- When the the plugin could not be registered.
 
 - 
registerClientPluginpublic static <T extends IFCPlugin> void registerClientPlugin(Mandant man, Class<T> clazz, String runtimeKey) throws FCPluginException Method to register a plugin-class in scope of the given client- Type Parameters:
- T- Type of the plugin to register.
- Parameters:
- man- The- clientfor which to register the plugin.
- clazz- The class of the plugin to register.
- runtimeKey- Runtime key (UUID) of the plugin to register.
- Throws:
- FCPluginException- When the the plugin could not be registered.
 
 - 
registerPluginpublic static <T extends IFCPlugin> void registerPlugin(PluginRuntime prtm, Class<T> clazz) throws FCPluginException - Throws:
- FCPluginException
 
 - 
registerPluginpublic static <T extends IFCPlugin> void registerPlugin(boolean isInstall, PluginRuntime prtm, Class<T> clazz) throws FCPluginException Register a plugin to the given key andPluginRuntime- Type Parameters:
- T- Type of the plugin to register.
- Parameters:
- isInstall-- trueif the plugin is installed for the first time,- falseif the plugin configuration is only updated.
- prtm- The runtime of the plugin to register.
- clazz- Class of the plugin to register.
- Throws:
- FCPluginException- When the plugin could not be registered.
 
 - 
installpublic static void install(IPluginEntity<?,?,?> pluginEntity) throws IOException, FCPluginException - Throws:
- IOException
- FCPluginException
 
 - 
releasePluginpublic static void releasePlugin(String scopeKey, String runtimeKey) throws IOException - Throws:
- IOException
 
 - 
releasePluginpublic static void releasePlugin(boolean isUninstall, String scopeKey, String runtimeKey) throws IOException- Throws:
- IOException
 
 - 
releasePluginpublic static void releasePlugin(PluginRuntime prtm) throws IOException - Throws:
- IOException
 
 - 
releasePluginpublic static void releasePlugin(boolean isUninstall, PluginRuntime prtm) throws IOException- Throws:
- IOException
 
 - 
releasePluginspublic static void releasePlugins() Releases all registered plugins
 - 
uninstallPluginpublic static void uninstallPlugin(String scopeKey, String runtimeKey) throws IOException - Parameters:
- scopeKey- the plugin scope key
- runtimeKey- the plugin runtime key
- Throws:
- IOException- on errors while uninstall
 
 - 
getClientPluginspublic static <T extends IFCPlugin> Set<T> getClientPlugins(Mandant client, Class<T> pluginType) Get a set of plugins with the given interfaces registered to the given client- Parameters:
- client- The client-scope to use for retrieving client plugins, if any.
- pluginType- Type of the plugins to retrieve.
- Returns:
- All active plugins for the given client, if any (does not include systm plugins!)
 
 - 
getClientPluginspublic static <T extends IFCPlugin> Set<T> getClientPlugins(UUID clientUuid, Class<T> pluginType) Get a set of plugins with the given interfaces registered to the given client- Parameters:
- clientUuid- The client-scope to use for retrieving client plugins, if any.
- pluginType- Type of the plugins to retrieve.
- Returns:
- All active plugins for the given client, if any (does not include systm plugins!)
 
 - 
getClientPluginsWithRuntimepublic static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getClientPluginsWithRuntime(Mandant client, Class<T> clazz) 
 - 
getClientPluginsWithRuntimepublic static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getClientPluginsWithRuntime(UUID clientUuid, Class<T> clazz) 
 - 
getClientPluginspublic static Set<PluginRuntime> getClientPlugins(Mandant client) Gets a list of allplugin runtimesregistered to the given client (not including system plugins!)- Parameters:
- client- A client for which to retrieve the plugins.
- Returns:
- A list of all plugin runtimescorresponding to the plugin installed for the given client
 
 - 
getClientPluginspublic static Set<PluginRuntime> getClientPlugins(UUID clientUuid) Gets a list of allplugin runtimesregistered to the given client (not including system plugins!)- Parameters:
- clientUuid- UUID of a- client.
- Returns:
- A list of all plugin runtimescorresponding to the plugin installed for the given client
 
 - 
getPluginRuntimepublic static PluginRuntime getPluginRuntime(String scopeKey, String runtimeKey) 
 - 
getSystemPluginspublic static <T extends IFCPlugin> Set<T> getSystemPlugins(Class<T> clazz) Get a set of plugins with the given interfaces registered in system-scope
 - 
getSystemPluginsWithRuntimepublic static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getSystemPluginsWithRuntime(Class<T> clazz) 
 - 
getSystemPluginspublic static Set<PluginRuntime> getSystemPlugins() Get a List of allPluginRuntimes registered in system-scope- Returns:
- Setof- PluginRuntimes
 
 - 
getAllPluginspublic static <T extends IFCPlugin> Set<T> getAllPlugins(Mandant client, Class<T> pluginType) Get a set of plugins with the given interface registered in system-scope OR to the given client. (client-scope wins over system-scope)- Parameters:
- client- Client scope for which to retrieve all plugins.
- pluginType- Type of the plugins to retrieve.
- Returns:
- All plugins from the given client (if any) and from the system scope. A client-scoped plugin overwrites a system-scoped plugin.
 
 - 
getAllPluginspublic static <T extends IFCPlugin> Set<T> getAllPlugins(UUID clientUuid, Class<T> pluginType) Get a set of plugins with the given interface registered in system-scope OR to the given client. (client-scope wins over system-scope)- Parameters:
- clientUuid- UUID of a- client.
- pluginType- Type of the plugins to retrieve.
- Returns:
- All plugins from the given client (if any) and from the system scope. A client-scoped plugin overwrites a system-scoped plugin.
 
 - 
getAllPluginsWithRuntimepublic static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getAllPluginsWithRuntime(Mandant man, Class<T> clazz) 
 - 
getAllPluginsWithRuntimepublic static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getAllPluginsWithRuntime(UUID clientUuid, Class<T> clazz) 
 - 
getRegisteredPluginspublic static <T extends IFCPlugin> Set<T> getRegisteredPlugins(Class<T> clazz) Get a set with all registered plugins of the givenIFCPlugin-interface
 - 
getPluginByNamepublic static <T extends IFCPlugin> T getPluginByName(Mandant man, Class<T> clazz, String pluginName) Get a plugin by name andIFCPlugin-interface from client- and system-scope
 - 
getPluginByNameWithRuntimepublic static <T extends IFCPlugin> org.apache.commons.lang3.tuple.Pair<PluginRuntime,T> getPluginByNameWithRuntime(Mandant man, Class<T> clazz, String pluginName) 
 - 
getSystemPluginByNamepublic static <T extends IFCPlugin> T getSystemPluginByName(Class<T> clazz, String pluginName) Get a system-plugin by name,IFCPlugin-interface
 - 
getPluginAuthenticatorTypepublic static IPluginAuthenticatorType getPluginAuthenticatorType(IAuthenticator<?> authenticator) 
 - 
getPluginAuthenticatorTypeWithRuntimepublic static org.apache.commons.lang3.tuple.Pair<PluginRuntime,IPluginAuthenticatorType> getPluginAuthenticatorTypeWithRuntime(IAuthenticator<?> authenticator) 
 - 
getPluginNamespublic static <T extends IFCPlugin> Set<String> getPluginNames(Mandant mandant, Class<T> clazz) 
 - 
createSystemProtocolEntrypublic static void createSystemProtocolEntry(UserContext uc, String protocolEntry, Object... params) Creates a system protocol entry- Parameters:
- uc-- UserContext
- protocolEntry-- Stringprotocol-text
- params-- Objects parameters
 
 - 
createClientProtocolEntrypublic static void createClientProtocolEntry(UserContext uc, Mandant man, String protocolEntry, Object... params) Creates a client protocol entry- Parameters:
- uc-- UserContextwith the user who uploaded the plugin.
- man- The- clientfor which to create the protocol entry.
- protocolEntry-- Stringprotocol-text
- params-- Objects parameters
 
 - 
isPluginJar@Deprecated public static boolean isPluginJar(File file) Deprecated.
 - 
deletePlugin@Deprecated public static void deletePlugin(PluginRuntime prtm) throws IOException Deprecated.- Throws:
- IOException
 
 - 
deletePlugin@Deprecated public static void deletePlugin(String scopeKey, String runtimeKey) throws IOException Deprecated.- Throws:
- IOException
 
 - 
getAllPlugins@Deprecated public static Set<IFCPlugin> getAllPlugins(Mandant man, EPluginTypes type) Deprecated.- Parameters:
- man- The- clientscope from which to retrieve plugins.
- type- The type of the plugins to retrieve.
- Returns:
- A set of all matching plugins.
 
 - 
getPluginNameMap@Deprecated public static Map<EPluginScope,Set<String>> getPluginNameMap(UserContext uc, Mandant mandant, EPluginTypes type) Deprecated.- Parameters:
- uc- The current user context, this parameter is not used anymore.
- mandant- The- clientscope from which to retrieve plugins.
- type- The type of the plugins to retrieve.
- Returns:
- A map with all matching plugins.
 
 - 
getPluginNames@Deprecated public static Set<String> getPluginNames(UserContext uc, Mandant mandant, EPluginTypes type) Deprecated.- Parameters:
- uc- The current user context, this parameter is not used anymore.
- mandant- The- clientscope from which to retrieve plugins.
- type- The type of the plugins to retrieve.
- Returns:
- A set of all matching plugins.
 
 - 
getPluginByName@Deprecated public static IFCPlugin getPluginByName(Mandant man, EPluginTypes type, String pluginName) Deprecated.- Parameters:
- man- The- clientscope from which to retrieve plugins.
- type- The type of the plugins to retrieve.
- pluginName- The name of the plugin to retrieve.
- Returns:
- The plugin or nullwhen no matching plugin was found.
 
 - 
getMandantPlugins@Deprecated public static SortedSet<IFCPlugin> getMandantPlugins(Mandant man, EPluginTypes type) Deprecated.will be removed!- Parameters:
- man- The- clientscope from which to retrieve plugins.
- type- The type of the plugins to retrieve.
- Returns:
- A set of all matching plugins.
 
 - 
getSystemPlugins@Deprecated public static SortedSet<IFCPlugin> getSystemPlugins(EPluginTypes type) Deprecated.- Parameters:
- type- The type of the plugins to retrieve.
- Returns:
- A set of all matching plugins.
 
 - 
getSystemPluginByName@Deprecated public static IFCPlugin getSystemPluginByName(EPluginTypes type, String pluginName) Deprecated.- Parameters:
- type- The type of the plugins to retrieve.
- pluginName- The name of the plugin to retrieve.
- Returns:
- The plugin or nullwhen no plugin matches.
 
 - 
getMandantPluginByName@Deprecated public static IFCPlugin getMandantPluginByName(Mandant man, EPluginTypes type, String pluginName) Deprecated.will be removed!- Parameters:
- man- The- clientscope from which to retrieve plugins.
- type- The type of the plugins to retrieve.
- pluginName- The name of the plugin to retrieve.
- Returns:
- The plugin or nullwhen no plugin matches.
 
 - 
registerMandantPlugin@Deprecated public static void registerMandantPlugin(Mandant man, EPluginTypes typ, Class<? extends IFCPlugin> clazz) throws FCPluginException Deprecated.- Parameters:
- man- The- clientscope for which to register a plugin.
- typ- The type of the plugin to register.
- clazz- The class of the plugin to register.
- Throws:
- FCPluginException- When the plugin could not be registered or initialized.
 
 - 
registerSystemPlugin@Deprecated public static void registerSystemPlugin(EPluginTypes typ, Class<? extends IFCPlugin> clazz) throws FCPluginException Deprecated.- Parameters:
- typ- The type of the plugin to register.
- clazz- The class of the plugin to register.
- Throws:
- FCPluginException- When the plugin could not be registered or initialized.
 
 - 
createMandantProtocolEntry@Deprecated public static void createMandantProtocolEntry(IEntityContext ec, Mandant man, String protocolEntry, Object... params) - Parameters:
- ec- Entity context for accessing the database.
- man- The- clientscope for which to create a protocol entry.
- protocolEntry- Protocol entry to create.
- params- Additional message params for the protocol message.
 
 - 
releaseMandantPlugin@Deprecated public static void releaseMandantPlugin(Mandant man, PluginRuntime pluginMeta) throws IOException Deprecated.- Parameters:
- man- The- clientscope for which to register a plugin.
- pluginMeta- Runtime of the plugin to release.
- Throws:
- IOException- When the plugin could not be released, such as due to a database error.
 
 - 
getMandantPluginJar@Deprecated public static File getMandantPluginJar(Mandant man, String jarName) throws IOException Deprecated.- Parameters:
- man- The- clientscope for which to register a plugin.
- jarName- Name of the JAR file for which to look for.
- Returns:
- Always null- this method is deprecated!
- Throws:
- IOException- Never thrown.
 
 - 
scanForAllPlugins@Deprecated public static void scanForAllPlugins() Deprecated.useinitPlugins()
 - 
scanAndRegisterSystemPlugin@Deprecated public static boolean scanAndRegisterSystemPlugin(PluginRuntime pluginMeta, byte[] jarData) Deprecated.- Parameters:
- pluginMeta- Runtime of the plugin to register.
- jarData- Binary content of the JAR file to register.
- Returns:
- Always false- this method is deprecated!
 
 - 
scanAndRegisterMandantPlugin@Deprecated public static boolean scanAndRegisterMandantPlugin(Mandant man, PluginRuntime pluginMeta, byte[] jarData) Deprecated.- Parameters:
- man- The- clientfor which to register a plugin.
- pluginMeta- Runtime of the plugin to register.
- jarData- Binary content of the JAR file to register.
- Returns:
- Always false- this method is deprecated!
 
 - 
getMandantPlugins@Deprecated public static List<PluginRuntime> getMandantPlugins(Mandant man) Deprecated.- Parameters:
- man- The- clientfor which to retrieve a plugin.
- Returns:
- A list of all matching plugins.
 
 - 
getPluginNameMap@Deprecated public static <T extends IFCPlugin> Map<EPluginScope,Set<String>> getPluginNameMap(Mandant mandant, Class<T> clazz) Deprecated.Get a map of plugins by client, system andIFCPlugin-interface
 - 
initClientPlugin@Deprecated public static PluginRuntime initClientPlugin(File pluginJar, Mandant man) throws IOException, FCPluginException Deprecated.- Throws:
- IOException
- FCPluginException
 
 - 
initSystemPlugin@Deprecated public static PluginRuntime initSystemPlugin(File pluginJar) throws IOException, FCPluginException Deprecated.- Throws:
- IOException
- FCPluginException
 
 
- 
 
-