Class YamcsTcLink
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
,SystemParametersProducer
,Link
,LinkActionProvider
,TcDataLink
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.yamcs.tctm.Link
Link.Status
Nested 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
Fields inherited from class org.yamcs.tctm.AbstractTcDataLink
cmdPostProcessor, commandHistoryPublisher, housekeepingInterval
Fields inherited from class org.yamcs.tctm.AbstractLink
config, dataInCount, dataOutCount, disabled, eventProducer, LINK_NAMESPACE, linkName, log, timeService, yamcsInstance
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Link.Status
In case the link should be connected (i.e. is running and enabled) this method is called to return the actual connection statusvoid
void
doEnable()
protected void
doStart()
protected void
doStop()
If this link is a sublink of an aggregated link, get the parent link.void
init
(String instance, String name, YConfiguration config) Called at startup to initialize the link.boolean
Attempt to send the command and return true if the command has been sent or its processing has finished.Methods inherited from class org.yamcs.tctm.AbstractTcDataLink
ackCommand, failedCommand, getDataInCount, getDefaultSpec, initPostprocessor, initPostprocessor2, postprocess, setCommandHistoryPublisher
Methods inherited from class org.yamcs.tctm.AbstractLink
addAction, collectSystemParameters, dataIn, dataOut, disable, enable, getAction, getActions, getConfig, getCurrentTime, getDataOutCount, getDetailedStatus, getEventLoop, getLinkStatus, getName, getSystemParameters, getYamcsInstance, isDisabled, isRunningAndEnabled, resetCounters, setParent, setupSystemParameters
Methods inherited from class com.google.common.util.concurrent.AbstractService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, 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, getDataOutCount, getDetailedStatus, getExtraInfo, getLinkStatus, getName, getSpec, isDisabled, isEffectivelyDisabled, resetCounters, setParent, setupSystemParameters
Methods inherited from interface org.yamcs.parameter.SystemParametersProducer
getFrequency
Methods inherited from interface org.yamcs.tctm.TcDataLink
isCommandingAvailable, isTcDataLinkImplemented
-
Constructor Details
-
YamcsTcLink
-
-
Method Details
-
init
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 classAbstractTcDataLink
config
- - the configuration - cannot be null (but can be empty)
-
sendCommand
Description copied from interface:TcDataLink
Attempt to send the command and return true if the command has been sent or its processing has finished.If false is returned, the
LinkManager
will attempt to send the command via the next TC link (if any).The link is expected to update the
CommandHistoryPublisher.AcknowledgeSent_KEY
ack in the command history if the method returned true. If it returned false, the ack should not be updated (it will be updated by the next link or by the Link Manager if there is other no link).The link can update the
CommandHistoryPublisher.AcknowledgeSent_KEY
ack with a negative ack and return true (i.e. the command has not been really sent but it has finished processing).The return true/false has been introduced in Yamcs 5.6.0. Before that version, the old method sendTc was implicitly returning true. As of Yamcs 5.6.0 most links return true even when they cannot send the command (setting the negative Sent ack).
Throwing an exception is equivalent with returning false, except a error log will be printed (this is considered a bug)
- Returns:
-
doStart
protected void doStart()- Specified by:
doStart
in classcom.google.common.util.concurrent.AbstractService
-
doDisable
public void doDisable()- Overrides:
doDisable
in classAbstractLink
-
doEnable
public void doEnable()- Overrides:
doEnable
in classAbstractLink
-
connectionStatus
Description copied from class:AbstractLink
In case the link should be connected (i.e. is running and enabled) this method is called to return the actual connection status- Specified by:
connectionStatus
in classAbstractLink
-
doStop
protected void doStop()- Specified by:
doStop
in classcom.google.common.util.concurrent.AbstractService
-
getParent
Description copied from interface:Link
If this link is a sublink of an aggregated link, get the parent link.- Specified by:
getParent
in interfaceLink
- Overrides:
getParent
in classAbstractLink
-