Package org.yamcs.tctm
Class AbstractTcTmDataLink
java.lang.Object
com.google.common.util.concurrent.AbstractService
org.yamcs.tctm.AbstractLink
org.yamcs.tctm.AbstractTmDataLink
org.yamcs.tctm.AbstractTcTmDataLink
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
,SystemParametersProducer
,Link
,LinkActionProvider
,TcDataLink
,TmPacketDataLink
- Direct Known Subclasses:
TcpTcTmDataLink
,UdpTcTmDataLink
Base class for TM/TC links.
-
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
Modifier and TypeFieldDescriptionprotected CommandPostprocessor
protected CommandHistoryPublisher
protected AtomicLong
Fields inherited from class org.yamcs.tctm.AbstractTmDataLink
packetCount, packetPreprocessor, updateSimulationTime
Fields inherited from class org.yamcs.tctm.AbstractLink
config, disabled, eventProducer, linkName, log, timeService, yamcsInstance
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
ackCommand
(Commanding.CommandId commandId) send an ack in the command history that the command has been sent out of the linkprotected void
failedCommand
(Commanding.CommandId commandId, String reason) Send to command history the failed commandlong
Returns a default linkSpec
.void
init
(String instance, String name, YConfiguration config) Called at startup to initialize the link.protected void
initPostprocessor
(String instance, YConfiguration config) protected byte[]
Postprocesses the command, unless postprocessing is disabled.void
void
setCommandHistoryPublisher
(CommandHistoryPublisher commandHistoryListener) Methods inherited from class org.yamcs.tctm.AbstractTmDataLink
collectSystemParameters, getDataInCount, processPacket, setTmSink, setupSystemParameters, updateStats
Methods inherited from class org.yamcs.tctm.AbstractLink
addAction, connectionStatus, disable, doDisable, doEnable, enable, getAction, getActions, getConfig, getCurrentTime, getDetailedStatus, getEventLoop, getLinkStatus, getName, getParent, getSystemParameters, getYamcsInstance, isDisabled, isRunningAndEnabled, setParent
Methods 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, 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, getDataInCount, getDetailedStatus, getExtraInfo, getLinkStatus, getName, getParent, getSpec, isDisabled, isEffectivelyDisabled, setParent, setupSystemParameters
Methods inherited from interface org.yamcs.parameter.SystemParametersProducer
getFrequency, getSystemParameters
Methods inherited from interface org.yamcs.tctm.TcDataLink
isCommandingAvailable, isTcDataLinkImplemented, sendCommand
Methods inherited from interface org.yamcs.tctm.TmPacketDataLink
isTmPacketDataLinkImplemented
-
Field Details
-
commandHistoryPublisher
-
dataOutCount
-
cmdPostProcessor
-
-
Constructor Details
-
AbstractTcTmDataLink
public AbstractTcTmDataLink()
-
-
Method Details
-
getDefaultSpec
Description copied from interface:Link
Returns a default linkSpec
. This can be used in an implementation of {Link.getSpec()
. Eventually (after a few years), it is expected to migrate this logic directly into {LinkLink.getSpec()
, rather than returning null from there. But we want to give sufficient time for links everywhere to start defining their arguments.- Specified by:
getDefaultSpec
in interfaceLink
- Overrides:
getDefaultSpec
in classAbstractTmDataLink
-
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 classAbstractTmDataLink
config
- - the configuration - cannot be null (but can be empty)- Throws:
ConfigurationException
-
initPostprocessor
protected void initPostprocessor(String instance, YConfiguration config) throws ConfigurationException - Throws:
ConfigurationException
-
postprocess
Postprocesses the command, unless postprocessing is disabled.- Returns:
- potentially modified binary, or
null
to indicate that the command should not be handled further.
-
setCommandHistoryPublisher
- Specified by:
setCommandHistoryPublisher
in interfaceTcDataLink
-
failedCommand
Send to command history the failed command -
ackCommand
send an ack in the command history that the command has been sent out of the link- Parameters:
commandId
-
-
getDataOutCount
public long getDataOutCount()- Specified by:
getDataOutCount
in interfaceLink
- Overrides:
getDataOutCount
in classAbstractTmDataLink
-
resetCounters
public void resetCounters()- Specified by:
resetCounters
in interfaceLink
- Overrides:
resetCounters
in classAbstractTmDataLink
-