jwo.vfc.hubclient
Class HubClient

java.lang.Object
  |
  +--jwo.vfc.hubclient.HubClient

public class HubClient
extends Object

Creates a connection with a VFC Hub server. Allows simple messages to be sent to the server, and listens to any replies.

Version:
1.2.3, 15th March, 2001
Author:
Jo Wood.

Constructor Summary
HubClient(String host, int port)
          Sets up a connection with the Hub server and sends a default message.
HubClient(String host, int port, String outDir, String message)
          Connects with, and sends a given message to the Hub server.
HubClient(String host, int port, String login, String password, String outDir, String message)
          Connects with, and sends a given message to the Hub server with security restrictions.
HubClient(String host, int port, String login, String password, String outDir, String returned, String message)
          Connects with, and sends a given message to the Hub server with security restrictions and output options.
HubClient(String configFile, String message)
          Sets up a connection with the Hub server defined in the given configuration file and sends a given message.
 
Method Summary
static String getConfigHost(String configFile)
          Returns the host identified in the given configuration file.
static String getConfigLogin(String configFile)
          Returns the login name identified in the given configuration file.
static String getConfigOutput(String configFile)
          Returns the output directory identified in the given configuration file.
static String getConfigPassword(String configFile)
          Returns the user password identified in the given configuration file.
static int getConfigPort(String configFile)
          Returns the port identified in the given configuration file.
static String getConfigReturned(String configFile)
          Returns the 'returned' metadata items identified in the given configuration file.
 String getFileName()
          Reports the file name and relative directory of any transfered file about to be written.
 String getMessage()
          Reports the response from the server after a message has been sent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HubClient

public HubClient(String host,
                 int port)
Sets up a connection with the Hub server and sends a default message.

Parameters:
host - Host running the hub server.
port - Port number to connect via.

HubClient

public HubClient(String configFile,
                 String message)
Sets up a connection with the Hub server defined in the given configuration file and sends a given message.

Parameters:
configFile - Name of file storing host information.
message - Message to send to Hub server.

HubClient

public HubClient(String host,
                 int port,
                 String outDir,
                 String message)
Connects with, and sends a given message to the Hub server.

Parameters:
host - Host running the hub server.
port - Port number to connect via.
outDir - Directory containing output.
message - Message to send to server.

HubClient

public HubClient(String host,
                 int port,
                 String login,
                 String password,
                 String outDir,
                 String message)
Connects with, and sends a given message to the Hub server with security restrictions.

Parameters:
host - Host running the hub server.
port - Port number to connect via.
login - Login name for secure access.
password - Password for secure access.
outDir - Directory containing output.
message - Message to send to server.

HubClient

public HubClient(String host,
                 int port,
                 String login,
                 String password,
                 String outDir,
                 String returned,
                 String message)
Connects with, and sends a given message to the Hub server with security restrictions and output options.

Parameters:
host - Host running the hub server.
port - Port number to connect via.
login - Login name for secure access.
password - Password for secure access.
outDir - Directory containing output.
returned - Metadata items to be returned when 'ifPreferred' selected.
message - Message to send to server.
Method Detail

getMessage

public String getMessage()
Reports the response from the server after a message has been sent.

Returns:
Message from server.

getFileName

public String getFileName()
Reports the file name and relative directory of any transfered file about to be written.

Returns:
name of file to be written. Returns current directory if file has yet to be defined.

getConfigHost

public static String getConfigHost(String configFile)
Returns the host identified in the given configuration file.

Parameters:
configFile - Name of configuration file.
Returns:
Host name, or null if not found.

getConfigPort

public static int getConfigPort(String configFile)
Returns the port identified in the given configuration file.

Parameters:
configFile - Name of configuration file.
Returns:
Port, or 0 if not found.

getConfigLogin

public static String getConfigLogin(String configFile)
Returns the login name identified in the given configuration file.

Parameters:
configFile - Name of configuration file.
Returns:
Login name, or null if not found.

getConfigPassword

public static String getConfigPassword(String configFile)
Returns the user password identified in the given configuration file.

Parameters:
configFile - Name of configuration file.
Returns:
Password, or null if not found.

getConfigOutput

public static String getConfigOutput(String configFile)
Returns the output directory identified in the given configuration file.

Parameters:
configFile - Name of configuration file.
Returns:
Ouput directory name, or null if not found.

getConfigReturned

public static String getConfigReturned(String configFile)
Returns the 'returned' metadata items identified in the given configuration file.

Parameters:
configFile - Name of configuration file.
Returns:
Returned metadata items, or null if not found.