nl.knmi.orfeus
Class SLClient

java.lang.Object
  extended by nl.knmi.orfeus.SLClient
Direct Known Subclasses:
InfoSeedLinkClient

public class SLClient
extends java.lang.Object

Basic class to create and use a connection to a SeedLink server using a SeedLinkConnection object. A new SeedLink application can be created by subclassing SLClient and overriding at least the packetHandler method of SLClient.

See Also:
nl.knmi.orfeus.seedlink.client.SeedLinkConnection.

Field Summary
static java.lang.String[] BANNER
           
protected  java.lang.String begin_time
          Beginning of time window for read start in past.
static java.lang.String CLASS_NAME
          The class name.
static java.lang.String COPYRIGHT_YEAR
           
protected  java.lang.String end_time
          End of time window for reading windowed data.
 java.lang.String infolevel
          INFO LEVEL for info request only.
 java.lang.String multiselect
          Selectors for multi-station.
static java.lang.String PACKAGE
          The full class name.
 boolean ppackets
          Flag to indicate show detailed packet information.
static java.lang.String PROGRAM_NAME
           
 java.lang.String selectors
          Selectors for uni-station or default selectors for multi-station.
 SeedLinkConnection slconn
          SeedLinkConnection object for communicating with the SeedLinkConnection over a socket.
 SLLog sllog
          Logging object.
 java.lang.String statefile
          Name of file for reading (if exists) and storing state.
 java.lang.String streamfile
          Name of file containing stream list for multi-station mode.
 int verbose
          Verbosity level, 0 is lowest.
static java.lang.String VERSION
          The version of this class.
static java.lang.String VERSION_DATE
           
static java.lang.String VERSION_INFO
           
static java.lang.String VERSION_YEAR
           
 
Constructor Summary
SLClient()
          Creates a new instance of SLClient.
SLClient(SLLog sllog)
          Creates a new instance of SLClient with the specified logging object
 
Method Summary
 void init()
          Initializes this SLCient.
static void main(java.lang.String[] args)
          main method
 boolean packetHandler(int count, SLPacket slpack)
          Method that processes each packet received from the SeedLinkConnection.
 int parseCmdLineArgs(java.lang.String[] args)
          Parses the commmand line arguments.
 void printUsage(boolean concise)
          Prints the usage message for this class.
 void run()
          Start this SLCient.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE

public static final java.lang.String PACKAGE
The full class name.

See Also:
Constant Field Values

CLASS_NAME

public static final java.lang.String CLASS_NAME
The class name.

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
The version of this class.

See Also:
Constant Field Values

VERSION_YEAR

public static final java.lang.String VERSION_YEAR
See Also:
Constant Field Values

VERSION_DATE

public static final java.lang.String VERSION_DATE
See Also:
Constant Field Values

COPYRIGHT_YEAR

public static final java.lang.String COPYRIGHT_YEAR
See Also:
Constant Field Values

PROGRAM_NAME

public static final java.lang.String PROGRAM_NAME
See Also:
Constant Field Values

VERSION_INFO

public static final java.lang.String VERSION_INFO
See Also:
Constant Field Values

BANNER

public static final java.lang.String[] BANNER

slconn

public SeedLinkConnection slconn
SeedLinkConnection object for communicating with the SeedLinkConnection over a socket.


verbose

public int verbose
Verbosity level, 0 is lowest.


ppackets

public boolean ppackets
Flag to indicate show detailed packet information.


streamfile

public java.lang.String streamfile
Name of file containing stream list for multi-station mode.


selectors

public java.lang.String selectors
Selectors for uni-station or default selectors for multi-station.


multiselect

public java.lang.String multiselect
Selectors for multi-station.


statefile

public java.lang.String statefile
Name of file for reading (if exists) and storing state.


begin_time

protected java.lang.String begin_time
Beginning of time window for read start in past.


end_time

protected java.lang.String end_time
End of time window for reading windowed data.


infolevel

public java.lang.String infolevel
INFO LEVEL for info request only.


sllog

public SLLog sllog
Logging object.

Constructor Detail

SLClient

public SLClient()
Creates a new instance of SLClient.


SLClient

public SLClient(SLLog sllog)
Creates a new instance of SLClient with the specified logging object

Parameters:
sllog - logging object to handle messages.
Method Detail

parseCmdLineArgs

public int parseCmdLineArgs(java.lang.String[] args)
Parses the commmand line arguments.

Parameters:
args - the main method arguments.
Returns:
-1 on error, 1 if version or help argument found, 0 otherwise.

init

public void init()
          throws java.net.UnknownHostException,
                 SeedLinkException
Initializes this SLCient.

Throws:
SeedLinkException - on error.
java.net.UnknownHostException - if no IP address for the local host could be found.

run

public void run()
         throws java.lang.Exception
Start this SLCient.

Throws:
java.lang.Exception
SeedLinkException - on error.
IOException - if an I/O error occurs.

packetHandler

public boolean packetHandler(int count,
                             SLPacket slpack)
                      throws java.lang.Exception
Method that processes each packet received from the SeedLinkConnection. This mehod should be overridded when subclassing SLClient.

Parameters:
count - the packet to process.
slpack - the packet to process.
Returns:
true if connection to SeedLink server should be closed and session terminated, false otherwise.
Throws:
implementation - dependent
java.lang.Exception

printUsage

public void printUsage(boolean concise)
Prints the usage message for this class.


main

public static void main(java.lang.String[] args)
main method