Package org.yamcs.tctm
Class AbstractTcDataLink
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractService
-
- org.yamcs.tctm.AbstractLink
-
- org.yamcs.tctm.AbstractTcDataLink
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
,SystemParametersProducer
,Link
,TcDataLink
- Direct Known Subclasses:
AbstractThreadedTcDataLink
,Cop1TcPacketHandler
,TcPacketHandler
public abstract class AbstractTcDataLink extends AbstractLink implements TcDataLink
Base implementation for a TC data link that initialises a post processor and implements basic methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.yamcs.tctm.Link
Link.Status
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandPostprocessor
cmdPostProcessor
protected CommandHistoryPublisher
commandHistoryPublisher
protected AtomicLong
dataCount
protected long
housekeepingInterval
protected String
sp_dataCount_id
protected String
sv_linkStatus_id
-
Fields inherited from class org.yamcs.tctm.AbstractLink
config, disabled, eventProducer, linkName, log, timeService, yamcsInstance
-
-
Constructor Summary
Constructors Constructor Description AbstractTcDataLink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
ackCommand(org.yamcs.protobuf.Commanding.CommandId commandId)
send an ack in the command history that the command has been sent out of the linkprotected void
failedCommand(org.yamcs.protobuf.Commanding.CommandId commandId, String reason)
Send to command history the failed commandprotected long
getCurrentTime()
long
getDataInCount()
long
getDataOutCount()
AggregatedDataLink
getParent()
If this link is a sublink of an aggregated link, get the parent link.String
getYamcsInstance()
void
init(String yamcsInstance, String linkName, YConfiguration config)
Called at startup to initialize the link.protected void
initPostprocessor(String instance, YConfiguration config)
void
resetCounters()
void
setCommandHistoryPublisher(CommandHistoryPublisher commandHistoryListener)
void
setParent(AggregatedDataLink parent)
Set the parent link if this is a sublink of an aggregated link.-
Methods inherited from class org.yamcs.tctm.AbstractLink
collectSystemParameters, connectionStatus, disable, doDisable, doEnable, enable, getConfig, getDetailedStatus, getEventLoop, getLinkStatus, getName, getSystemParameters, isDisabled, isRunningAndEnabled, setupSystemParameters
-
Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, doStart, doStop, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.yamcs.tctm.Link
disable, enable, getConfig, getDetailedStatus, getLinkStatus, getName, getSpec, isDisabled, setupSystemParameters
-
Methods inherited from interface org.yamcs.tctm.TcDataLink
sendTc
-
-
-
-
Field Detail
-
commandHistoryPublisher
protected CommandHistoryPublisher commandHistoryPublisher
-
dataCount
protected AtomicLong dataCount
-
sv_linkStatus_id
protected String sv_linkStatus_id
-
sp_dataCount_id
protected String sp_dataCount_id
-
cmdPostProcessor
protected CommandPostprocessor cmdPostProcessor
-
housekeepingInterval
protected long housekeepingInterval
-
-
Method Detail
-
init
public void init(String yamcsInstance, String linkName, YConfiguration config) throws ConfigurationException
Description copied from interface:Link
Called at startup to initialize the link.The config corresponds to the map that is under the link definition in yamcs.instance.yaml.
- Specified by:
init
in interfaceLink
- Overrides:
init
in classAbstractLink
config
- - the configuration - cannot be null (but can be empty)- Throws:
ConfigurationException
-
getCurrentTime
protected long getCurrentTime()
- Overrides:
getCurrentTime
in classAbstractLink
-
initPostprocessor
protected void initPostprocessor(String instance, YConfiguration config)
-
setCommandHistoryPublisher
public void setCommandHistoryPublisher(CommandHistoryPublisher commandHistoryListener)
- Specified by:
setCommandHistoryPublisher
in interfaceTcDataLink
-
getDataInCount
public long getDataInCount()
- Specified by:
getDataInCount
in interfaceLink
-
getDataOutCount
public long getDataOutCount()
- Specified by:
getDataOutCount
in interfaceLink
-
resetCounters
public void resetCounters()
- Specified by:
resetCounters
in interfaceLink
-
getParent
public AggregatedDataLink getParent()
Description copied from interface:Link
If this link is a sublink of an aggregated link, get the parent link.
-
setParent
public void setParent(AggregatedDataLink parent)
Description copied from interface:Link
Set the parent link if this is a sublink of an aggregated link.
-
failedCommand
protected void failedCommand(org.yamcs.protobuf.Commanding.CommandId commandId, String reason)
Send to command history the failed command
-
ackCommand
protected void ackCommand(org.yamcs.protobuf.Commanding.CommandId commandId)
send an ack in the command history that the command has been sent out of the link- Parameters:
commandId
-
-
getYamcsInstance
public String getYamcsInstance()
-
-