main
Class NodeVisualizer

java.lang.Object
  extended by main.NodeVisualizer

public class NodeVisualizer
extends java.lang.Object

The NodeVisualizer class reads in a node ID and stores information on the node.


Field Summary
private  NodeInfo nodeInfo
           
private  java.lang.String nodeProperties
           
 
Constructor Summary
NodeVisualizer(int id, java.lang.String inputFileName)
          Initializes the NodeVisualizer, which reads the input and stores information about it.
 
Method Summary
 java.lang.String getNodeProperties()
          Retruns the properties of the node.
private  java.util.ArrayList<java.lang.String> parseInput(java.io.BufferedReader fin, java.lang.StringBuffer timeout)
           
private  java.lang.String parseSophiaResult(java.lang.String result)
           
private  void querySophia(int id, java.util.ArrayList<java.lang.String> properties, int timeout)
           
private  void setNodeProperties(java.util.ArrayList<java.lang.String> properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeInfo

private NodeInfo nodeInfo

nodeProperties

private java.lang.String nodeProperties
Constructor Detail

NodeVisualizer

public NodeVisualizer(int id,
                      java.lang.String inputFileName)
               throws java.io.IOException,
                      java.lang.NumberFormatException,
                      java.io.FileNotFoundException,
                      java.net.UnknownHostException,
                      javax.naming.InvalidNameException
Initializes the NodeVisualizer, which reads the input and stores information about it.

Parameters:
id - the node's id
inputFileName - a String that contains the input file name
Throws:
java.io.IOException - if there's an error opening or reading a file
java.io.FileNotFoundException - if a file is not found
ParseException - if a parse error occurs
java.net.UnknownHostException - if the host is not accessible
java.lang.NumberFormatException - if a number is not in the right format
javax.naming.InvalidNameException - if a name is invalid
Method Detail

getNodeProperties

public java.lang.String getNodeProperties()
Retruns the properties of the node.

Returns:
the node properties, a String

parseInput

private java.util.ArrayList<java.lang.String> parseInput(java.io.BufferedReader fin,
                                                         java.lang.StringBuffer timeout)
                                                  throws java.io.IOException
Throws:
java.io.IOException

querySophia

private void querySophia(int id,
                         java.util.ArrayList<java.lang.String> properties,
                         int timeout)
                  throws javax.naming.InvalidNameException,
                         java.net.UnknownHostException,
                         java.io.IOException
Throws:
javax.naming.InvalidNameException
java.net.UnknownHostException
java.io.IOException

parseSophiaResult

private java.lang.String parseSophiaResult(java.lang.String result)

setNodeProperties

private void setNodeProperties(java.util.ArrayList<java.lang.String> properties)