Last Updated: 3/4/97
Class NFSnapshotServer

Class NFSnapshotServer

public class NFSnapshotServer

The NFSnapshotServer supports the generation of document snapshots from the NFSnapshotApp. The server is designed to run continuously, accepting connections from any number of NFSnapshotApp applets. When a connection is made, this server receives files from the applet and stores them in the HTML directory specified by the command line arguments. These files can then be retrieved, via the Web Server, by the NFSnapshotApp applet as needed to display the snapshot.

The following command line values are required:

 	java NFSnapshotServer [-options] <port> <html root> <html dir>

 	-debug      = display license debug information

 	-key <key>  = use the given string as the license key

 	<port>      = the port assigned to this server

 	<html root> = the absolute OPERATING SYSTEM pathname for
 	              the root directory of the Web server.

 	<html dir>  = the absolute HTML pathname for the
 	              temporary directory in which the snapshots
 	              will be stored.

For example, if the root directory for the HTTPD located on host Fred is located at /httpd/htdocs and you want to store all temporary snapshot files in the html directory http://Fred/proj/snapshots, then you would use the following command line options:

 	java NFSnapshotServer 1234 /httpd/htdocs /proj/snapshots

NOTE: Prior to executing the command line above, your CLASSPATH environment variable must include the top-level classes directory of the NetCharts distribution.

On startup, the NFSnapshotServer checks the validity of the directories given and attempts to open the given port in order to accept connections.

Additionally, the NFSnapshotServer checks for a valid entry in the NFLicense.dat file, which should be located somewhere on the CLASSPATH specified when the server is invoked. If a valid entry is not found, the server will only allow 10 connections and then it will terminate.

The NFSnapshotApp and NFSnapshotServer are designed to delete temporary files whenever an applet is stopped. Therefore, the html directory used for temporary storage should stay reasonably clean. However, it is probably prudent to create an operating system daemon that clears out the directory periodically to prevent any file system overflows.

If more than one NFSnapshotServer are executed at the same time on the same host, they should be assigned unique port numbers and unique HTML directories for temporary storage, in order to avoid run-time conflicts.