gov.nasa.gsfc.drl.rtstps.server
Class TcpServer

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by gov.nasa.gsfc.drl.rtstps.server.AbstractServer
                  extended by gov.nasa.gsfc.drl.rtstps.server.TcpServer
All Implemented Interfaces:
RtStpsServices, java.io.Serializable, java.lang.Runnable, java.rmi.Remote

public class TcpServer
extends AbstractServer

This is an RT-STPS server that receives telemetry through a TCP/IP socket.

You may pass one argument when invoking, the server name. The full server name then becomes "RtStpsServices."+name. The default full server name is "RtStpsServices.A".

The site.properties file is processed if it is present for configuring the log and it will take precedence over some of these option, even if they are present.

The server understands the following system properties. You set them when you run the server using the -D attribute as in "-Dport=5000".
-Dconfig=xmlConfigFileName
A configuration file to be used until overridden by a loaded one. The default name is "default.xml". The configuration file controls the packet output side of RT-STPS.
-Dport=4935
The port number that the server reads for telemetry data. The default port is 4935.
-DbufferSizeKb=8 The amount of data I accumulate before processing. The default is 8 kb.
-Dsetup=configurationDirectory
The directory where local configuration files are found. If provided, all files must be within the directory tree.
-Dlog.stdout
If specified, log messages are written to the standard output.
note: this is overridden by the presence of a site.properties file
-Dlog.file=file
If specified, log messages are written to file.
note: this is overridden by the presence of a site.properties file
-Dlog.server=host:port:tmpDir
If specified, log messages are sent to the NSLS server at host:port (eg. localhost:3500) and to the temporary directory tmpDir when the NSLS server is unavailable.
note: this is overridden by the presence of a site.properties file

See Also:
Serialized Form

Field Summary
private  char[] defaultConfigurationBuffer
           
private  java.lang.String defaultConfigurationFileName
          If a data source connects to this server and there is no loaded configuration, the server will automatically load one of the two following configurations.
private  int inputBufferSize
           
private  int inputPort
           
private static long serialVersionUID
           
 
Fields inherited from class gov.nasa.gsfc.drl.rtstps.server.AbstractServer
fs, runner, running, state, statusBlocks
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
TcpServer(java.lang.String defaultConfig, int port, int bufferSize)
          Create a server.
 
Method Summary
 void load(char[] configuration)
          Load a configuration.
 void loadFile(java.lang.String filename)
          Load a configuration from a file that is local to the server.
static void main(java.lang.String[] args)
          This is the main entry point for the RT-STPS server.
 void run()
          This thread method gets data from the socket and sends it down the pipeline if it exists.
 
Methods inherited from class gov.nasa.gsfc.drl.rtstps.server.AbstractServer
getConfigurationName, getStatus, getStatusToString, isEnabled, load, log, setEnabled, stopServer, unload, zeroStatus
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

inputBufferSize

private int inputBufferSize

inputPort

private int inputPort

defaultConfigurationFileName

private java.lang.String defaultConfigurationFileName
If a data source connects to this server and there is no loaded configuration, the server will automatically load one of the two following configurations. One will be null. When a user loads a new configuration, it also becomes the new automatic default.


defaultConfigurationBuffer

private char[] defaultConfigurationBuffer

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

TcpServer

public TcpServer(java.lang.String defaultConfig,
                 int port,
                 int bufferSize)
          throws java.rmi.RemoteException
Create a server.

Throws:
java.rmi.RemoteException
Method Detail

main

public static void main(java.lang.String[] args)
This is the main entry point for the RT-STPS server.


load

public void load(char[] configuration)
          throws java.rmi.RemoteException
Load a configuration.

Specified by:
load in interface RtStpsServices
Overrides:
load in class AbstractServer
Throws:
java.rmi.RemoteException

loadFile

public void loadFile(java.lang.String filename)
              throws java.rmi.RemoteException
Load a configuration from a file that is local to the server.

Specified by:
loadFile in interface RtStpsServices
Overrides:
loadFile in class AbstractServer
Throws:
java.rmi.RemoteException

run

public void run()
This thread method gets data from the socket and sends it down the pipeline if it exists. It discards the data if the pipeline is null.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class AbstractServer