public class TcpTmDataLink extends com.google.common.util.concurrent.AbstractExecutionThreadService implements TmPacketDataLink, SystemParametersProducer
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
disabled |
protected String |
host |
protected org.slf4j.Logger |
log |
protected long |
packetcount |
protected int |
port |
protected TimeService |
timeService |
protected Socket |
tmSocket |
| Modifier | Constructor and Description |
|---|---|
protected |
TcpTmDataLink(String instance,
String name) |
|
TcpTmDataLink(String instance,
String name,
String spec) |
| Modifier and Type | Method and Description |
|---|---|
void |
disable()
Disable any data I/O through this link.
|
void |
enable()
Reenable the data transit if disabled by the disable() method.
|
long |
getDataCount() |
String |
getDetailedStatus() |
String |
getLinkStatus()
Returns one of "OK" or "UNAVAIL".
|
PacketWithTime |
getNextPacket() |
Collection<ParameterValue> |
getSystemParameters() |
boolean |
isDisabled() |
protected void |
openSocket() |
protected boolean |
readWithBlocking(byte[] b,
int pos,
int n)
Read n bytes from the tmSocket, blocking if necessary till all bytes are available.
|
void |
run() |
void |
setTmSink(TmSink tmSink)
sets the tm processor that should get all the tm packets
|
protected void |
setupSysVariables() |
void |
triggerShutdown() |
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, shutDown, startAsync, startUp, state, stopAsync, toStringprotected volatile long packetcount
protected Socket tmSocket
protected String host
protected int port
protected volatile boolean disabled
protected final org.slf4j.Logger log
protected final TimeService timeService
public TcpTmDataLink(String instance, String name, String spec) throws ConfigurationException
ConfigurationExceptionprotected void openSocket()
throws IOException
IOExceptionpublic void setTmSink(TmSink tmSink)
TmPacketDataLinksetTmSink in interface TmPacketDataLinkpublic void run()
run in class com.google.common.util.concurrent.AbstractExecutionThreadServicepublic PacketWithTime getNextPacket()
protected boolean readWithBlocking(byte[] b,
int pos,
int n)
throws IOException
b - n - IOExceptionpublic String getLinkStatus()
LinkgetLinkStatus in interface Linkpublic void triggerShutdown()
triggerShutdown in class com.google.common.util.concurrent.AbstractExecutionThreadServicepublic void disable()
Linkpublic void enable()
Linkpublic boolean isDisabled()
isDisabled in interface Linkpublic String getDetailedStatus()
getDetailedStatus in interface Linkpublic long getDataCount()
getDataCount in interface Linkprotected void setupSysVariables()
public Collection<ParameterValue> getSystemParameters()
getSystemParameters in interface SystemParametersProducerCopyright © 2017 Space Applications Services. All rights reserved.