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 CommandPostprocessorcmdPostProcessorprotected CommandHistoryPublishercommandHistoryPublisherprotected longdataCountprotected longhousekeepingIntervalprotected Stringsp_dataCount_idprotected Stringsv_linkStatus_id-
Fields inherited from class org.yamcs.tctm.AbstractLink
config, disabled, eventProducer, linkName, log, yamcsInstance
-
-
Constructor Summary
Constructors Constructor Description AbstractTcDataLink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidackCommand(org.yamcs.protobuf.Commanding.CommandId commandId)send an ack in the command history that the command has been sent out of the linkprotected voidfailedCommand(org.yamcs.protobuf.Commanding.CommandId commandId, String reason)Send to command history the failed commandprotected longgetCurrentTime()longgetDataInCount()longgetDataOutCount()AggregatedDataLinkgetParent()If this link is a sublink of an aggregated link, get the parent link.StringgetYamcsInstance()voidinit(String yamcsInstance, String linkName, YConfiguration config)Called at startup to initialize the link.protected voidinitPostprocessor(String instance, YConfiguration config)voidresetCounters()voidsetCommandHistoryPublisher(CommandHistoryPublisher commandHistoryListener)voidsetParent(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 volatile long 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:LinkCalled at startup to initialize the link.The config corresponds to the map that is under the link definition in yamcs.instance.yaml.
- Specified by:
initin interfaceLink- Overrides:
initin classAbstractLinkconfig- - the configuration - cannot be null (but can be empty)- Throws:
ConfigurationException
-
getCurrentTime
protected long getCurrentTime()
- Overrides:
getCurrentTimein classAbstractLink
-
initPostprocessor
protected void initPostprocessor(String instance, YConfiguration config)
-
setCommandHistoryPublisher
public void setCommandHistoryPublisher(CommandHistoryPublisher commandHistoryListener)
- Specified by:
setCommandHistoryPublisherin interfaceTcDataLink
-
getDataInCount
public long getDataInCount()
- Specified by:
getDataInCountin interfaceLink
-
getDataOutCount
public long getDataOutCount()
- Specified by:
getDataOutCountin interfaceLink
-
resetCounters
public void resetCounters()
- Specified by:
resetCountersin interfaceLink
-
getParent
public AggregatedDataLink getParent()
Description copied from interface:LinkIf this link is a sublink of an aggregated link, get the parent link.
-
setParent
public void setParent(AggregatedDataLink parent)
Description copied from interface:LinkSet 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()
-
-