org.rhq.enterprise.server.system
Class SystemManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.system.SystemManagerBean
All Implemented Interfaces:
SystemManagerLocal, SystemManagerRemote

public class SystemManagerBean
extends Object
implements SystemManagerLocal, SystemManagerRemote


Constructor Summary
SystemManagerBean()
           
 
Method Summary
 long analyze(org.rhq.core.domain.auth.Subject whoami)
          Run analyze command on PostgreSQL databases.
 void dumpSystemInfo(org.rhq.core.domain.auth.Subject subject)
           
 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.
 org.rhq.core.domain.common.ProductInfo getProductInfo(org.rhq.core.domain.auth.Subject subject)
          Provides product information suitable for "About" details.
 org.rhq.core.domain.common.ServerDetails getServerDetails(org.rhq.core.domain.auth.Subject subject)
          Provides details (such as product version) of the server processing the request.
 Properties getSystemConfiguration(org.rhq.core.domain.auth.Subject subject)
          Deprecated. 
 org.rhq.core.domain.common.composite.SystemSettings getSystemSettings(org.rhq.core.domain.auth.Subject subject)
          Get the server cloud configuration.
 boolean isDebugModeEnabled()
           
 boolean isExperimentalFeaturesEnabled()
           
 boolean isLdapAuthorizationEnabled()
           
 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(org.rhq.core.domain.auth.Subject whoami)
          Performs some reconfiguration things on the server where we are running.
 long reindex(org.rhq.core.domain.auth.Subject whoami)
          Reindexes all tables that need to be periodically reindexed.
 void reloadConfigCache(javax.ejb.Timer timer)
           
 void scheduleConfigCacheReloader()
          Schedules the internal timer job that periodically refreshes the configuration cache.
 void setSystemConfiguration(org.rhq.core.domain.auth.Subject subject, Properties properties, boolean skipValidation)
          Deprecated. 
 void setSystemSettings(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.composite.SystemSettings settings)
          Set the server cloud configuration.
 void undeployInstaller()
          Ensures the installer is no longer deployed.
 long vacuum(org.rhq.core.domain.auth.Subject whoami)
          Run database-specific cleanup routines.
 long vacuum(org.rhq.core.domain.auth.Subject whoami, String[] tableNames)
          Run database-specific cleanup routines for the given tables.
 long vacuumAppdef(org.rhq.core.domain.auth.Subject whoami)
          Run database-specific cleanup routines on appdef tables.
 void validateSystemConfiguration(org.rhq.core.domain.auth.Subject subject, Properties properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemManagerBean

public SystemManagerBean()
Method Detail

scheduleConfigCacheReloader

public void scheduleConfigCacheReloader()
Description copied from interface: SystemManagerLocal
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.

Specified by:
scheduleConfigCacheReloader in interface SystemManagerLocal

reloadConfigCache

public void reloadConfigCache(javax.ejb.Timer timer)

getDatabaseType

public DatabaseType getDatabaseType()
Description copied from interface: SystemManagerLocal
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.

Specified by:
getDatabaseType in interface SystemManagerLocal
Returns:
the type of database

getSystemConfiguration

@Deprecated
public Properties getSystemConfiguration(org.rhq.core.domain.auth.Subject subject)
Deprecated. 

Specified by:
getSystemConfiguration in interface SystemManagerLocal
Specified by:
getSystemConfiguration in interface SystemManagerRemote

getSystemSettings

public org.rhq.core.domain.common.composite.SystemSettings getSystemSettings(org.rhq.core.domain.auth.Subject subject)
Description copied from interface: SystemManagerRemote
Get the server cloud configuration. These are the server configurations that will be the same for all servers in the HA server cloud.

Specified by:
getSystemSettings in interface SystemManagerLocal
Specified by:
getSystemSettings in interface SystemManagerRemote
Parameters:
subject - user making the request
Returns:
the settings

setSystemSettings

public void setSystemSettings(org.rhq.core.domain.auth.Subject subject,
                              org.rhq.core.domain.common.composite.SystemSettings settings)
Description copied from interface: SystemManagerRemote
Set the server cloud configuration. The given properties will be the new settings for all servers in the HA server cloud.

Specified by:
setSystemSettings in interface SystemManagerLocal
Specified by:
setSystemSettings in interface SystemManagerRemote
Parameters:
subject - the user who wants to change the settings
settings - the new system configuration settings

loadSystemConfigurationCacheInNewTx

public void loadSystemConfigurationCacheInNewTx()
Description copied from interface: SystemManagerLocal
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.

Specified by:
loadSystemConfigurationCacheInNewTx in interface SystemManagerLocal

loadSystemConfigurationCache

public void loadSystemConfigurationCache()
Description copied from interface: SystemManagerLocal
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.

Specified by:
loadSystemConfigurationCache in interface SystemManagerLocal

setSystemConfiguration

@Deprecated
public void setSystemConfiguration(org.rhq.core.domain.auth.Subject subject,
                                              Properties properties,
                                              boolean skipValidation)
                            throws Exception
Deprecated. 

Specified by:
setSystemConfiguration in interface SystemManagerLocal
Specified by:
setSystemConfiguration in interface SystemManagerRemote
Throws:
Exception

validateSystemConfiguration

public void validateSystemConfiguration(org.rhq.core.domain.auth.Subject subject,
                                        Properties properties)
                                 throws InvalidSystemConfigurationException
Specified by:
validateSystemConfiguration in interface SystemManagerLocal
Throws:
InvalidSystemConfigurationException

enableHibernateStatistics

public void enableHibernateStatistics()
Description copied from interface: SystemManagerLocal
Creates and registers the Hibernate Statistics MBean. This allows us to monitor our own Hibernate usage.

Specified by:
enableHibernateStatistics in interface SystemManagerLocal

reconfigureSystem

public void reconfigureSystem(org.rhq.core.domain.auth.Subject whoami)
Description copied from interface: SystemManagerLocal
Performs some reconfiguration things on the server where we are running. This includes redeploying the configured JAAS modules.

Specified by:
reconfigureSystem in interface SystemManagerLocal

analyze

public long analyze(org.rhq.core.domain.auth.Subject whoami)
Description copied from interface: SystemManagerLocal
Run analyze command on PostgreSQL databases. On non-PostgreSQL, this returns -1.

Specified by:
analyze in interface SystemManagerLocal
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

public long reindex(org.rhq.core.domain.auth.Subject whoami)
Description copied from interface: SystemManagerLocal
Reindexes all tables that need to be periodically reindexed. For Oracle, this "rebuilds" the indexes, for PostgreSQL, its a "reindex".

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

vacuum

public long vacuum(org.rhq.core.domain.auth.Subject whoami)
Description copied from interface: SystemManagerLocal
Run database-specific cleanup routines. On PostgreSQL we do a VACUUM ANALYZE on all tables. On other databases we just return -1.

Specified by:
vacuum in interface SystemManagerLocal
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

public long vacuum(org.rhq.core.domain.auth.Subject whoami,
                   String[] tableNames)
Description copied from interface: SystemManagerLocal
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.

Specified by:
vacuum in interface SystemManagerLocal
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

public long vacuumAppdef(org.rhq.core.domain.auth.Subject whoami)
Description copied from interface: SystemManagerLocal
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.

Specified by:
vacuumAppdef in interface SystemManagerLocal
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

public void undeployInstaller()
Ensures the installer is no longer deployed.

Specified by:
undeployInstaller in interface SystemManagerLocal

isDebugModeEnabled

public boolean isDebugModeEnabled()
Specified by:
isDebugModeEnabled in interface SystemManagerLocal

isExperimentalFeaturesEnabled

public boolean isExperimentalFeaturesEnabled()
Specified by:
isExperimentalFeaturesEnabled in interface SystemManagerLocal

isLdapAuthorizationEnabled

public boolean isLdapAuthorizationEnabled()
Specified by:
isLdapAuthorizationEnabled in interface SystemManagerLocal

getServerDetails

public org.rhq.core.domain.common.ServerDetails getServerDetails(org.rhq.core.domain.auth.Subject subject)
Description copied from interface: SystemManagerRemote
Provides details (such as product version) of the server processing the request. Requires MANAGE_SETTINGS.

Specified by:
getServerDetails in interface SystemManagerLocal
Specified by:
getServerDetails in interface SystemManagerRemote
Parameters:
subject - user making the request
Returns:
server details

getProductInfo

public org.rhq.core.domain.common.ProductInfo getProductInfo(org.rhq.core.domain.auth.Subject subject)
Description copied from interface: SystemManagerRemote
Provides product information suitable for "About" details.

Specified by:
getProductInfo in interface SystemManagerLocal
Specified by:
getProductInfo in interface SystemManagerRemote
Parameters:
subject - user making the request
Returns:
the product info

dumpSystemInfo

public void dumpSystemInfo(org.rhq.core.domain.auth.Subject subject)
Specified by:
dumpSystemInfo in interface SystemManagerLocal


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