HostServer host = new LiveServer(logger, hostName, ipAddress, port, userID, password); host.connect();Then a series of conversations can be initiated to retrieve view definitions and view contents:
ViewDefinition myView = new ViewDefinition("MYVIEW"); myView.setProduct("MYPRODUCT"); Conversation conv = host.conversationFactory(); Vector targets = host.loadTargets(conv, myProduct); for (int i = 0; i < targets.size(); i++) { ServicePoint sp = (ServicePoint) targets.elementAt(i); if (sp.product.equals(myProduct) && sp.status.equals("Active")) { conv.access(sp); TabularView view = new TabularView(myView, conv, true, null); Field myField = view.getField("MYFIELD"); for (int j = 0; j < view.size(); j++) { String data = view.getValue(j, myField); /* Process a data item */ } } } conv.close();
During processing the Conversation
object will create a number of
ConversationEvent
s. One or more ConversationListener
may
be added to react to them. Each time that a request is processed, here is the
sequence of events.
During the processing of a View
object a series of events are created.
A ViewListener
object may be passed to the constructor to react to these
events. Here is the sequence of event types: