xmlBlaster 2.2.0 API

org.xmlBlaster.engine.admin.extern
Class TelnetGateway

java.lang.Object
  extended by org.xmlBlaster.engine.admin.extern.TelnetGateway
All Implemented Interfaces:
I_ExternGateway, I_Timeout, remotecons.ifc.CommandHandlerIfc

public final class TelnetGateway
extends java.lang.Object
implements remotecons.ifc.CommandHandlerIfc, I_ExternGateway, I_Timeout

The gateway from outside telnet connections to inside CommandManager.

Since:
0.79f
Author:
xmlBlaster@marcelruff.info
See Also:
admin.telnet requirement, admin.commands requirement

Field Summary
private  AddressServer addressServer
           
private  CommandManager commandManager
           
private  remotecons.wttools.ConnectionServer connectionServer
           
private  ConnectReturnQosServer connectRetQos
           
private  java.lang.String CRLF
           
private  ServerScope glob
           
private static int instanceCounter
           
private  boolean isLogin
           
private  boolean isShutdown
           
private  java.lang.String lastCommand
           
private static java.util.logging.Logger log
           
private  java.lang.String loginName
           
private  java.lang.String ME
           
private  int port
           
private  remotecons.RemoteServer rs
           
private  java.lang.String sessionId
           
private  long sessionTimeout
           
static int TELNET_PORT
          Default port to access xmlBlaster with telnet for administration (2702).
private  java.util.Set telnetInstancesSet
           
private  Timestamp timerKey
           
 
Constructor Summary
TelnetGateway()
           
 
Method Summary
 void connect(java.lang.String loginName, java.lang.String passwd)
          Login to xmlBlaster server.
private  void createRemoteConsole(int port)
          Creates a server which is accessible with telnet.
private  void disconnect()
           
protected  void finalize()
           
private  java.lang.String getErrorText(java.lang.String error)
           
 remotecons.ifc.CommandHandlerIfc getInstance()
           
 java.lang.String getName()
          Get a human readable name of this filter implementation
 java.lang.String handleCommand(java.lang.String cmd)
          Enforced by "remotecons.CommandHandlerIfc"
 java.lang.String help()
          Enforced by "remotecons.CommandHandlerIfc"
 java.lang.String help(java.lang.String cmd)
          Enforced by "remotecons.CommandHandlerIfc"
 boolean initialize(ServerScope glob, CommandManager commandManager)
          Creates the remote console server.
private  boolean initializeVariables(ServerScope glob, CommandManager commandManager, boolean isBootstrap)
           
private  boolean initListener()
           
 void register(remotecons.wttools.ConnectionServer server)
           
 void shutdown()
           
private  void stopTimer()
           
 void timeout(java.lang.Object userData)
          We are notified when this session expires.
 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private ServerScope glob

log

private static java.util.logging.Logger log

commandManager

private CommandManager commandManager

port

private int port

rs

private remotecons.RemoteServer rs

CRLF

private final java.lang.String CRLF
See Also:
Constant Field Values

instanceCounter

private static int instanceCounter

isShutdown

private boolean isShutdown

isLogin

private boolean isLogin

connectRetQos

private ConnectReturnQosServer connectRetQos

loginName

private java.lang.String loginName

sessionId

private java.lang.String sessionId

telnetInstancesSet

private java.util.Set telnetInstancesSet

timerKey

private Timestamp timerKey

sessionTimeout

private long sessionTimeout

connectionServer

private remotecons.wttools.ConnectionServer connectionServer

addressServer

private AddressServer addressServer

lastCommand

private java.lang.String lastCommand

TELNET_PORT

public static final int TELNET_PORT
Default port to access xmlBlaster with telnet for administration (2702).

See Also:
Constant Field Values
Constructor Detail

TelnetGateway

public TelnetGateway()
Method Detail

initialize

public boolean initialize(ServerScope glob,
                          CommandManager commandManager)
                   throws XmlBlasterException
Creates the remote console server.

Is called by CommandManager on startup

Specified by:
initialize in interface I_ExternGateway
Parameters:
glob - The Global handle of this xmlBlaster server instance.
commandManager - My manager
Returns:
true if started and active
Throws:
XmlBlasterException

initializeVariables

private boolean initializeVariables(ServerScope glob,
                                    CommandManager commandManager,
                                    boolean isBootstrap)
Parameters:
isBootstrap - The first instance has no timer set
Returns:
true if started and active

register

public void register(remotecons.wttools.ConnectionServer server)
Specified by:
register in interface remotecons.ifc.CommandHandlerIfc

stopTimer

private void stopTimer()

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

timeout

public final void timeout(java.lang.Object userData)
We are notified when this session expires.

Specified by:
timeout in interface I_Timeout
Parameters:
userData - You get bounced back your userData which you passed with Timeout.addTimeoutListener()

disconnect

private void disconnect()

initListener

private boolean initListener()
                      throws XmlBlasterException
Throws:
XmlBlasterException

createRemoteConsole

private void createRemoteConsole(int port)
                          throws XmlBlasterException
Creates a server which is accessible with telnet. This allows you to access xmlBlaster and query for example the free memory:
  telnet 192.168.1.2 2702
  mem
 
Enter 'help' for all available commands.

Throws:
XmlBlasterException

handleCommand

public java.lang.String handleCommand(java.lang.String cmd)
Enforced by "remotecons.CommandHandlerIfc"

Specified by:
handleCommand in interface remotecons.ifc.CommandHandlerIfc

getErrorText

private final java.lang.String getErrorText(java.lang.String error)

help

public java.lang.String help()
Enforced by "remotecons.CommandHandlerIfc"

Specified by:
help in interface remotecons.ifc.CommandHandlerIfc

help

public java.lang.String help(java.lang.String cmd)
Enforced by "remotecons.CommandHandlerIfc"

Specified by:
help in interface remotecons.ifc.CommandHandlerIfc

getInstance

public remotecons.ifc.CommandHandlerIfc getInstance()
Specified by:
getInstance in interface remotecons.ifc.CommandHandlerIfc

getName

public java.lang.String getName()
Description copied from interface: I_ExternGateway
Get a human readable name of this filter implementation

Specified by:
getName in interface I_ExternGateway

connect

public void connect(java.lang.String loginName,
                    java.lang.String passwd)
             throws XmlBlasterException
Login to xmlBlaster server.

Throws:
XmlBlasterException

shutdown

public void shutdown()
Specified by:
shutdown in interface I_ExternGateway

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.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.