edu.sc.seis.seisFile.seedlink
Class SeedlinkReader

java.lang.Object
  extended by edu.sc.seis.seisFile.seedlink.SeedlinkReader

public class SeedlinkReader
extends java.lang.Object


Field Summary
static java.lang.String DEFAULT_HOST
           
static int DEFAULT_PORT
           
static java.lang.String INFO_ALL
           
static java.lang.String INFO_CAPABILITIES
           
static java.lang.String INFO_CONNECTIONS
           
static java.lang.String INFO_GAPS
           
static java.lang.String INFO_ID
           
static java.lang.String INFO_STATIONS
           
static java.lang.String INFO_STREAMS
           
 
Constructor Summary
SeedlinkReader(java.lang.String host)
          uses the default port of 18000
SeedlinkReader(java.lang.String host, int port)
           
SeedlinkReader(java.lang.String host, int port, boolean verbose)
           
 
Method Summary
 void close()
           
 void endHandshake()
           
 java.lang.String getHost()
           
 int getPort()
           
 java.io.PrintWriter getVerboseWriter()
           
 boolean hasNext()
           
 void info(java.lang.String level)
          send an INFO command.
 boolean isConnected()
           
 boolean isVerbose()
           
 SeedlinkPacket next()
           
 void setVerbose(boolean verbose)
           
 void setVerboseWriter(java.io.PrintWriter verboseWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HOST

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

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

INFO_ID

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

INFO_CAPABILITIES

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

INFO_STATIONS

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

INFO_STREAMS

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

INFO_GAPS

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

INFO_CONNECTIONS

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

INFO_ALL

public static final java.lang.String INFO_ALL
See Also:
Constant Field Values
Constructor Detail

SeedlinkReader

public SeedlinkReader(java.lang.String host)
               throws java.net.UnknownHostException,
                      java.io.IOException,
                      SeedlinkException
uses the default port of 18000

Throws:
java.net.UnknownHostException
java.io.IOException
SeedlinkException

SeedlinkReader

public SeedlinkReader(java.lang.String host,
                      int port)
               throws java.net.UnknownHostException,
                      java.io.IOException,
                      SeedlinkException
Throws:
java.net.UnknownHostException
java.io.IOException
SeedlinkException

SeedlinkReader

public SeedlinkReader(java.lang.String host,
                      int port,
                      boolean verbose)
               throws java.net.UnknownHostException,
                      java.io.IOException,
                      SeedlinkException
Throws:
java.net.UnknownHostException
java.io.IOException
SeedlinkException
Method Detail

hasNext

public boolean hasNext()
                throws java.io.IOException
Throws:
java.io.IOException

next

public SeedlinkPacket next()
                    throws java.io.IOException,
                           SeedlinkException
Throws:
java.io.IOException
SeedlinkException

info

public void info(java.lang.String level)
          throws java.io.IOException
send an INFO command. The resulting packets can be retrieved with calls to next(), although it seems there is no good way to determine how many packets will be returned or when they have all arrived without parsing the xml. This appears to be a shortcoming of the seedlink protocol. INFO requests should probably not be sent after the end of the handshake as real data packets may arrive causing confusion.

Throws:
java.io.IOException

endHandshake

public void endHandshake()
                  throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

isConnected

public boolean isConnected()

isVerbose

public boolean isVerbose()

setVerbose

public void setVerbose(boolean verbose)

getVerboseWriter

public java.io.PrintWriter getVerboseWriter()

setVerboseWriter

public void setVerboseWriter(java.io.PrintWriter verboseWriter)

getHost

public java.lang.String getHost()

getPort

public int getPort()