public class PluginManagerBean extends Object implements PluginManagerLocal, PluginManagerRemote
| Constructor and Description |
|---|
PluginManagerBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledgeDeletedPluginsBy(int serverId)
The provided server acknowledges the deletion of all plugins marked as deleted by calling this method.
|
void |
deletePlugins(org.rhq.core.domain.auth.Subject subject,
List<Integer> pluginIds)
This method puts the plugin into a deleted state and removes the plugin JAR file from the file system and
schedules its eventual deletion from the database, too.
|
List<org.rhq.core.domain.plugin.Plugin> |
deployUsingBytes(org.rhq.core.domain.auth.Subject subject,
String pluginJarName,
byte[] pluginJarBytes)
Deploys a new agent plugin to RHQ asynchronously.
|
List<org.rhq.core.domain.plugin.Plugin> |
deployUsingContentHandle(org.rhq.core.domain.auth.Subject subject,
String pluginJarName,
String handle)
Deploys a new agent plugin to RHQ asynchronously using the content handle pointing to a previously uploaded file.
|
void |
disablePlugins(org.rhq.core.domain.auth.Subject subject,
List<Integer> pluginIds)
Disables plugins by ID.
|
void |
enablePlugins(org.rhq.core.domain.auth.Subject subject,
List<Integer> pluginIds)
Enables plugins by ID.
|
List<org.rhq.core.domain.plugin.Plugin> |
findAllDeletedPlugins()
Do not use this method directly.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.plugin.Plugin> |
findPluginsByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PluginCriteria criteria)
Returns a list of plugins by criteria.
|
List<org.rhq.core.domain.plugin.Plugin> |
getAllPluginsById(List<Integer> pluginIds)
Returns a list of plugins with the specified ids.
|
List<org.rhq.core.domain.plugin.CannedGroupExpression> |
getCannedGroupExpressions()
gets canned expressions from all plugins by direct reading and parsing additional descriptors;
|
List<org.rhq.core.domain.plugin.Plugin> |
getInstalledPlugins()
Returns the list of all plugins deployed in the server.
|
org.rhq.core.domain.plugin.Plugin |
getPlugin(String name)
Given the plugin name, will return that plugin.
|
File |
getPluginDropboxDirectory()
Returns the directory where plugins can be dropped for inclusion into the system.
|
List<org.rhq.core.domain.plugin.Plugin> |
getPlugins() |
List<org.rhq.core.domain.plugin.Plugin> |
getPluginsByResourceTypeAndCategory(String resourceTypeName,
org.rhq.core.domain.resource.ResourceCategory resourceCategory) |
List<PluginStats> |
getPluginStats(List<Integer> pluginIds) |
boolean |
installPluginJar(org.rhq.core.domain.plugin.Plugin newPlugin,
PluginDescriptor pluginDescriptor,
File pluginFile)
Exists only for transactional boundary reasons.
|
boolean |
isPluginUpdateOnAgentsFinished(org.rhq.core.domain.auth.Subject subject,
String handle)
Use this method to check whether given scheduled plugin update on agents finished.
|
boolean |
isReadyForPurge(org.rhq.core.domain.plugin.Plugin plugin)
Not to be used outside of
PurgePluginsJob. |
void |
markPluginsDeleted(org.rhq.core.domain.auth.Subject subject,
List<org.rhq.core.domain.plugin.Plugin> plugins)
Not to be called outside of the PluginManagerBean implementation.
|
void |
purgePlugins(List<org.rhq.core.domain.plugin.Plugin> plugins)
Permanently deletes the plugins from the database.
|
void |
registerPlugin(org.rhq.core.domain.plugin.Plugin plugin,
PluginDescriptor pluginDescriptor,
File pluginFile,
boolean forceUpdate)
For server-side registration of plugin archives.
|
String |
schedulePluginUpdateOnAgents(org.rhq.core.domain.auth.Subject subject,
long delayInMilliseconds)
Instructs all the running and connected agents to update their plugins after a given delay.
|
void |
setPluginEnabledFlag(org.rhq.core.domain.auth.Subject subject,
int pluginId,
boolean enabled)
Sets if a plugin is enabled or not.
|
void |
update(org.rhq.core.domain.auth.Subject subject)
Updates the plugins that might have been changed on the filesystem of the server.
|
public org.rhq.core.domain.plugin.Plugin getPlugin(String name)
PluginManagerLocalgetPlugin in interface PluginManagerLocalname - of plugin as defined in plugin descriptor.public boolean isReadyForPurge(org.rhq.core.domain.plugin.Plugin plugin)
PluginManagerLocalPurgePluginsJob. You can just use
the PluginManagerRemote.deletePlugins(org.rhq.core.domain.auth.Subject, java.util.List) method and it will take care of
the rest.isReadyForPurge in interface PluginManagerLocalplugin - The plugin to checkpublic void purgePlugins(List<org.rhq.core.domain.plugin.Plugin> plugins)
PluginManagerLocalPurgePluginsJob.purgePlugins in interface PluginManagerLocalplugins - The plugins to remove from the database.public List<org.rhq.core.domain.plugin.Plugin> getPlugins()
getPlugins in interface PluginManagerLocaluse getInstalledPlugins method insteadpublic List<org.rhq.core.domain.plugin.Plugin> getInstalledPlugins()
PluginManagerLocalgetInstalledPlugins in interface PluginManagerLocalpublic List<org.rhq.core.domain.plugin.Plugin> findAllDeletedPlugins()
PluginManagerLocalAgentPluginScanner and
PurgePluginsJob.findAllDeletedPlugins in interface PluginManagerLocalpublic List<org.rhq.core.domain.plugin.Plugin> getAllPluginsById(List<Integer> pluginIds)
PluginManagerLocalgetAllPluginsById in interface PluginManagerLocalpluginIds - The ids of the plugins to fetchpublic List<org.rhq.core.domain.plugin.Plugin> getPluginsByResourceTypeAndCategory(String resourceTypeName, org.rhq.core.domain.resource.ResourceCategory resourceCategory)
getPluginsByResourceTypeAndCategory in interface PluginManagerLocalpublic void enablePlugins(org.rhq.core.domain.auth.Subject subject,
List<Integer> pluginIds)
throws Exception
PluginManagerRemoteenablePlugins in interface PluginManagerRemoteExceptionpublic void disablePlugins(org.rhq.core.domain.auth.Subject subject,
List<Integer> pluginIds)
throws Exception
PluginManagerRemotedisablePlugins in interface PluginManagerRemoteExceptionpublic void deletePlugins(org.rhq.core.domain.auth.Subject subject,
List<Integer> pluginIds)
throws Exception
PluginManagerRemotedeletePlugins in interface PluginManagerRemotesubject - The user performing the deletionpluginIds - The ids of the plugins to be deletedException - if an error occurspublic void markPluginsDeleted(org.rhq.core.domain.auth.Subject subject,
List<org.rhq.core.domain.plugin.Plugin> plugins)
throws Exception
PluginManagerLocalmarkPluginsDeleted in interface PluginManagerLocalExceptionpublic List<PluginStats> getPluginStats(List<Integer> pluginIds)
getPluginStats in interface PluginManagerLocalpublic void setPluginEnabledFlag(org.rhq.core.domain.auth.Subject subject,
int pluginId,
boolean enabled)
throws Exception
PluginManagerLocalsetPluginEnabledFlag in interface PluginManagerLocalExceptionpublic File getPluginDropboxDirectory()
PluginManagerLocalgetPluginDropboxDirectory in interface PluginManagerLocalpublic void registerPlugin(org.rhq.core.domain.plugin.Plugin plugin,
PluginDescriptor pluginDescriptor,
File pluginFile,
boolean forceUpdate)
throws Exception
PluginManagerLocalpluginFile, and the plugin is deemed to be new or updated, the content
of the file will be streamed to the database. Note that if you provide a non-null file, you must ensure
its MD5 matches that of the file (i.e. this method will not attempt to recompute the file's MD5, it will assume
the caller has already done that and provided the proper MD5 in plugin).
registerPlugin in interface PluginManagerLocalplugin - The plugin object being deployedpluginDescriptor - The plugin descriptor filepluginFile - the actual plugin file whose content will be stored in the database (will be ignored if null)forceUpdate - if true, the plugin's types will be updated, even if the plugin hasn't changed sinceExceptionpublic boolean installPluginJar(org.rhq.core.domain.plugin.Plugin newPlugin,
PluginDescriptor pluginDescriptor,
File pluginFile)
throws Exception
PluginManagerLocalinstallPluginJar in interface PluginManagerLocalExceptionpublic void update(org.rhq.core.domain.auth.Subject subject)
throws Exception
PluginManagerRemoteupdate in interface PluginManagerRemotesubject - the authenticated userExceptionpublic String schedulePluginUpdateOnAgents(org.rhq.core.domain.auth.Subject subject, long delayInMilliseconds) throws Exception
PluginManagerRemotePluginManagerRemote.isPluginUpdateOnAgentsFinished(org.rhq.core.domain.auth.Subject, String) method using the supplied
handle.schedulePluginUpdateOnAgents in interface PluginManagerRemotesubject - the authenticated userdelayInMilliseconds - the number of milliseconds to wait before running the update on the agentsExceptionPluginManagerRemote.isPluginUpdateOnAgentsFinished(org.rhq.core.domain.auth.Subject, String)public boolean isPluginUpdateOnAgentsFinished(org.rhq.core.domain.auth.Subject subject,
String handle)
PluginManagerRemoteisPluginUpdateOnAgentsFinished in interface PluginManagerRemotesubject - the authenticated userhandle - the handle of the schedulePluginManagerRemote.schedulePluginUpdateOnAgents(org.rhq.core.domain.auth.Subject, long)public List<org.rhq.core.domain.plugin.Plugin> deployUsingBytes(org.rhq.core.domain.auth.Subject subject, String pluginJarName, byte[] pluginJarBytes) throws Exception
PluginManagerRemotePluginManagerRemote.deployUsingContentHandle(org.rhq.core.domain.auth.Subject, String, String) method is the preferred way
of doing this because it avoids having to keep the whole of the plugin jar in memory.
In another words, use this method with caution because it may require a large amount of memory.
This method returns after the plugin is deployed. Because there might be other plugins pending to be deployed
in the filesystem, this operation might result in more than just the single requested plugin being deployed.
This is why this method returns a list instead of a single plugin corresponding to the provided jar..deployUsingBytes in interface PluginManagerRemotesubject - the authenticated userpluginJarName - the name of the jar file which should be used to store the plugin on the filesystempluginJarBytes - the bytes of the plugin jar fileException - on errorpublic List<org.rhq.core.domain.plugin.Plugin> deployUsingContentHandle(org.rhq.core.domain.auth.Subject subject, String pluginJarName, String handle) throws Exception
PluginManagerRemotedeployUsingContentHandle in interface PluginManagerRemotesubject - the authenticated userpluginJarName - the name of the jar file which should be used to store the plugin on the filesystemhandle - the handle to the uploaded fileException - on errorContentManagerRemote.createTemporaryContentHandle(),
ContentManagerRemote.uploadContentFragment(String, byte[], int, int)public org.rhq.core.domain.util.PageList<org.rhq.core.domain.plugin.Plugin> findPluginsByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.PluginCriteria criteria)
PluginManagerRemotefindPluginsByCriteria in interface PluginManagerRemotepublic void acknowledgeDeletedPluginsBy(int serverId)
PluginManagerLocalAgentPluginScanner.acknowledgeDeletedPluginsBy in interface PluginManagerLocalserverId - the id of the server that wants to acknowledge that it has seen the deleted pluginspublic List<org.rhq.core.domain.plugin.CannedGroupExpression> getCannedGroupExpressions()
getCannedGroupExpressions in interface PluginManagerLocalCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.