com.bmc.mainview.nvbapi
Class Simulator

java.lang.Object
  extended by com.bmc.mainview.nvbapi.HostServer
      extended by com.bmc.mainview.nvbapi.Simulator

public class Simulator
extends HostServer

A simulated host server. It gets its responses from a Properties object containing the XML to be used as responses from the simulated mainframe. For each view there are two sets of entries:

  • product.view.map, product.view.map1, ... product.view.mapn
  • product.view, product.view1, ... product.viewn

    Each set is concatenated together to create a response.

    Version:
    2.0
    Author:
    F. Schneider

    Field Summary
     
    Fields inherited from class com.bmc.mainview.nvbapi.HostServer
    connectTime, HOSTFORMAT, timeDelta, VERSION
     
    Constructor Summary
    Simulator(java.lang.Object logger, java.util.Properties prop)
              Creates a HostServer that generates responses
     
    Method Summary
     XML connect()
              Opens the session with the mainframe
     Conversation conversationFactory()
              Creates a new conversation using this host session
     Conversation conversationFactory(java.lang.String monitorId)
              Creates a new conversation using this host session
     void disconnect()
              Ends the session
     
    Methods inherited from class com.bmc.mainview.nvbapi.HostServer
    getAddr, getCanonicalHostName, getHostLvl, getName, getPassword, getPort, getTimeout, getUserID, isConnected, isFunctional, loadTargets, loadTargets, setName, setNewPassword, setPassword, setTimeout, setUserID, toString
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    Simulator

    public Simulator(java.lang.Object logger,
                     java.util.Properties prop)
    Creates a HostServer that generates responses

    Parameters:
    logger -
    prop - A properties object containing pieces of XML to satisfy requests.
    Method Detail

    connect

    public XML connect()
                throws java.io.IOException
    Description copied from class: HostServer
    Opens the session with the mainframe

    Specified by:
    connect in class HostServer
    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:
    HostServer.disconnect()

    disconnect

    public void disconnect()
    Description copied from class: HostServer
    Ends the session

    Specified by:
    disconnect in class HostServer

    conversationFactory

    public Conversation conversationFactory()
    Description copied from class: HostServer
    Creates a new conversation using this host session

    Specified by:
    conversationFactory in class HostServer
    Returns:
    A conversation object

    conversationFactory

    public Conversation conversationFactory(java.lang.String monitorId)
    Description copied from class: HostServer
    Creates a new conversation using this host session

    Specified by:
    conversationFactory in class HostServer
    Parameters:
    monitorId - the related monitor ID
    Returns:
    A conversation object