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
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.StatusNested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandPostprocessorprotected CommandHistoryPublisherprotected AtomicLongprotected longFields inherited from class org.yamcs.tctm.AbstractLink
config, disabled, eventProducer, linkName, log, timeService, yamcsInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 longlonglongIf this link is a sublink of an aggregated link, get the parent link.voidinit(String yamcsInstance, String linkName, YConfiguration config) Called at startup to initialize the link.protected voidinitPostprocessor(String instance, YConfiguration config) protected byte[]Postprocesses the command, unless postprocessing is disabled.voidvoidsetCommandHistoryPublisher(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, setupSystemParametersMethods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, doStart, doStop, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.yamcs.tctm.Link
disable, enable, getConfig, getDetailedStatus, getLinkStatus, getName, getSpec, isDisabled, isEffectivelyDisabled, setupSystemParametersMethods inherited from interface org.yamcs.parameter.SystemParametersProducer
getFrequency, getSystemParametersMethods inherited from interface org.yamcs.tctm.TcDataLink
sendCommand, sendTc
-
Field Details
-
commandHistoryPublisher
-
dataCount
-
cmdPostProcessor
-
housekeepingInterval
protected long housekeepingInterval
-
-
Constructor Details
-
AbstractTcDataLink
public AbstractTcDataLink()
-
-
Method Details
-
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
-
setCommandHistoryPublisher
- Specified by:
setCommandHistoryPublisherin interfaceTcDataLink
-
postprocess
Postprocesses the command, unless postprocessing is disabled.- Returns:
- potentially modified binary, or
nullto indicate that the command should not be handled further.
-
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
Description copied from interface:LinkIf this link is a sublink of an aggregated link, get the parent link. -
setParent
Description copied from interface:LinkSet the parent link if this is a sublink of an aggregated link. -
failedCommand
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
-