org.rhq.enterprise.server.system
Interface SystemManagerLocal

All Known Implementing Classes:
SystemManagerBean

public interface SystemManagerLocal

Provides access to the server cloud's system configuration as well as some methods to perform configuration on the server in which this bean is running.


Method Summary
 long analyze(Subject whoami)
          Run analyze command on PostgreSQL databases.
 void enableHibernateStatistics()
          Creates and registers the Hibernate Statistics MBean.
 DatabaseType getDatabaseType()
          Returns the DatabaseType that corresponds to the database the JON Server uses for its backend.
 java.util.Date getExpiration()
           
 License getLicense()
           
 ServerVersion getServerVersion(Subject subject)
           
 java.util.Properties getSystemConfiguration()
          Get the server cloud configuration.
 boolean isMonitoringEnabled()
           
 void loadSystemConfigurationCache()
          Grabs the current system configuration from the database and reloads the cache with it.
 void loadSystemConfigurationCacheInNewTx()
          Grabs the current system configuration from the database and reloads the cache with it.
 void reconfigureSystem(Subject whoami)
          Performs some reconfiguration things on the server where we are running.
 long reindex(Subject whoami)
          Reindexes all tables that need to be periodically reindexed.
 void scheduleConfigCacheReloader()
          Schedules the internal timer job that periodically refreshes the configuration cache.
 void setSystemConfiguration(Subject subject, java.util.Properties properties, boolean skipValidation)
          Set the server cloud configuration.
 void undeployInstaller()
          Ensures the installer has been undeployed.
 void updateLicense(Subject subject, byte[] licenseData)
           
 long vacuum(Subject whoami)
          Run database-specific cleanup routines.
 long vacuum(Subject whoami, java.lang.String[] tableNames)
          Run database-specific cleanup routines for the given tables.
 long vacuumAppdef(Subject whoami)
          Run database-specific cleanup routines on appdef tables.
 

Method Detail

getDatabaseType

DatabaseType getDatabaseType()
Returns the DatabaseType that corresponds to the database the JON Server uses for its backend.

This method is mainly to allow the caller to determine the kind of database in use so as to determine what syntax to use for a particular native query.

Returns:
the type of database

scheduleConfigCacheReloader

void scheduleConfigCacheReloader()
Schedules the internal timer job that periodically refreshes the configuration cache. This is needed in case a user changed the system configuration on another server in the HA cloud - this config cache reloader will load in that new configuration.


getSystemConfiguration

java.util.Properties getSystemConfiguration()
Get the server cloud configuration. These are the server configurations that will be the same for all servers in the HA server cloud.

Returns:
Properties

setSystemConfiguration

void setSystemConfiguration(Subject subject,
                            java.util.Properties properties,
                            boolean skipValidation)
Set the server cloud configuration. The given properties will be the new settings for all servers in the HA server cloud.

Parameters:
subject - the user who wants to change the settings
properties - the new system configuration settings
skipValidation - if true, validation will not be performed on the properties

enableHibernateStatistics

void enableHibernateStatistics()
Creates and registers the Hibernate Statistics MBean. This allows us to monitor our own Hibernate usage.


reconfigureSystem

void reconfigureSystem(Subject whoami)
Performs some reconfiguration things on the server where we are running. This includes redeploying the configured JAAS modules.


analyze

long analyze(Subject whoami)
Run analyze command on PostgreSQL databases. On non-PostgreSQL, this returns -1.

Parameters:
whoami - the user requesting the operation
Returns:
The time it took to analyze, in milliseconds, or -1 if the database is not PostgreSQL.

reindex

long reindex(Subject whoami)
Reindexes all tables that need to be periodically reindexed. For Oracle, this "rebuilds" the indexes, for PostgreSQL, its a "reindex".

Parameters:
whoami - the user requesting the operation
Returns:
The time it took to reindex, in milliseconds

vacuum

long vacuum(Subject whoami)
Run database-specific cleanup routines. On PostgreSQL we do a VACUUM ANALYZE on all tables. On other databases we just return -1.

Parameters:
whoami - the user requesting the operation
Returns:
The time it took to vaccum, in milliseconds, or -1 if the database is not PostgreSQL.

vacuum

long vacuum(Subject whoami,
            java.lang.String[] tableNames)
Run database-specific cleanup routines for the given tables. On PostgreSQL we do a VACUUM ANALYZE on the given tables. On other databases we just return -1.

Parameters:
whoami - the user requesting the operation
tableNames - names of specific tables that will be vacuumed.
Returns:
The time it took to vaccum, in milliseconds, or -1 if the database is not PostgreSQL.

vacuumAppdef

long vacuumAppdef(Subject whoami)
Run database-specific cleanup routines on appdef tables. On PostgreSQL we do a VACUUM ANALYZE against the relevant tables. On other databases we just return -1.

Parameters:
whoami - the user requesting the operation
Returns:
The time it took to vaccum, in milliseconds, or -1 if the database is not PostgreSQL.

undeployInstaller

void undeployInstaller()
Ensures the installer has been undeployed. Installer must be undeployed to ensure the server deployment is secure.


loadSystemConfigurationCacheInNewTx

void loadSystemConfigurationCacheInNewTx()
Grabs the current system configuration from the database and reloads the cache with it. This is meant for internal use only! You probably want to use getSystemConfiguration() instead.


loadSystemConfigurationCache

void loadSystemConfigurationCache()
Grabs the current system configuration from the database and reloads the cache with it. This is meant for internal use only! You probably want to use getSystemConfiguration() instead.


isMonitoringEnabled

boolean isMonitoringEnabled()

getLicense

License getLicense()

updateLicense

void updateLicense(Subject subject,
                   byte[] licenseData)

getExpiration

java.util.Date getExpiration()

getServerVersion

ServerVersion getServerVersion(Subject subject)
                               throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.