xmlBlaster 2.1.0 API

org.xmlBlaster.engine.admin
Class CommandManager

java.lang.Object
  extended by org.xmlBlaster.engine.admin.CommandManager
All Implemented Interfaces:
java.util.EventListener, I_RunlevelListener

public final class CommandManager
extends java.lang.Object
implements I_RunlevelListener

The manager instance for administrative commands.

Each xmlBlaster server instance has one instance of this class to manage its administrative behavior.

See the command requirement for a detailed description.

Since:
0.79f
Author:
xmlBlaster@marcelruff.info

Field Summary
private  java.util.Map externMap
          Map of external gateways to SNMP, telnet etc.
private  ServerScope glob
           
private  java.util.Map handlerMap
          Map to internal handlers like sysprop,client,msg etc
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  SessionInfo sessionInfo
           
 
Constructor Summary
CommandManager(ServerScope glob, SessionInfo sessionInfo)
          You need to call postInit() after all drivers are loaded.
 
Method Summary
 MsgUnit[] get(AddressServer addressServer, java.lang.String sessionId, QueryKeyData keyData, java.lang.String querySpec)
           
 MsgUnit[] get(AddressServer addressServer, java.lang.String sessionId, java.lang.String oid, java.lang.String[] args)
           
 java.lang.String getName()
          A human readable name of the listener for logging.
 java.lang.String help()
           
 java.lang.String help(java.lang.String cmd)
           
private  void initializeExternal()
           
private  void initializeInternal()
          Create internal gateways.
 void register(java.lang.String key, I_CommandHandler handler)
          Register internal handler for specific tasks.
 void runlevelChange(int from, int to, boolean force)
          Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING

Enforced by I_RunlevelListener

 SetReturn set(AddressServer addressServer, java.lang.String sessionId, java.lang.String cmd)
           
 void shutdown()
           
 java.lang.String toXml()
          Dump state of this object into a XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private final java.lang.String ME

glob

private final ServerScope glob

log

private static java.util.logging.Logger log

sessionInfo

private final SessionInfo sessionInfo

handlerMap

private final java.util.Map handlerMap
Map to internal handlers like sysprop,client,msg etc


externMap

private final java.util.Map externMap
Map of external gateways to SNMP, telnet etc.

Constructor Detail

CommandManager

public CommandManager(ServerScope glob,
                      SessionInfo sessionInfo)
You need to call postInit() after all drivers are loaded.

Parameters:
sessionInfo - Internal handle to be used directly with RequestBroker NOTE: We (the command code) are responsible for security checks as we directly write into RequestBroker.
Method Detail

initializeInternal

private void initializeInternal()
Create internal gateways.


initializeExternal

private void initializeExternal()

register

public final void register(java.lang.String key,
                           I_CommandHandler handler)
Register internal handler for specific tasks.


get

public final MsgUnit[] get(AddressServer addressServer,
                           java.lang.String sessionId,
                           QueryKeyData keyData,
                           java.lang.String querySpec)
                    throws XmlBlasterException
Parameters:
sessionId - Is null if not logged in
keyData - the key containing the cmd.
qosData - the qos. It can be null. It is null if the request comes from the telnet or snmp gateway (since in these cases the qos is wrapped inside the cmd, i.e. here it is inside the oid of the key).
Returns:
The found data or an array of size 0 if not found.
Throws:
XmlBlasterException

get

public final MsgUnit[] get(AddressServer addressServer,
                           java.lang.String sessionId,
                           java.lang.String oid,
                           java.lang.String[] args)
                    throws XmlBlasterException
Parameters:
addressServer -
sessionId -
oid - "__cmd:...."
args - Can be null
Returns:
Throws:
XmlBlasterException

set

public final SetReturn set(AddressServer addressServer,
                           java.lang.String sessionId,
                           java.lang.String cmd)
                    throws XmlBlasterException
Parameters:
sessionId - Is null if not logged in
cmd - The query string
Returns:
The SetReturn object:
setReturn.returnString contains the actually set value or is null if not set.
Throws:
XmlBlasterException

help

public java.lang.String help()

help

public java.lang.String help(java.lang.String cmd)

shutdown

public void shutdown()

getName

public java.lang.String getName()
A human readable name of the listener for logging.

Enforced by I_RunlevelListener

Specified by:
getName in interface I_RunlevelListener

runlevelChange

public void runlevelChange(int from,
                           int to,
                           boolean force)
                    throws XmlBlasterException
Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING

Enforced by I_RunlevelListener

Specified by:
runlevelChange in interface I_RunlevelListener
Parameters:
from - The current runlevel
to - The runlevel we want to switch to
force - If true force the change even if messages are lost
Throws:
XmlBlasterException

toXml

public final java.lang.String toXml()
Dump state of this object into a XML ASCII string.


toXml

public final java.lang.String toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Parameters:
extraOffset - indenting of tags for nice output

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.