jwo.vfc.hub
Class Request

java.lang.Object
  |
  +--jwo.vfc.hub.Request
All Implemented Interfaces:
Serializable

public class Request
extends Object
implements Serializable

Class for encapsulating a Hub - Client request. Can be used for sending messages from Hub to Client and Client to Hub. Each request will typically store a single line message and data to transfer.

Version:
1.2.3, 1st November, 1999.
Author:
Jo Wood
See Also:
Serialized Form

Constructor Summary
Request()
          Creates a request with blank message.
Request(String message)
          Creates a request containing a given message.
Request(String message, String userName, String password)
          Creates a request containing a given message.
 
Method Summary
 boolean containsFile()
          Reports whether file is contained within request.
 boolean containsMetadata()
          Reports whether metadata are contained within request.
 boolean getAbsoluteFileName()
          Reports the absolute file name priviliges.
 byte[] getData()
          Get the data stored in the request.
 String getFileName()
          Get the name of the file to write.
 String getMessage()
          Get the 1 line message that is encapsulated within the request.
 String getMetadata()
          Retrieves stored metadata
 String getPassword()
          Gets the password sent in the request.
 String getUserName()
          Gets the username sent in the request.
 void readFile(String fileName)
          Reads a given file name and stores the contents.
 void setAbsoluteFileName(boolean abs)
          Sets the absolute file name priviliges.
 void setFileName(String fileName)
          Sets the name of the file to write.
 void setMetadata(String metadata)
          Stores some metadata.
 void writeFile(String fileName)
          Writes the data to a given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request

public Request()
Creates a request with blank message.


Request

public Request(String message)
Creates a request containing a given message.

Parameters:
message - Message to send as request.

Request

public Request(String message,
               String userName,
               String password)
Creates a request containing a given message.

Parameters:
message - Message to send as request.
userName - User name.
password - Password.
Method Detail

getMessage

public String getMessage()
Get the 1 line message that is encapsulated within the request.

Returns:
Message to report.

getData

public byte[] getData()
Get the data stored in the request.

Returns:
Data stored in the request.

getUserName

public String getUserName()
Gets the username sent in the request.

Returns:
Username sent in the request.

getPassword

public String getPassword()
Gets the password sent in the request.

Returns:
Password sent in the request.

containsFile

public boolean containsFile()
Reports whether file is contained within request.

Returns:
True if request contains a file.

getFileName

public String getFileName()
Get the name of the file to write.

Returns:
Name of file to write.

setFileName

public void setFileName(String fileName)
Sets the name of the file to write.

Parameters:
fileName - Name of file to write.

getAbsoluteFileName

public boolean getAbsoluteFileName()
Reports the absolute file name priviliges.

Returns:
absolute file names to be used if true.

setAbsoluteFileName

public void setAbsoluteFileName(boolean abs)
Sets the absolute file name priviliges.

Parameters:
abs - Allows absolute file names to be used if set to true.

containsMetadata

public boolean containsMetadata()
Reports whether metadata are contained within request.

Returns:
True if request contains metadata.

setMetadata

public void setMetadata(String metadata)
Stores some metadata.

Parameters:
metadata - Metadata to store.

getMetadata

public String getMetadata()
Retrieves stored metadata

Returns:
Metadata list.

readFile

public void readFile(String fileName)
Reads a given file name and stores the contents. If security restrictions are enabled, files can be read only from relative sub directories with no 'back' (..) path.

Parameters:
fileName - Name of file to read.
See Also:
setAbsoluteFileName(boolean)

writeFile

public void writeFile(String fileName)
Writes the data to a given file. If security restrictions are enabled, files can be written only to relative sub directories with no 'back' (..) path.

Parameters:
fileName - Name of file create.
See Also:
setAbsoluteFileName(boolean)