webtester.packages.distributed
Class distClient

java.lang.Object
  |
  +--webtester.packages.distributed.distClient

public class distClient
extends java.lang.Object

The client library for the distributed GUI.

Author:
Aaron DeLong

Field Summary
private static int iHostPort
          The port of the master server.
private static int iNodeNumber
          The unique number that identifies this node.
private static java.lang.String sHostAddr
          The address of the master server.
 
Constructor Summary
distClient(java.lang.String sHost, int iPort)
          The constructor which takes the host and port as arguments.
 
Method Summary
static java.lang.String checkForTestCase()
          See if there are any test cases to run.
static int getNodeNumber()
          Return the node number assigned by the server.
static java.lang.String getTestCases()
          Send a request to retrieve test cases from the server.
static java.lang.String handleServerResponse(java.lang.String sData)
          Handle the response from the server as required.
private static java.lang.String sendData(java.lang.String sData)
          Send data to the server, and retrieve the result.
static java.lang.String sendNodeUpdate(java.lang.String sUpdateText)
          Send a node update to the master server.
static void setNodeNumber(int iNum)
          Sets the node number assigned by the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sHostAddr

private static java.lang.String sHostAddr
The address of the master server.


iHostPort

private static int iHostPort
The port of the master server.


iNodeNumber

private static int iNodeNumber
The unique number that identifies this node.

Constructor Detail

distClient

public distClient(java.lang.String sHost,
                  int iPort)
The constructor which takes the host and port as arguments.

Parameters:
sHost - the address of the master server
iPort - the port number ot use when connecting to the master server address
Method Detail

setNodeNumber

public static void setNodeNumber(int iNum)
Sets the node number assigned by the server.

Parameters:
iNum - the node number

getNodeNumber

public static int getNodeNumber()
Return the node number assigned by the server.

Returns:
an Integer that specifies the node number

sendData

private static java.lang.String sendData(java.lang.String sData)
Send data to the server, and retrieve the result.

Parameters:
sData - the data to send to the server
Returns:
a String that contains the server response data

sendNodeUpdate

public static java.lang.String sendNodeUpdate(java.lang.String sUpdateText)
Send a node update to the master server.

Parameters:
sUpdateText - the text to display on the server console
Returns:
a String that has the response from the server

checkForTestCase

public static java.lang.String checkForTestCase()
See if there are any test cases to run.

Returns:
a String that contains the server response

getTestCases

public static java.lang.String getTestCases()
Send a request to retrieve test cases from the server.

Returns:
a String that contains the server response

handleServerResponse

public static java.lang.String handleServerResponse(java.lang.String sData)
Handle the response from the server as required.

Parameters:
sData - the data returned from the server
Returns:
a String to display an update to the user of the client