Class SleProvider

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

    public class SleProvider
    extends io.netty.channel.ChannelInboundHandlerAdapter
    This class provides the common SLE functionality across all services.

    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

    1. create a Netty pipeline with this class at the end of the pipeline
    2. make an implementation for AuthProvider that provides authentication data
    3. make an implementation for ServiceInitializer which based on some configuration creates one of the CltuServiceProvider or RafServiceProvider (or maybe others in the future).
    4. make an implementation of CltuUplinker which uplinks the CLTUs
    5. make an implementation of FrameDownlinker which provides telemetry frames

    See the SleUdpBridge for an example on how this class is used to create a SLE to UDP bridge.

    Author:
    nm
    • Field Detail

      • channelHandlerContext

        protected io.netty.channel.ChannelHandlerContext channelHandlerContext
    • Method Detail

      • getVersionNumber

        public int getVersionNumber()
      • setVersionNumber

        public void setVersionNumber​(int versionNumber)
      • channelRead

        public void channelRead​(io.netty.channel.ChannelHandlerContext ctx,
                                Object msg)
        Specified by:
        channelRead in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
      • getAuthLevel

        public AuthLevel getAuthLevel()
      • setAuthLevel

        public void setAuthLevel​(AuthLevel authLevel)
      • channelRegistered

        public void channelRegistered​(io.netty.channel.ChannelHandlerContext ctx)
                               throws Exception
        Specified by:
        channelRegistered in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelRegistered in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        Exception
      • channelActive

        public void channelActive​(io.netty.channel.ChannelHandlerContext ctx)
                           throws Exception
        Specified by:
        channelActive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelActive in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        Exception
      • isConnected

        public boolean isConnected()
      • shutdown

        public void shutdown()
      • processBindInvocation

        protected void processBindInvocation​(SleBindInvocation bindInvocation)
      • processUnbindInvocation

        protected void processUnbindInvocation​(SleUnbindInvocation unbindInvocation)
      • processSleScheduleStatusReportInvocation

        protected void processSleScheduleStatusReportInvocation​(SleScheduleStatusReportInvocation sleScheduleStatusReportInvocation)
      • peerAbort

        protected void peerAbort()
      • getNonBindCredentials

        protected Credentials getNonBindCredentials()
      • getBindCredentials

        protected Credentials getBindCredentials()
      • verifyNonBindCredentials

        protected void verifyNonBindCredentials​(Credentials credentials)
      • verifyBindCredentials

        protected void verifyBindCredentials​(Credentials credentials)
      • getInvokeId

        protected InvokeId getInvokeId()
      • changeState

        protected void changeState​(State newState)
      • exceptionCaught

        public void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx,
                                    Throwable cause)
        Specified by:
        exceptionCaught in interface io.netty.channel.ChannelHandler
        Specified by:
        exceptionCaught in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        exceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapter
      • notifyDisconnected

        protected void notifyDisconnected()
      • channelInactive

        public void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)
                             throws Exception
        Specified by:
        channelInactive in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        channelInactive in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        Exception
      • addMonitor

        public void addMonitor​(SleMonitor monitor)
        Add a monitor to be notified when events happen.
        Parameters:
        monitor -
      • removeMonitor

        public void removeMonitor​(SleMonitor monitor)
      • 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: