Interface JICPMediator

    • Method Detail

      • getID

        String getID()
        Retrieve the ID of this mediator
      • kill

        void kill()
        Kill this JICPMediator
      • handleIncomingConnection

        boolean handleIncomingConnection​(Connection c,
                                         JICPPacket pkt,
                                         InetAddress addr,
                                         int port)
        Passes to this JICPMediator the connection opened by the mediated entity. This is called by the JICPServer this Mediator is attached to as soon as the mediated entity (re)connects.
        Parameters:
        c - the connection to the mediated entity
        pkt - the packet that was sent by the mediated entity when opening this connection
        addr - the address of the mediated entity
        port - the local port used by the mediated entity
        Returns:
        an indication to the JICPMediatorManager to keep the connection open.
      • handleJICPPacket

        JICPPacket handleJICPPacket​(JICPPacket p,
                                    InetAddress addr,
                                    int port)
                             throws ICPException
        Passes to this JICPMediator a JICP packet. This is called by the JICPServer this Mediator is attached to when a JICPPacket is received having the recipient-ID field set to the ID of this JICPMediator.
        Parameters:
        p - the JICPPacket
        addr - the address of the mediated entity
        port - the local port used by the mediated entity
        Throws:
        ICPException
      • tick

        void tick​(long time)
        This is periodically called by the JICPMediatorManager and should be used by a JICPMediator to evaluate the elapsed time without the need of a dedicated thread or timer.