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
 java.util.logging.Level getConsoleLogLevel()
          Get the current loglevel for the console
 java.util.logging.Level getFileLogLevel()
          get the loglevel on the agent logfile
 java.lang.String getFileLogPath()
          Get the file logpath
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 setConfigurationFile(java.lang.String filename)
          Set a new name for the xml based configurationfile
 void setConsoleLogLevel(java.util.logging.Level level)
          Set the loglevel for the console
 void setFileLogLevel(java.util.logging.Level level)
          set the file log level
 void setFileLogPath(java.lang.String path)
          Set the path for the file logging
 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 setPublishServerURL(java.lang.String url)
          Set the URL to where to publish opengrok indexed data
 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
Parameters:
val - Boolean true to also run update index database

getUpdateIndexDatabase

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

Specified by:
getUpdateIndexDatabase in interface ManagementMBean
Returns:
Boolean returns true if update index database is switched on

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)

setFileLogLevel

public void setFileLogLevel(java.util.logging.Level level)
Description copied from interface: ManagementMBean
set the file log level

Specified by:
setFileLogLevel in interface ManagementMBean
Parameters:
level - the level for file logging

setFileLogPath

public void setFileLogPath(java.lang.String path)
                    throws java.io.IOException
Description copied from interface: ManagementMBean
Set the path for the file logging

Specified by:
setFileLogPath in interface ManagementMBean
Parameters:
path - String path to where to log
Throws:
java.io.IOException - if path does not exist or could be created on server

getConsoleLogLevel

public java.util.logging.Level getConsoleLogLevel()
Description copied from interface: ManagementMBean
Get the current loglevel for the console

Specified by:
getConsoleLogLevel in interface ManagementMBean
Returns:
Level current console loglevel

getFileLogLevel

public java.util.logging.Level getFileLogLevel()
Description copied from interface: ManagementMBean
get the loglevel on the agent logfile

Specified by:
getFileLogLevel in interface ManagementMBean
Returns:
Level for file logging

getFileLogPath

public java.lang.String getFileLogPath()
Description copied from interface: ManagementMBean
Get the file logpath

Specified by:
getFileLogPath in interface ManagementMBean
Returns:
String file log path

setPublishServerURL

public void setPublishServerURL(java.lang.String url)
Description copied from interface: ManagementMBean
Set the URL to where to publish opengrok indexed data

Specified by:
setPublishServerURL in interface ManagementMBean
Parameters:
url - String to server for publishing the opengrok.war file

setConsoleLogLevel

public void setConsoleLogLevel(java.util.logging.Level level)
Description copied from interface: ManagementMBean
Set the loglevel for the console

Specified by:
setConsoleLogLevel in interface ManagementMBean
Parameters:
level - the level for console logging

setConfigurationFile

public void setConfigurationFile(java.lang.String filename)
Description copied from interface: ManagementMBean
Set a new name for the xml based configurationfile

Specified by:
setConfigurationFile in interface ManagementMBean
Parameters:
filename - String name with full path of configurationfile