|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.sc.seis.seisFile.seedlink.SeedlinkReader
public class SeedlinkReader
Broke up the 'next' method into 'hasNext' and 'readPacket'. Added 'getInfoString' methods to support getting the SeedLink information string. Added 'select' and 'startData' methods to support start and end time.
Field Summary | |
---|---|
static java.lang.String |
DATA_COMMAND
|
static java.lang.String |
DATA_TYPE
|
static java.lang.String |
DEFAULT_HOST
|
static int |
DEFAULT_PORT
|
static int |
DEFAULT_TIMEOUT_SECOND
|
static java.lang.String |
EMPTY
|
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
|
static java.lang.String |
TIME_COMMAND
|
Constructor Summary | |
---|---|
SeedlinkReader()
default of IRIS DMC |
|
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,
int timeoutSeconds)
|
|
SeedlinkReader(java.lang.String host,
int port,
int timeoutSeconds,
boolean verbose)
|
Method Summary | |
---|---|
boolean |
available()
true if there is enough data in the instream to possibly read a data record. |
void |
close()
|
void |
endHandshake()
|
java.lang.String |
getHost()
|
java.lang.String |
getInfoString()
Get the SeedLink information string for streams. |
java.lang.String |
getInfoString(java.lang.String infoType)
Get the SeedLink information string. |
java.lang.String |
getInfoString(java.lang.String infoType,
boolean addNewlines)
Get the SeedLink information string. |
int |
getPort()
|
java.io.PrintWriter |
getVerboseWriter()
|
boolean |
hasNext()
Determine if a packet may be available. |
void |
info(java.lang.String level)
send an INFO command. |
protected void |
internalSendCmd(java.lang.String cmd)
|
boolean |
isConnected()
|
boolean |
isVerbose()
|
SeedlinkPacket |
next()
Get the next packet. |
protected java.lang.String |
readLine()
|
SeedlinkPacket |
readPacket()
Read the next packet. |
void |
reconnect()
|
void |
select(java.lang.String network,
java.lang.String station,
java.lang.String location,
java.lang.String channel)
Select the stream. |
void |
select(java.lang.String network,
java.lang.String station,
java.lang.String location,
java.lang.String channel,
java.lang.String type)
Select the stream. |
void |
sendCmd(java.lang.String cmd)
Sends a SeedLink modifier command, generally should be limited to |
java.lang.String[] |
sendHello()
|
void |
setVerbose(boolean verbose)
|
void |
setVerboseWriter(java.io.PrintWriter verboseWriter)
|
void |
startData()
Start the data transfer. |
void |
startData(java.lang.String start,
java.lang.String end)
Start the data transfer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String EMPTY
public static final java.lang.String DATA_TYPE
public static final java.lang.String DATA_COMMAND
public static final java.lang.String TIME_COMMAND
public static final java.lang.String DEFAULT_HOST
public static final int DEFAULT_PORT
public static final int DEFAULT_TIMEOUT_SECOND
public static final java.lang.String INFO_ID
public static final java.lang.String INFO_CAPABILITIES
public static final java.lang.String INFO_STATIONS
public static final java.lang.String INFO_STREAMS
public static final java.lang.String INFO_GAPS
public static final java.lang.String INFO_CONNECTIONS
public static final java.lang.String INFO_ALL
Constructor Detail |
---|
public SeedlinkReader() throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
public SeedlinkReader(java.lang.String host) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
public SeedlinkReader(java.lang.String host, int port) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
public SeedlinkReader(java.lang.String host, int port, int timeoutSeconds) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
public SeedlinkReader(java.lang.String host, int port, int timeoutSeconds, boolean verbose) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
Method Detail |
---|
public boolean hasNext() throws java.io.IOException
java.io.IOException
- if an I/O Exception occurs.readPacket()
public boolean available() throws java.io.IOException
java.io.IOException
public java.lang.String getInfoString() throws java.io.IOException, SeedlinkException, SeedFormatException
java.io.IOException
- if an I/O Exception occurs.
SeedlinkException
- if no packets or there is an error creating the packet.
SeedFormatException
- if there is an error with the SEED format.public java.lang.String getInfoString(java.lang.String infoType) throws java.io.IOException, SeedlinkException, SeedFormatException
infoType
- the information type.
java.io.IOException
- if an I/O Exception occurs.
SeedlinkException
- if no packets or there is an error creating the packet.
SeedFormatException
- if there is an error with the SEED format.public java.lang.String getInfoString(java.lang.String infoType, boolean addNewlines) throws java.io.IOException, SeedlinkException, SeedFormatException
infoType
- the information type.addNewlines
- true to add newlines to support XML parsing, false otherwise.
java.io.IOException
- if an I/O Exception occurs.
SeedlinkException
- if no packets or there is an error creating the packet.
SeedFormatException
- if there is an error with the SEED format.public SeedlinkPacket next() throws java.io.IOException, SeedlinkException
java.io.IOException
- if an I/O Exception occurs.
SeedlinkException
- if no packets or there is an error creating the packet.hasNext()
,
readPacket()
public SeedlinkPacket readPacket() throws java.io.IOException, SeedlinkException
java.io.IOException
- if an I/O Exception occurs.
SeedlinkException
- if there is an error creating the packet.hasNext()
public void info(java.lang.String level) throws java.io.IOException
java.io.IOException
public void endHandshake() throws java.io.IOException
java.io.IOException
public void close()
public boolean isConnected()
public void reconnect() throws java.io.IOException, SeedlinkException
java.io.IOException
SeedlinkException
public java.lang.String[] sendHello() throws java.io.IOException, SeedlinkException
java.io.IOException
SeedlinkException
protected java.lang.String readLine() throws java.io.IOException, SeedlinkException
java.io.IOException
SeedlinkException
public void sendCmd(java.lang.String cmd) throws java.io.IOException, SeedlinkException
cmd
- the command.
STATION, SELECT FETCH, DATA and TIME.
SeedlinkException
- if a SeedLink error occurs.
java.io.IOException
- if an I/O Exception occurs.public void select(java.lang.String network, java.lang.String station, java.lang.String location, java.lang.String channel) throws SeedlinkException, java.io.IOException
network
- the network.station
- the station.location
- the location or empty if none.channel
- the channel.
SeedlinkException
- if a SeedLink error occurs.
java.io.IOException
- if an I/O Exception occurs.public void select(java.lang.String network, java.lang.String station, java.lang.String location, java.lang.String channel, java.lang.String type) throws SeedlinkException, java.io.IOException
network
- the network.station
- the station.location
- the location or empty if none.channel
- the channel.type
- the data type.
SeedlinkException
java.io.IOException
public void startData() throws SeedlinkException, java.io.IOException
SeedlinkException
- if a SeedLink error occurs.
java.io.IOException
- if an I/O Exception occurs.public void startData(java.lang.String start, java.lang.String end) throws SeedlinkException, java.io.IOException
start
- the start time or empty string if none.end
- the end time or empty string if none (ignored if no start time.)
SeedlinkException
- if a SeedLink error occurs.
java.io.IOException
- if an I/O Exception occurs.protected void internalSendCmd(java.lang.String cmd) throws java.io.IOException, SeedlinkException
java.io.IOException
SeedlinkException
public boolean isVerbose()
public void setVerbose(boolean verbose)
public java.io.PrintWriter getVerboseWriter()
public void setVerboseWriter(java.io.PrintWriter verboseWriter)
public java.lang.String getHost()
public int getPort()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |