org.opensolaris.opengrok.management
Class Management

java.lang.Object
  extended by org.opensolaris.opengrok.management.Management
All Implemented Interfaces:
javax.management.MBeanRegistration, ManagementMBean

public final class Management
extends java.lang.Object
implements ManagementMBean, javax.management.MBeanRegistration


Method Summary
 java.lang.String getAllSystemEnvProperties()
           
 java.lang.String getAllSystemProperties()
           
 java.lang.String getConfigurationFile()
          Get the xml based configuration file
static Management getInstance()
          Static factory method to get an instance of management.
static Management getInstance(java.util.Properties ogaProperties)
          Static factory method to get an instance of Management.
 java.lang.Integer getNumberOfThreads()
          Get number of Threads to use for indexing
 java.lang.String getProperty(java.lang.String key)
          Get a selected property from configuration.
 java.lang.String getPublishServerURL()
          Get the URL to the Publish Server we want to publish the indexed data
 java.util.Date getStartDate()
          Get a Date object with the time the agent was started.
 long getStartTime()
          Get the time (in milliseconds since 1970) when the agent was started
 java.lang.String[] getSubFiles()
          Get subfiles
 java.lang.String getSystemEnvProperty(java.lang.String key)
          Get the selected Environment property
 java.lang.String getSystemProperty(java.lang.String key)
          Get the selected System property
 java.lang.Boolean getUpdateIndexDatabase()
          Get the udate database property
 java.lang.String getVersion()
          Get the version tag for the agent
 void postDeregister()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void setNumberOfThreads(java.lang.Integer val)
          Set number of Threads to use for indexing
 void setProperty(java.lang.String key, java.lang.String value)
          Set a selected property in the configuration.
 void setSubFiles(java.lang.String[] sublist)
          Set subfiles
 void setSystemProperty(java.lang.String key, java.lang.String value)
          Set a selected System property
 void setUpdateIndexDatabase(java.lang.Boolean val)
          Set update index database property
 void stop()
          Stops the agent, so it is not restarted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Management getInstance(java.util.Properties ogaProperties)
Static factory method to get an instance of Management.

Parameters:
ogaProperties - The properties to use
Returns:
A management instance to use

getInstance

public static Management getInstance()
Static factory method to get an instance of management. Returns null if Management has not been initialized yet.


getProperty

public java.lang.String getProperty(java.lang.String key)
Get a selected property from configuration.

Specified by:
getProperty in interface ManagementMBean
Returns:
String with property value

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Set a selected property in the configuration.

Specified by:
setProperty in interface ManagementMBean
Parameters:
key - the String key for the property to be set. $param value the String value for the property to be set.

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
Specified by:
preRegister in interface javax.management.MBeanRegistration

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
Specified by:
preDeregister in interface javax.management.MBeanRegistration

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

stop

public void stop()
Stops the agent, so it is not restarted.

Specified by:
stop in interface ManagementMBean

getSystemProperty

public java.lang.String getSystemProperty(java.lang.String key)
Description copied from interface: ManagementMBean
Get the selected System property

Specified by:
getSystemProperty in interface ManagementMBean
Returns:
String with property value

setSystemProperty

public void setSystemProperty(java.lang.String key,
                              java.lang.String value)
Description copied from interface: ManagementMBean
Set a selected System property

Specified by:
setSystemProperty in interface ManagementMBean
Parameters:
key - the String key for the property to be set. $param value the String value for the property to be set.

getAllSystemProperties

public java.lang.String getAllSystemProperties()

getSystemEnvProperty

public java.lang.String getSystemEnvProperty(java.lang.String key)
Description copied from interface: ManagementMBean
Get the selected Environment property

Specified by:
getSystemEnvProperty in interface ManagementMBean
Returns:
String with Environment property value

getAllSystemEnvProperties

public java.lang.String getAllSystemEnvProperties()

getStartTime

public long getStartTime()
Get the time (in milliseconds since 1970) when the agent was started

Specified by:
getStartTime in interface ManagementMBean
Returns:
long time when the agent was started, in milliseconds.

getStartDate

public java.util.Date getStartDate()
Get a Date object with the time the agent was started.

Specified by:
getStartDate in interface ManagementMBean
Returns:
Date with the starting date

getVersion

public java.lang.String getVersion()
Get the version tag for the agent

Specified by:
getVersion in interface ManagementMBean
Returns:
String the version tag for this agent

setUpdateIndexDatabase

public void setUpdateIndexDatabase(java.lang.Boolean val)
Description copied from interface: ManagementMBean
Set update index database property

Specified by:
setUpdateIndexDatabase in interface ManagementMBean

getUpdateIndexDatabase

public java.lang.Boolean getUpdateIndexDatabase()
Description copied from interface: ManagementMBean
Get the udate database property

Specified by:
getUpdateIndexDatabase in interface ManagementMBean

setNumberOfThreads

public void setNumberOfThreads(java.lang.Integer val)
Description copied from interface: ManagementMBean
Set number of Threads to use for indexing

Specified by:
setNumberOfThreads in interface ManagementMBean

getNumberOfThreads

public java.lang.Integer getNumberOfThreads()
Description copied from interface: ManagementMBean
Get number of Threads to use for indexing

Specified by:
getNumberOfThreads in interface ManagementMBean

setSubFiles

public void setSubFiles(java.lang.String[] sublist)
Description copied from interface: ManagementMBean
Set subfiles

Specified by:
setSubFiles in interface ManagementMBean

getSubFiles

public java.lang.String[] getSubFiles()
Description copied from interface: ManagementMBean
Get subfiles

Specified by:
getSubFiles in interface ManagementMBean
Returns:
get StringArray of subfiles to run through

getConfigurationFile

public java.lang.String getConfigurationFile()
Description copied from interface: ManagementMBean
Get the xml based configuration file

Specified by:
getConfigurationFile in interface ManagementMBean
Returns:
String with the file path and name for xml configuration

getPublishServerURL

public java.lang.String getPublishServerURL()
Description copied from interface: ManagementMBean
Get the URL to the Publish Server we want to publish the indexed data

Specified by:
getPublishServerURL in interface ManagementMBean
Returns:
String URL to the server (hostname:port)