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 Summary
Constructors Constructor Description PluginManager()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
createClientProtocolEntry(UserContext uc, Mandant man, String protocolEntry, Object... params)
Creates a client-protocol-entrystatic void
createMandantProtocolEntry(IEntityContext ec, Mandant man, String protocolEntry, Object... params)
static void
createSystemProtocolEntry(UserContext uc, String protocolEntry, Object... params)
Creates a system-protocol-entrystatic void
deletePlugin(PluginRuntime prtm)
Deprecated.static void
deletePlugin(String scopeKey, String runtimeKey)
Deprecated.static Set<IFCPlugin>
getAllPlugins(Mandant man, EPluginTypes type)
Deprecated.static <T extends IFCPlugin>
Set<T>getAllPlugins(Mandant man, Class<T> clazz)
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 Set<PluginRuntime>
getClientPlugins(Mandant man)
Get a List of allPluginRuntime
s registered to the given clientstatic <T extends IFCPlugin>
Set<T>getClientPlugins(Mandant man, Class<T> clazz)
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 man, Class<T> clazz)
static IFCPlugin
getMandantPluginByName(Mandant man, EPluginTypes type, String pluginName)
Deprecated.will be removed!static File
getMandantPluginJar(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 IFCPlugin
getPluginByName(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 PluginRuntime
getPluginRuntime(String scopeKey, String runtimeKey)
static <T extends IFCPlugin>
Set<T>getRegisteredPlugins(Class<T> clazz)
Get an set with all registered plugins of the givenIFCPlugin
-interfacestatic IFCPlugin
getSystemPluginByName(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 allPluginRuntime
s 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 PluginRuntime
initClientPlugin(File pluginJar, Mandant man)
Deprecated.static void
initPlugins()
Initialize all plugins stored in the databasestatic PluginRuntime
initSystemPlugin(File pluginJar)
Deprecated.static void
install(IPluginEntity<?,?,?> pluginEntity)
static boolean
isPluginJar(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 void
registerMandantPlugin(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 andPluginRuntime
static <T extends IFCPlugin>
voidregisterPlugin(PluginRuntime prtm, Class<T> clazz)
static void
registerSystemPlugin(EPluginTypes typ, Class<? extends IFCPlugin> clazz)
Deprecated.static void
registerSystemPlugin(Class<? extends IFCPlugin> clazz, String runtimeKey)
Method to register a plugin-class in system-scopestatic void
releaseMandantPlugin(Mandant man, PluginRuntime pluginMeta)
Deprecated.static void
releasePlugin(boolean isUninstall, PluginRuntime prtm)
static void
releasePlugin(boolean isUninstall, String scopeKey, String runtimeKey)
static void
releasePlugin(PluginRuntime prtm)
static void
releasePlugin(String scopeKey, String runtimeKey)
static void
releasePlugins()
Releases all registered pluginsstatic boolean
scanAndRegisterMandantPlugin(Mandant man, PluginRuntime pluginMeta, byte[] jarData)
Deprecated.static boolean
scanAndRegisterSystemPlugin(PluginRuntime pluginMeta, byte[] jarData)
Deprecated.static void
scanForAllPlugins()
Deprecated.useinitPlugins()
static void
synchronizePlugin(boolean isInstall, PluginSyncData pluginData)
static void
uninstallPlugin(String scopeKey, String runtimeKey)
-
-
-
Method Detail
-
initPlugins
public static void initPlugins()
Initialize all plugins stored in the database
-
synchronizePlugin
public static void synchronizePlugin(boolean isInstall, PluginSyncData pluginData) throws IOException, FCPluginException
- Throws:
IOException
FCPluginException
-
registerSystemPlugin
public 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- Throws:
FCPluginException
-
registerClientPlugin
public 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- Parameters:
man
-Mandant
clazz
-IFCPlugin
-class to register- Throws:
FCPluginException
-
registerPlugin
public static <T extends IFCPlugin> void registerPlugin(PluginRuntime prtm, Class<T> clazz) throws FCPluginException
- Throws:
FCPluginException
-
registerPlugin
public static <T extends IFCPlugin> void registerPlugin(boolean isInstall, PluginRuntime prtm, Class<T> clazz) throws FCPluginException
Register a plugin to the given key andPluginRuntime
- Parameters:
isInstall
-true
if the plugin is installed for the first time,false
if the plugin configuration is only updated.prtm
-PluginRuntime
clazz
-IFCPlugin
class- Throws:
FCPluginException
-
install
public static void install(IPluginEntity<?,?,?> pluginEntity) throws IOException, FCPluginException
- Throws:
IOException
FCPluginException
-
releasePlugin
public static void releasePlugin(String scopeKey, String runtimeKey) throws IOException
- Throws:
IOException
-
releasePlugin
public static void releasePlugin(boolean isUninstall, String scopeKey, String runtimeKey) throws IOException
- Throws:
IOException
-
releasePlugin
public static void releasePlugin(PluginRuntime prtm) throws IOException
- Throws:
IOException
-
releasePlugin
public static void releasePlugin(boolean isUninstall, PluginRuntime prtm) throws IOException
- Throws:
IOException
-
releasePlugins
public static void releasePlugins()
Releases all registered plugins
-
uninstallPlugin
public static void uninstallPlugin(String scopeKey, String runtimeKey) throws IOException
- Parameters:
scopeKey
- the plugin scope keyruntimeKey
- the plugin runtime key- Throws:
IOException
- on errors while uninstall
-
getClientPlugins
public static <T extends IFCPlugin> Set<T> getClientPlugins(Mandant man, Class<T> clazz)
Get a set of plugins with the given interfaces registered to the given client
-
getClientPluginsWithRuntime
public static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getClientPluginsWithRuntime(Mandant man, Class<T> clazz)
-
getClientPlugins
public static Set<PluginRuntime> getClientPlugins(Mandant man)
Get a List of allPluginRuntime
s registered to the given client- Parameters:
man
-Mandant
- Returns:
List
ofPluginRuntime
s
-
getPluginRuntime
public static PluginRuntime getPluginRuntime(String scopeKey, String runtimeKey)
-
getSystemPlugins
public static <T extends IFCPlugin> Set<T> getSystemPlugins(Class<T> clazz)
Get a set of plugins with the given interfaces registered in system-scope
-
getSystemPluginsWithRuntime
public static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getSystemPluginsWithRuntime(Class<T> clazz)
-
getSystemPlugins
public static Set<PluginRuntime> getSystemPlugins()
Get a List of allPluginRuntime
s registered in system-scope- Returns:
Set
ofPluginRuntime
s
-
getAllPlugins
public static <T extends IFCPlugin> Set<T> getAllPlugins(Mandant man, Class<T> clazz)
Get a set of plugins with the given interface registered in system-scope OR to the given client. (client-scope wins over system-scope)
-
getAllPluginsWithRuntime
public static <T extends IFCPlugin> Set<org.apache.commons.lang3.tuple.Pair<PluginRuntime,T>> getAllPluginsWithRuntime(Mandant man, Class<T> clazz)
-
getRegisteredPlugins
public static <T extends IFCPlugin> Set<T> getRegisteredPlugins(Class<T> clazz)
Get an set with all registered plugins of the givenIFCPlugin
-interface
-
getPluginByName
public 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
-
getPluginByNameWithRuntime
public static <T extends IFCPlugin> org.apache.commons.lang3.tuple.Pair<PluginRuntime,T> getPluginByNameWithRuntime(Mandant man, Class<T> clazz, String pluginName)
-
getSystemPluginByName
public static <T extends IFCPlugin> T getSystemPluginByName(Class<T> clazz, String pluginName)
Get a system-plugin by name,IFCPlugin
-interface
-
getPluginNames
public static <T extends IFCPlugin> Set<String> getPluginNames(Mandant mandant, Class<T> clazz)
-
createSystemProtocolEntry
public static void createSystemProtocolEntry(UserContext uc, String protocolEntry, Object... params)
Creates a system-protocol-entry- Parameters:
uc
-UserContext
protocolEntry
-String
protocol-textparams
-Object
s parameters
-
createClientProtocolEntry
public static void createClientProtocolEntry(UserContext uc, Mandant man, String protocolEntry, Object... params)
Creates a client-protocol-entry- Parameters:
uc
-UserContext
man
-Mandant
protocolEntry
-String
protocol-textparams
-Object
s 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.
-
getPluginNameMap
@Deprecated public static Map<EPluginScope,Set<String>> getPluginNameMap(UserContext uc, Mandant mandant, EPluginTypes type)
Deprecated.
-
getPluginNames
@Deprecated public static Set<String> getPluginNames(UserContext uc, Mandant mandant, EPluginTypes type)
Deprecated.
-
getPluginByName
@Deprecated public static IFCPlugin getPluginByName(Mandant man, EPluginTypes type, String pluginName)
Deprecated.
-
getMandantPlugins
@Deprecated public static SortedSet<IFCPlugin> getMandantPlugins(Mandant man, EPluginTypes type)
Deprecated.will be removed!
-
getSystemPlugins
@Deprecated public static SortedSet<IFCPlugin> getSystemPlugins(EPluginTypes type)
Deprecated.
-
getSystemPluginByName
@Deprecated public static IFCPlugin getSystemPluginByName(EPluginTypes type, String pluginName)
Deprecated.
-
getMandantPluginByName
@Deprecated public static IFCPlugin getMandantPluginByName(Mandant man, EPluginTypes type, String pluginName)
Deprecated.will be removed!
-
registerMandantPlugin
@Deprecated public static void registerMandantPlugin(Mandant man, EPluginTypes typ, Class<? extends IFCPlugin> clazz) throws FCPluginException
Deprecated.- Throws:
FCPluginException
-
registerSystemPlugin
@Deprecated public static void registerSystemPlugin(EPluginTypes typ, Class<? extends IFCPlugin> clazz) throws FCPluginException
Deprecated.- Throws:
FCPluginException
-
createMandantProtocolEntry
@Deprecated public static void createMandantProtocolEntry(IEntityContext ec, Mandant man, String protocolEntry, Object... params)
-
releaseMandantPlugin
@Deprecated public static void releaseMandantPlugin(Mandant man, PluginRuntime pluginMeta) throws IOException
Deprecated.- Throws:
IOException
-
getMandantPluginJar
@Deprecated public static File getMandantPluginJar(Mandant man, String jarName) throws IOException
Deprecated.- Throws:
IOException
-
scanForAllPlugins
@Deprecated public static void scanForAllPlugins()
Deprecated.useinitPlugins()
-
scanAndRegisterSystemPlugin
@Deprecated public static boolean scanAndRegisterSystemPlugin(PluginRuntime pluginMeta, byte[] jarData)
Deprecated.
-
scanAndRegisterMandantPlugin
@Deprecated public static boolean scanAndRegisterMandantPlugin(Mandant man, PluginRuntime pluginMeta, byte[] jarData)
Deprecated.
-
getMandantPlugins
@Deprecated public static List<PluginRuntime> getMandantPlugins(Mandant man)
Deprecated.
-
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
-
-