Class CATransport

    • Field Detail

      • responseHandler

        protected ResponseHandler responseHandler
        CA reponse handler.
      • priority

        protected short priority
        Process priority.
    • Constructor Detail

      • CATransport

        public CATransport​(CAJContext context,
                           TransportClient client,
                           ResponseHandler responseHandler,
                           SocketChannel channel,
                           short remoteTransportRevision,
                           short priority)
        Parameters:
        context -
        responseHandler -
        client -
        channel -
        remoteTransportRevision -
        priority -
    • Method Detail

      • close

        public void close​(boolean forced)
        Close connection.
        Parameters:
        forced - flag indicating if forced (e.g. forced disconnect) is required
      • acquire

        public boolean acquire​(TransportClient client)
        Acquires transport.
        Parameters:
        client - client (channel) acquiring the transport
        Returns:
        true if transport was granted, false otherwise.
      • release

        public void release​(TransportClient client)
        Releases transport.
        Parameters:
        client - client (channel) releasing the transport
      • setMinorRevision

        public void setMinorRevision​(short rev)
      • processRead

        protected void processRead()
        Process input (read) IO event. Alsp handles subscription flow control.
      • processRead

        protected void processRead​(ByteBuffer socketBuffer)
        Process input.
      • processWrite

        protected void processWrite()
        Process output (write) IO event.
      • updateUserName

        public void updateUserName()
        Sends client username message to the server. User name is taken from System property "user.name".
      • disableFlowControl

        protected void disableFlowControl()
        Disable flow control (enables events).
      • enableFlowControl

        protected void enableFlowControl()
        Enable flow control (disables events).
      • send

        public void send​(ByteBuffer buffer,
                         boolean asyncCloseOnError)
                  throws IOException
        Send a buffer through the transport. NOTE: TCP sent buffer/sending has to be synchronized.
        Parameters:
        buffer - buffer to be sent
        Throws:
        IOException
      • flush

        public boolean flush()
        Flush send buffer. ... by enabling SelectionKey.OP_WRITE and process in reactor.
        Specified by:
        flush in interface Transport
        Returns:
        true on success, false on failure.
        See Also:
        Transport.flush()
      • flushInternal

        public boolean flushInternal()
        Flush send buffer (blocks until flushed).
        Returns:
        success flag.
        See Also:
        Transport.flush()
      • beaconArrivalNotify

        public void beaconArrivalNotify()
        Beacon arrival.
      • echoNotify

        public void echoNotify()
        Called when echo request (state-of-health message) was responed.
      • changedTransport

        public void changedTransport()
        Changed transport (server restarted) notify.