com.tivoli.twg.engine
Class TWGConsoleServiceNode

java.lang.Object
  |
  +--com.tivoli.twg.libs.ServiceNode
        |
        +--com.tivoli.twg.engine.TWGConsoleServiceNode
All Implemented Interfaces:
CommandCompleteListener, java.lang.Runnable

public class TWGConsoleServiceNode
extends ServiceNode
implements CommandCompleteListener

Director Console service node. This class is used to encapsulate the console-server logon process, as well as creating the "main" ServiceNode for communications between the console and server. In addition, the class automatically handles the update process for the TWGConObject shadow objects.


Field Summary
static java.lang.String CON_PROPERTIES
          Resource name of console properties file
static java.lang.String GATEWAY_LINK
          Base name of link configuration properties in file
static java.lang.String SUPPRESS_LOGININFO
          Property key for login info suppression
 
Fields inherited from class com.tivoli.twg.libs.ServiceNode
SVCNODE_DISABLE_TRACING_CMD, SVCNODE_ENABLE_TRACING_CMD, SVCNODE_GET_STATUS_CMD, SVCNODE_KILL_SERVICE_CMD
 
Method Summary
 void CommandComplete(Command cmd)
          Command completion callback.
static java.util.Properties getConsoleProperties()
          Get reference to console properties set
static TWGConsoleServiceNode getConsoleServiceNode()
          Get reference to the console ServiceNode
static java.lang.String[] getLinkDriverNames()
          Get list of all available link drivers (NLS strings)
static void getWizardProperties(CommandCompleteListener ccl)
          Request the Wizard initialization information
static void initialize()
          Initialization method : this method MUST be called before any other TWGConsoleServiceNode calls are made.
static void logonToServer(java.lang.String hostname, java.lang.String userid, java.lang.String password, int driver_index)
          Server logon method : this method is used to attempt to attach to a given server using the link driver with the given index in the getLinkDriverNames() list.
static void putWizardProperty(java.lang.String key, java.lang.String value, CommandCompleteListener ccl)
          Request the Wizard initialization information
static void startShadowRefresh()
          Start console shadow object refresh cycle
static boolean suppressLoginInfo()
          Indicate whether login information is to be suppressed.
static void terminate()
          Terminate link to server : close console service node and terminate link driver.
 
Methods inherited from class com.tivoli.twg.libs.ServiceNode
Close, CommandReceived, ConnectionActive, Create, DeregisterCommandListener, DeregisterDefaultCommandListener, EnqueueCommandFail, EnqueueReceiveBuffer, formatCommandCode, formatReturnCode, GetFeatureFlags, GetServiceNodeFactory, getTS, IsActive, IsRawMode, LocalMACAddress, LocalMacAddressList, LocalSystemName, LocalUniqueID, Name, PeriodicCallback, ProcessCommands, ReceiveData, RegisterAsServiceBase, RegisterCommandListener, RegisterDefaultCommandListener, run, SendAsynchCommand, SendBuffer, SendCommand, SendLocalAsyncCommand, SendLocalCommand, SendPostponedReply, SetActive, setCommandDebugString, SetFeatureFlags, SetGlobalNetworkTimeout, SetLocalSystemName, SetPeriodicCallback, SetServiceNodeFactory, ThreadInit, ThreadTerm, toString, traceCommandCompleteCall, traceCommandReceived, traceCommandReceivedReturn, traceCommandSend, traceError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CON_PROPERTIES

public static final java.lang.String CON_PROPERTIES
Resource name of console properties file

GATEWAY_LINK

public static final java.lang.String GATEWAY_LINK
Base name of link configuration properties in file

SUPPRESS_LOGININFO

public static final java.lang.String SUPPRESS_LOGININFO
Property key for login info suppression
Method Detail

initialize

public static void initialize()
                       throws java.io.IOException,
                              com.tivoli.twg.engine.TWGGatewayInitException
Initialization method : this method MUST be called before any other TWGConsoleServiceNode calls are made.
Throws:
java.io.IOException - if error loading properties
com.tivoli.twg.engine.TWGGatewayInitException - if error loading link drivers

suppressLoginInfo

public static boolean suppressLoginInfo()
Indicate whether login information is to be suppressed.
Returns:
true if login information is to be suppressed, false otherwise.

getLinkDriverNames

public static java.lang.String[] getLinkDriverNames()
Get list of all available link drivers (NLS strings)
Returns:
array of link driver strings

logonToServer

public static void logonToServer(java.lang.String hostname,
                                 java.lang.String userid,
                                 java.lang.String password,
                                 int driver_index)
                          throws java.io.IOException,
                                 com.tivoli.twg.engine.TWGInitParmException,
                                 com.tivoli.twg.engine.TWGLinkNotSupportedException,
                                 com.tivoli.twg.engine.TWGBadUserIDException,
                                 com.tivoli.twg.engine.TWGBadPasswordException,
                                 java.net.UnknownHostException,
                                 ServiceNodeException,
                                 java.lang.InterruptedException
Server logon method : this method is used to attempt to attach to a given server using the link driver with the given index in the getLinkDriverNames() list.
Parameters:
hostname - - name of host supplied by user
userid - - user ID supplied by user
password - - password supplied by user
driver_index - - index (base 0) of link driver selected
Throws:
java.io.IOException - if communications error
com.tivoli.twg.engine.TWGInitParmException - if bad initialization string
com.tivoli.twg.engine.TWGLinkNotSupportedException - if link type not supported
com.tivoli.twg.engine.TWGBadUserIDException - if bad user-ID
com.tivoli.twg.engine.TWGBadPasswordException - if bad password
java.net.UnknownHostException - if bad hostname
ServiceNodeException - if error creating console service node
java.lang.InterruptedException - if thread interrupted

startShadowRefresh

public static void startShadowRefresh()
                               throws ServiceNodeException,
                                      java.lang.InterruptedException
Start console shadow object refresh cycle
Throws:
ServiceNodeException - if error creating console service node
java.lang.InterruptedException - if thread interrupted

getWizardProperties

public static void getWizardProperties(CommandCompleteListener ccl)
                                throws ServiceNodeException,
                                       java.lang.InterruptedException
Request the Wizard initialization information
Parameters:
CommandCompleteListener -  
Throws:
ServiceNodeException - if error creating console service node
java.lang.InterruptedException - if thread interrupted

putWizardProperty

public static void putWizardProperty(java.lang.String key,
                                     java.lang.String value,
                                     CommandCompleteListener ccl)
                              throws ServiceNodeException,
                                     java.lang.InterruptedException
Request the Wizard initialization information
Parameters:
String - key of property
String - value of property
CommandCompleteListener -  
Throws:
ServiceNodeException - if error creating console service node
java.lang.InterruptedException - if thread interrupted

getConsoleServiceNode

public static TWGConsoleServiceNode getConsoleServiceNode()
                                                   throws ServiceNodeClosedException
Get reference to the console ServiceNode
Returns:
reference to console ServiceNode
Throws:
ServiceNodeClosedException - if not defined or opened

terminate

public static void terminate()
Terminate link to server : close console service node and terminate link driver.

CommandComplete

public void CommandComplete(Command cmd)
Command completion callback. This listener method is called when a Command instance registered to this listener is completed.
Specified by:
CommandComplete in interface CommandCompleteListener
Parameters:
cmd - - Command instance of command which has completed

getConsoleProperties

public static java.util.Properties getConsoleProperties()
Get reference to console properties set
Returns:
Console properties set