Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.common.server.session
Class ServerConfigManagerEJBImpl

java.lang.Object
  extended by org.hyperic.hq.common.server.session.ServerConfigManagerEJBImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class ServerConfigManagerEJBImpl
extends java.lang.Object
implements javax.ejb.SessionBean

This class is responsible for setting/getting the server configuration

See Also:
Serialized Form

Field Summary
protected  org.apache.commons.logging.Log log
           
 java.lang.String logCtx
           
 
Constructor Summary
ServerConfigManagerEJBImpl()
           
 
Method Summary
 long analyzeHqMetricTables(boolean analyzePrevMetricDataTable)
          Run an analyze command on both the current measurement data slice and the previous data slice if specified.
 long analyzeNonMetricTables()
          Run an analyze command on all non metric tables.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbRemove()
           
 java.util.Properties getConfig()
          Get the "root" server configuration, that means those keys that have the NULL prefix.
 java.util.Properties getConfig(java.lang.String prefix)
          Get the server configuration
 java.util.Collection getConfigProperties()
          Get all the ConfigPropertys
 java.lang.String getGUID()
          Gets the GUID for this HQ server instance.
protected  javax.naming.InitialContext getInitialContext()
           
static org.hyperic.hq.common.shared.ServerConfigManagerLocal getOne()
           
 void setConfig(AuthzSubject subject, java.util.Properties newProps)
          Set the server configuration
 void setConfig(AuthzSubject subject, java.lang.String prefix, java.util.Properties newProps)
          Set the server Configuration
 void setSessionContext(javax.ejb.SessionContext c)
           
 long vacuum()
          Run database-specific cleanup routines -- on PostgreSQL we do a VACUUM ANALYZE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logCtx

public final java.lang.String logCtx
See Also:
Constant Field Values

log

protected org.apache.commons.logging.Log log
Constructor Detail

ServerConfigManagerEJBImpl

public ServerConfigManagerEJBImpl()
Method Detail

getConfig

public java.util.Properties getConfig()
                               throws ConfigPropertyException
Get the "root" server configuration, that means those keys that have the NULL prefix.

Returns:
Properties
Throws:
ConfigPropertyException

getConfig

public java.util.Properties getConfig(java.lang.String prefix)
                               throws ConfigPropertyException
Get the server configuration

Parameters:
prefix - The prefix of the configuration to retrieve.
Returns:
Properties
Throws:
ConfigPropertyException

setConfig

public void setConfig(AuthzSubject subject,
                      java.util.Properties newProps)
               throws ApplicationException,
                      ConfigPropertyException
Set the server configuration

Throws:
ConfigPropertyException - - if the props object is missing a key that's currently in the database
ApplicationException

setConfig

public void setConfig(AuthzSubject subject,
                      java.lang.String prefix,
                      java.util.Properties newProps)
               throws ApplicationException,
                      ConfigPropertyException
Set the server Configuration

Parameters:
prefix - The config prefix to use when setting properties. The prefix is used for namespace protection and property scoping.
newProps - The Properties to set.
Throws:
ConfigPropertyException - - if the props object is missing a key that's currently in the database
ApplicationException

analyzeNonMetricTables

public long analyzeNonMetricTables()
Run an analyze command on all non metric tables. The metric tables are handled seperately using analyzeHqMetricTables() so that only the tables that have been modified are analyzed.

Returns:
The time taken in milliseconds to run the command.

analyzeHqMetricTables

public long analyzeHqMetricTables(boolean analyzePrevMetricDataTable)
Run an analyze command on both the current measurement data slice and the previous data slice if specified.

Parameters:
analyzePrevMetricDataTable - tells method to analyze previous metric data table as well as the current.
Returns:
The time taken in milliseconds to run the command.

vacuum

public long vacuum()
Run database-specific cleanup routines -- on PostgreSQL we do a VACUUM ANALYZE. On other databases we just return -1. Since 3.1 we do not want to vacuum the hq_metric_data tables, only the compressed eam_measurement_xxx tables.

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

getConfigProperties

public java.util.Collection getConfigProperties()
Get all the ConfigPropertys


getGUID

public java.lang.String getGUID()
Gets the GUID for this HQ server instance. The GUID is persistent for the duration of an HQ install and is created upon the first call of this method. If for some reason it can't be determined, 'unknown' will be returned.


getInitialContext

protected javax.naming.InitialContext getInitialContext()

getOne

public static org.hyperic.hq.common.shared.ServerConfigManagerLocal getOne()

ejbCreate

public void ejbCreate()

ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext c)
Specified by:
setSessionContext in interface javax.ejb.SessionBean

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.