nl.knmi.orfeus
Class InfoSeedLinkClient

java.lang.Object
  extended by nl.knmi.orfeus.SLClient
      extended by nl.knmi.orfeus.InfoSeedLinkClient
All Implemented Interfaces:
java.lang.Runnable

public class InfoSeedLinkClient
extends SLClient
implements java.lang.Runnable


Field Summary
static java.lang.String DELIM
           
protected static java.lang.String E_CODES
           
static java.lang.String[] INFO_NAMES
           
protected  Document[] infoDocuments
           
protected  java.lang.String infoString
           
protected  java.lang.String[] infoStrings
           
protected static java.lang.String N_CODES
           
protected  int nInfoPackets
           
protected  long timeout
           
protected static java.lang.String Z_CODES
           
 
Fields inherited from class nl.knmi.orfeus.SLClient
BANNER, begin_time, CLASS_NAME, COPYRIGHT_YEAR, end_time, infolevel, multiselect, PACKAGE, ppackets, PROGRAM_NAME, selectors, slconn, sllog, statefile, streamfile, verbose, VERSION, VERSION_DATE, VERSION_INFO, VERSION_YEAR
 
Constructor Summary
InfoSeedLinkClient(long timeout)
          Creates a new instance of InfoSeedLinkClient
 
Method Summary
 java.util.Vector addChannelSet(java.util.Vector seedChannelVector, java.util.Vector channelElementsVector, Element stationElement, java.lang.String currentSelector)
          adds a ChannelSet
 java.util.Vector addStreams(java.util.Vector seedChannelVector, Element stationElement)
          adds streams for a station
 java.lang.String getInfo(java.lang.String infolevel)
          get info level
 Document getInfoDocument(java.lang.String infoLevel)
          return info as Document
 java.lang.String getInfoString(java.lang.String infoLevel)
          return info as String
 java.util.Vector getSeedChannels()
          return info as Document
static void main(java.lang.String[] args)
          main method
 boolean packetHandler(int count, SLPacket slpack)
          Method that processes each packet received from the SeedLinkServer.
 void run()
          Start this SLCient.
 void setSLAddress(java.lang.String sladdr)
          Sets the host:port of the SeedLink server.
 net.alomax.seistools.SeedChannel toSeedChannel(Element channelElement, java.lang.String network, java.lang.String staName, java.lang.String locName)
          returns table array String representation of this ChannelSet
 
Methods inherited from class nl.knmi.orfeus.SLClient
init, parseCmdLineArgs, printUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFO_NAMES

public static final java.lang.String[] INFO_NAMES

infoStrings

protected java.lang.String[] infoStrings

infoDocuments

protected Document[] infoDocuments

Z_CODES

protected static final java.lang.String Z_CODES
See Also:
Constant Field Values

N_CODES

protected static final java.lang.String N_CODES
See Also:
Constant Field Values

E_CODES

protected static final java.lang.String E_CODES
See Also:
Constant Field Values

DELIM

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

timeout

protected long timeout

infoString

protected java.lang.String infoString

nInfoPackets

protected int nInfoPackets
Constructor Detail

InfoSeedLinkClient

public InfoSeedLinkClient(long timeout)
Creates a new instance of InfoSeedLinkClient

Method Detail

setSLAddress

public void setSLAddress(java.lang.String sladdr)
Sets the host:port of the SeedLink server.

Parameters:
sladdr - the host:port of the SeedLink server.

getInfo

public java.lang.String getInfo(java.lang.String infolevel)
                         throws SeedLinkException
get info level

Throws:
SeedLinkException

run

public void run()
Description copied from class: SLClient
Start this SLCient.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class SLClient

packetHandler

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

Overrides:
packetHandler in class 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

getInfoString

public java.lang.String getInfoString(java.lang.String infoLevel)
                               throws SeedLinkException,
                                      DocumentException
return info as String

Throws:
SeedLinkException
DocumentException

getInfoDocument

public Document getInfoDocument(java.lang.String infoLevel)
                         throws SeedLinkException,
                                DocumentException
return info as Document

Throws:
SeedLinkException
DocumentException

getSeedChannels

public java.util.Vector getSeedChannels()
                                 throws SeedLinkException,
                                        DocumentException
return info as Document

Throws:
SeedLinkException
DocumentException

addStreams

public java.util.Vector addStreams(java.util.Vector seedChannelVector,
                                   Element stationElement)
adds streams for a station


addChannelSet

public java.util.Vector addChannelSet(java.util.Vector seedChannelVector,
                                      java.util.Vector channelElementsVector,
                                      Element stationElement,
                                      java.lang.String currentSelector)
adds a ChannelSet


toSeedChannel

public net.alomax.seistools.SeedChannel toSeedChannel(Element channelElement,
                                                      java.lang.String network,
                                                      java.lang.String staName,
                                                      java.lang.String locName)
returns table array String representation of this ChannelSet


main

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