com.bmc.mainview.nvbapi
Class HostServer

java.lang.Object
  extended by com.bmc.mainview.nvbapi.HostServer
Direct Known Subclasses:
LiveServer, Simulator

public abstract class HostServer
extends java.lang.Object

Defines a session with a mainframe.

Version:
2.0
Author:
F. Schneider

Field Summary
 long connectTime
          How long we have been connected to the server
static java.text.SimpleDateFormat HOSTFORMAT
          Format for decoding host date/time fields
 long timeDelta
          Time offset between here and the host
static VersionNumber VERSION
          The version of NVBAPI
 
Constructor Summary
HostServer(java.lang.Object logger, java.lang.String hostName, java.lang.String hostAddress, int hostPort, java.lang.String user, java.lang.String pass)
          Creates a session with the mainframe
 
Method Summary
abstract  XML connect()
          Opens the session with the mainframe
abstract  Conversation conversationFactory()
          Creates a new conversation using this host session
abstract  Conversation conversationFactory(java.lang.String monitorID)
          Creates a new conversation using this host session
abstract  void disconnect()
          Ends the session
 java.lang.String getAddr()
          Get the IP address used in creating this object
 java.lang.String getCanonicalHostName()
           
 VersionNumber getHostLvl()
          Get the maintenance level of the host
 java.lang.String getName()
          Retrieve the host server name
 java.lang.String getPassword()
          Retrieve the current password
 int getPort()
          Retrieve the IP port number on the host
 int getTimeout()
           
 java.lang.String getUserID()
          Retrieve the login ID
 boolean isConnected()
          Determine if a connect{} has been previously issued.
 boolean isFunctional()
          Determine if the host is responding
 java.util.Vector<ServicePoint> loadTargets(Conversation conv)
          A utility method that retrieves the PLEXMGR view and lists the available MVI-3 targets
 java.util.Vector<ServicePoint> loadTargets(Conversation conv, java.lang.String product)
          A utility method that retrieves the PLEXMGR view and lists the available MVI-3 targets
 void setName(java.lang.String value)
          Set the name of the host for identification in messages
 void setNewPassword(java.lang.String password)
          Set a new password to be sent to the host when connecting;
 void setPassword(java.lang.String password)
          Set a password to be used with the user ID in connecting to the host
 void setTimeout(int timeoutInterval)
           
 void setUserID(java.lang.String userID)
          Set the login ID to be used in connecting to the host
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connectTime

public long connectTime
How long we have been connected to the server


timeDelta

public long timeDelta
Time offset between here and the host


HOSTFORMAT

public static final java.text.SimpleDateFormat HOSTFORMAT
Format for decoding host date/time fields


VERSION

public static VersionNumber VERSION
The version of NVBAPI

Constructor Detail

HostServer

public HostServer(java.lang.Object logger,
                  java.lang.String hostName,
                  java.lang.String hostAddress,
                  int hostPort,
                  java.lang.String user,
                  java.lang.String pass)
Creates a session with the mainframe

Parameters:
logger - A logger to receive trace information for debugging. It may be either a SLF4J Logger or a JDK1.4 Logger.
hostName - The name which is used to refer to this particular session in log entries
hostAddress - The IP address of the mainframe.
hostPort - The port number on which the MVI Host Server is running
user - A z/OS user ID
pass - The corresponding password
Method Detail

connect

public abstract XML connect()
                     throws java.io.IOException
Opens the session with the mainframe

Returns:
an XML structure of a "control-resp" element which has the following attributes:
  • newid=”xxxxxxxxxxxxxxxx” - an ID that is a 16-byte printable hex character representation of an 8-byte “encryption” key
  • version=”v.r.mm”
  • sysname=”hostname”
Throws:
java.io.IOException - if the session cannot be established.
See Also:
disconnect()

getPassword

public java.lang.String getPassword()
Retrieve the current password

Returns:
The password

setPassword

public void setPassword(java.lang.String password)
Set a password to be used with the user ID in connecting to the host

Parameters:
password -

setNewPassword

public void setNewPassword(java.lang.String password)
Set a new password to be sent to the host when connecting;

Parameters:
password -

getUserID

public java.lang.String getUserID()
Retrieve the login ID

Returns:
The user ID
See Also:
setUserID(String)

setUserID

public void setUserID(java.lang.String userID)
Set the login ID to be used in connecting to the host

Parameters:
userID -

getAddr

public java.lang.String getAddr()
Get the IP address used in creating this object

Returns:
The IP address

getName

public java.lang.String getName()
Retrieve the host server name

Returns:
The name
See Also:
setName(String)

getPort

public int getPort()
Retrieve the IP port number on the host

Returns:
A port number

getTimeout

public int getTimeout()
Returns:
the timeoutInterval in milliseconds

setTimeout

public void setTimeout(int timeoutInterval)
Parameters:
timeoutInterval - the timeoutInterval in milliseconds

getCanonicalHostName

public java.lang.String getCanonicalHostName()
Returns:
the canonicalHostName

getHostLvl

public VersionNumber getHostLvl()
Get the maintenance level of the host

Returns:
The host server version

isConnected

public boolean isConnected()
Determine if a connect{} has been previously issued.

Returns:
true if connected to the host server

isFunctional

public boolean isFunctional()
Determine if the host is responding

Returns:
true if the server is responding.

disconnect

public abstract void disconnect()
Ends the session


loadTargets

public java.util.Vector<ServicePoint> loadTargets(Conversation conv)
                                           throws java.io.IOException
A utility method that retrieves the PLEXMGR view and lists the available MVI-3 targets

Parameters:
conv - A conversation with the host.
Returns:
A Vector containing one ServicePoint object for each target in the Plex
Throws:
java.io.IOException
See Also:
ServicePoint

loadTargets

public java.util.Vector<ServicePoint> loadTargets(Conversation conv,
                                                  java.lang.String product)
                                           throws java.io.IOException
A utility method that retrieves the PLEXMGR view and lists the available MVI-3 targets

Parameters:
conv - A conversation with the host.
Returns:
A Vector containing one ServicePoint object for each target in the Plex
Throws:
java.io.IOException
See Also:
ServicePoint

conversationFactory

public abstract Conversation conversationFactory()
                                          throws java.io.IOException
Creates a new conversation using this host session

Returns:
A conversation object
Throws:
java.io.IOException

conversationFactory

public abstract Conversation conversationFactory(java.lang.String monitorID)
                                          throws java.io.IOException
Creates a new conversation using this host session

Parameters:
monitorID - the related monitor ID
Returns:
A conversation object
Throws:
java.io.IOException

setName

public void setName(java.lang.String value)
Set the name of the host for identification in messages

Parameters:
value - The name

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object