Package org.yamcs.sle.user
Class CltuServiceUserHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.yamcs.sle.user.AbstractServiceUserHandler
-
- org.yamcs.sle.user.CltuServiceUserHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class CltuServiceUserHandler extends AbstractServiceUserHandler
Implementation for the CCSDS RECOMMENDED STANDARD FOR SLE FCLTU SERVICE CCSDS 912.1-B-4 August 2016 https://public.ccsds.org/Pubs/912x1b4.pdf- Author:
- nm
-
-
Field Summary
-
Fields inherited from class org.yamcs.sle.user.AbstractServiceUserHandler
attr, authLevel, channelHandlerContext, monitors, startingCf, state
-
-
Constructor Summary
Constructors Constructor Description CltuServiceUserHandler(Isp1Authentication auth, SleAttributes attr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMonitor(CltuSleMonitor monitor)Add a monitor to be notified when events happen.protected Constants.ApplicationIdentifiergetApplicationIdentifier()longgetCltuBufferAvailable()CompletableFuture<SleParameter>getParameter(int parameterId)Get the value of an CLTU parameter from the providerCompletableFuture<SleParameter>getParameter(Constants.ParameterName parameterName)protected voidprocessData(com.beanit.jasn1.ber.BerTag berTag, InputStream is)voidremoveMonitor(CltuSleMonitor monitor)protected voidsendStart(CompletableFuture<Void> cf)CompletableFuture<Void>start()Request that the SLE service provider starts sending dataCompletableFuture<Void>throwEvent(int eventIdentifier, byte[] eventQualifier)inttransferCltu(byte[] cltu)Transfer a CLTU to the provider requesting immediate transmissioninttransferCltu(byte[] cltu, CcsdsTime earliestTransmissionTime, CcsdsTime latestTransmissionTime, long delayMicrosec, boolean produceReport)Transfer a CLTU to the provider-
Methods inherited from class org.yamcs.sle.user.AbstractServiceUserHandler
bind, changeState, channelActive, channelRead, channelRegistered, checkUnbound, exceptionCaught, getAuthLevel, getFuture, getInvokeId, getInvokeId, getNonBindCredentials, getState, getVersionNumber, isConnected, notifyDisconnected, peerAbort, processBindInvocation, processStopReturn, processUnbindInvocation, schedulePeriodicStatusReport, setAuthLevel, setVersionNumber, shutdown, stop, stopPeriodicStatusReport, unbind, verifyBindCredentials, verifyNonBindCredentials
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
CltuServiceUserHandler
public CltuServiceUserHandler(Isp1Authentication auth, SleAttributes attr)
-
-
Method Detail
-
getParameter
public CompletableFuture<SleParameter> getParameter(int parameterId)
Get the value of an CLTU parameter from the provider- Specified by:
getParameterin classAbstractServiceUserHandler- Parameters:
parameterId- one of the parameters defined inConstants.ParameterName. Note that not all of them make sense for the CLTU, see the table 3-11 in the standard to see which ones make sense.- Returns:
-
getParameter
public CompletableFuture<SleParameter> getParameter(Constants.ParameterName parameterName)
-
transferCltu
public int transferCltu(byte[] cltu)
Transfer a CLTU to the provider requesting immediate transmission- Parameters:
cltu-- Returns:
- return the cltu id which is the identification number that will be provided back in the
CltuSleMonitor.onAsyncNotify(CltuAsyncNotifyInvocation)
-
transferCltu
public int transferCltu(byte[] cltu, CcsdsTime earliestTransmissionTime, CcsdsTime latestTransmissionTime, long delayMicrosec, boolean produceReport)Transfer a CLTU to the provider- Parameters:
cltu- the cltu to be transferredearliestTransmissionTime- earliest transmission time. null can be used to request immediate transmission.latestTransmissionTime- latest transmission time. null can be used to impose no limit.delayMicrosec-produceReport- if set to true, the CLTU provider will send a notification upon completion of the radidation. SeeCltuSleMonitor.onAsyncNotify(CltuAsyncNotifyInvocation)- Returns:
- return the cltu id which is the identification number that will be provided back in the
CltuSleMonitor.onAsyncNotify(CltuAsyncNotifyInvocation)
-
throwEvent
public CompletableFuture<Void> throwEvent(int eventIdentifier, byte[] eventQualifier)
- Parameters:
eventIdentifier-eventQualifier-- Returns:
-
addMonitor
public void addMonitor(CltuSleMonitor monitor)
Add a monitor to be notified when events happen.- Parameters:
monitor-
-
removeMonitor
public void removeMonitor(CltuSleMonitor monitor)
-
processData
protected void processData(com.beanit.jasn1.ber.BerTag berTag, InputStream is) throws IOException- Specified by:
processDatain classAbstractServiceUserHandler- Throws:
IOException
-
start
public CompletableFuture<Void> start()
Request that the SLE service provider starts sending data- Returns:
-
sendStart
protected void sendStart(CompletableFuture<Void> cf)
-
getCltuBufferAvailable
public long getCltuBufferAvailable()
-
getApplicationIdentifier
protected Constants.ApplicationIdentifier getApplicationIdentifier()
- Specified by:
getApplicationIdentifierin classAbstractServiceUserHandler
-
-