Class SleProvider
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
It implements SLE BIND and UNBIND operations and also takes over the schedule reports activation/deactivation.
When BIND is called, it relies first on the AuthProvider to obtain user/name passwords information for the
new connection and then on the ServiceInitializer for obtaining a SleService.
It then it forwards all the subsequent operations to the newly obtained service.
In order to use it
- create a Netty pipeline with this class at the end of the pipeline
- make an implementation for
AuthProviderthat provides authentication data - make an implementation for
ServiceInitializerwhich based on some configuration creates one of theCltuServiceProviderorRafServiceProvider(or maybe others in the future). - make an implementation of
FrameSinkwhich uplinks the CLTUs - make an implementation of
FrameSourcewhich provides telemetry frames
See the SleUdpBridge for an example on how this class is used to create a SLE to UDP bridge.
- Author:
- nm
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthLevelprotected io.netty.channel.ChannelHandlerContextprotected List<SleMonitor>protected CompletableFuture<Void> -
Constructor Summary
ConstructorsConstructorDescriptionSleProvider(AuthProvider authProvider, String responderId, ServiceInitializer serviceInitializer) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMonitor(SleMonitor monitor) Add a monitor to be notified when events happen.protected voidchangeState(State newState) voidchannelActive(io.netty.channel.ChannelHandlerContext ctx) voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidchannelRegistered(io.netty.channel.ChannelHandlerContext ctx) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) protected Credentialsprotected InvokeIdprotected CredentialsintbooleanbooleanChecks if the netty outgoing buffer is full.protected voidprotected voidprotected voidprocessBindInvocation(SleBindInvocation bindInvocation) protected voidprocessSleScheduleStatusReportInvocation(SleScheduleStatusReportInvocation sleScheduleStatusReportInvocation) protected voidprocessUnbindInvocation(SleUnbindInvocation unbindInvocation) voidremoveMonitor(SleMonitor monitor) voidsendMessage(com.beanit.jasn1.ber.types.BerType msg) voidsetAuthLevel(AuthLevel authLevel) voidsetVersionNumber(int versionNumber) voidshutdown()protected voidverifyBindCredentials(Credentials credentials) protected voidverifyNonBindCredentials(Credentials credentials) Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
startingCf
-
channelHandlerContext
protected io.netty.channel.ChannelHandlerContext channelHandlerContext -
authLevel
-
monitors
-
-
Constructor Details
-
SleProvider
public SleProvider(AuthProvider authProvider, String responderId, ServiceInitializer serviceInitializer)
-
-
Method Details
-
getVersionNumber
public int getVersionNumber() -
setVersionNumber
public void setVersionNumber(int versionNumber) -
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
getAuthLevel
-
setAuthLevel
-
channelRegistered
- Specified by:
channelRegisteredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelRegisteredin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelActive
- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
isConnected
public boolean isConnected() -
shutdown
public void shutdown() -
processBindInvocation
-
processUnbindInvocation
-
processSleScheduleStatusReportInvocation
protected void processSleScheduleStatusReportInvocation(SleScheduleStatusReportInvocation sleScheduleStatusReportInvocation) -
peerAbort
protected void peerAbort() -
getNonBindCredentials
-
getBindCredentials
-
verifyNonBindCredentials
-
verifyBindCredentials
-
getInvokeId
-
changeState
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-
notifyDisconnected
protected void notifyDisconnected() -
channelInactive
- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
addMonitor
Add a monitor to be notified when events happen.- Parameters:
monitor-
-
removeMonitor
-
sendMessage
public void sendMessage(com.beanit.jasn1.ber.types.BerType msg) -
isWritable
public boolean isWritable()Checks if the netty outgoing buffer is full.The onlineTimely RAF service should drop messages if the buffer is full.
The offline RAF service should back pressure the producer.
Note that even if the buffer is full, Netty will accept messages sent with
sendMessage(BerType).If the connection is completely stuck, the ISP1 heartbeat should detect the condition and close it.
- Returns:
-