Class NettyClientServerCommunicationSystemClientSide

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ReplyReceiver trr  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void channelActive​(io.netty.channel.ChannelHandlerContext ctx)  
      void channelInactive​(io.netty.channel.ChannelHandlerContext ctx)  
      void channelRead0​(io.netty.channel.ChannelHandlerContext ctx, TOMMessage sm)  
      void channelUnregistered​(io.netty.channel.ChannelHandlerContext ctx)  
      void close()  
      io.netty.channel.ChannelFuture connectToReplica​(int replicaId, javax.crypto.SecretKeyFactory fac)
      Tulio Ribeiro Connect to specific replica and returns the ChannelFuture.
      void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)  
      void reconnect​(io.netty.channel.ChannelHandlerContext ctx)  
      void removeClient​(int clientId)  
      void send​(boolean sign, int[] targets, TOMMessage sm)  
      void setReplyReceiver​(ReplyReceiver trr)  
      void sign​(TOMMessage sm)  
      byte[] signMessage​(java.security.PrivateKey key, byte[] message)  
      void updateConnections()  
      • Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

        acceptInboundMessage, channelRead
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelReadComplete, channelRegistered, channelWritabilityChanged, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Constructor Detail

      • NettyClientServerCommunicationSystemClientSide

        public NettyClientServerCommunicationSystemClientSide​(int clientId,
                                                              ClientViewController controller)
    • Method Detail

      • exceptionCaught

        public void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx,
                                    java.lang.Throwable cause)
                             throws java.lang.Exception
        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
        Throws:
        java.lang.Exception
      • channelRead0

        public void channelRead0​(io.netty.channel.ChannelHandlerContext ctx,
                                 TOMMessage sm)
                          throws java.lang.Exception
        Specified by:
        channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<TOMMessage>
        Throws:
        java.lang.Exception
      • channelActive

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

        public void reconnect​(io.netty.channel.ChannelHandlerContext ctx)
      • signMessage

        public byte[] signMessage​(java.security.PrivateKey key,
                                  byte[] message)
      • channelUnregistered

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

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

        public io.netty.channel.ChannelFuture connectToReplica​(int replicaId,
                                                               javax.crypto.SecretKeyFactory fac)
                                                        throws java.security.NoSuchAlgorithmException,
                                                               java.security.spec.InvalidKeySpecException,
                                                               java.security.InvalidKeyException
        Tulio Ribeiro Connect to specific replica and returns the ChannelFuture. sessionClientToReplica is replaced with the new connection. Removed redundant code.
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.spec.InvalidKeySpecException
        java.security.InvalidKeyException
      • removeClient

        public void removeClient​(int clientId)