Class AbstractServiceUserHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.yamcs.sle.user.AbstractServiceUserHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
Direct Known Subclasses:
CltuServiceUserHandler, RacfServiceUserHandler

public abstract class AbstractServiceUserHandler extends io.netty.channel.ChannelInboundHandlerAdapter
Common class for all SLE services
Author:
nm
  • Field Details

    • startingCf

      protected CompletableFuture<Void> startingCf
    • state

      protected volatile State state
    • channelHandlerContext

      protected io.netty.channel.ChannelHandlerContext channelHandlerContext
    • authLevel

      protected AuthLevel authLevel
    • attr

      protected final SleAttributes attr
    • monitors

      protected List<SleMonitor> monitors
  • Constructor Details

  • Method Details

    • 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
    • getParameter

      public abstract CompletableFuture<SleParameter> getParameter(int parameterId)
      Get the value of an RAF parameter from the provider
      Parameters:
      parameterId - one of the parameters defined in Constants.ParameterName. Note that not all of them make sense for the RAF, see the table 3-11 in the standard to see which ones make sense.
      Returns:
    • isConnected

      public boolean isConnected()
    • bind

      public CompletableFuture<Void> bind()
      Establish an association with the provider
      Returns:
    • stop

      public CompletableFuture<Void> stop()
      request that the SLE service provider stop service provision and production.
      Returns:
    • unbind

    • schedulePeriodicStatusReport

      public CompletableFuture<Void> schedulePeriodicStatusReport(int intervalSec)
      Send a request to the server to ask for a periodic status report.
      Parameters:
      intervalSec - - the cycle on which the periodic report shall be sent
      Returns:
    • stopPeriodicStatusReport

      public CompletableFuture<Void> stopPeriodicStatusReport()
      Send a request to stop the periodic status report.
      Returns:
    • shutdown

      public void shutdown()
      Closes the SLE connection (does not send any unbind or stop first).

    • checkUnbound

      protected void checkUnbound()
    • processBindInvocation

      protected void processBindInvocation(SleBindInvocation bindInvocation)
    • processUnbindInvocation

      protected void processUnbindInvocation(SleUnbindInvocation unbindInvocation)
    • processStopReturn

      protected void processStopReturn(SleAcknowledgement stopReturn)
    • peerAbort

      protected void peerAbort()
    • getNonBindCredentials

      protected Credentials getNonBindCredentials()
    • verifyNonBindCredentials

      protected void verifyNonBindCredentials(Credentials credentials)
    • verifyBindCredentials

      protected void verifyBindCredentials(Credentials credentials)
    • getInvokeId

      protected InvokeId getInvokeId()
    • getFuture

      protected <T> CompletableFuture<T> getFuture(InvokeId invokeId)
    • changeState

      protected void changeState(State newState)
    • getInvokeId

      protected InvokeId getInvokeId(CompletableFuture<?> cf)
    • 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()
    • getState

      public State getState()
    • getApplicationIdentifier

      protected abstract Constants.ApplicationIdentifier getApplicationIdentifier()
    • processData

      protected abstract void processData(com.beanit.jasn1.ber.BerTag berTag, InputStream is) throws IOException
      Throws:
      IOException