Interface ConnectionStatusListener

  • All Known Implementing Classes:
    ConnectionStatusPanel

    public interface ConnectionStatusListener
    Different from the ConnectionListener in the sense that this listener is intended for use in redundant setups, where the status of the inactive connection must be updated along with the status of the active connection.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void updateNodeRole​(java.lang.String newRole)
      Informs any listeners that the client's redundancy node role has changed.
      void updatePingTime​(java.lang.String nodeRole, java.lang.Double pingTime)
      Informs listeners about how long the last successful ping operation took to run against the Gateway..
      void updateStatus​(GatewayInterface gateway, java.lang.String nodeRole, int connectionStatus, java.lang.String projectState, java.lang.String additionalInfo)
      Expect this method to be called every few seconds by a timer in the AbstractGatewayConnection.
    • Method Detail

      • updateStatus

        void updateStatus​(GatewayInterface gateway,
                          java.lang.String nodeRole,
                          int connectionStatus,
                          java.lang.String projectState,
                          java.lang.String additionalInfo)
        Expect this method to be called every few seconds by a timer in the AbstractGatewayConnection. The timer continually tests the status of the master and backup connections. This method also gets fired when a connection changed event occurs for independent connections.
        Parameters:
        gateway - the Gateway address of the connection as a GatewayInterface
        nodeRole - the redundant node role. May be "Master", "Backup", or "" for independent connections.
        connectionStatus - one of the Status_* variables in AbstractGatewayConnection, representing the updated connection status.
        projectState - applies to redundant system and can be Unknown, Incompatible, OutOfDate, or Good as per the ProjectState enum. Pass in null for unknown project state or non-redundant systems.
        additionalInfo - any extra information that can be provided about the status. Connection events tend to have extra info, particularly when Exceptions have been thrown.
      • updateNodeRole

        void updateNodeRole​(java.lang.String newRole)
        Informs any listeners that the client's redundancy node role has changed. This affects the how connections are displayed (either Master/Backup mode or Independent mode). The new role could be "Master", "Backup" or "Independent".
        Parameters:
        newRole - Name of new role
      • updatePingTime

        void updatePingTime​(java.lang.String nodeRole,
                            java.lang.Double pingTime)
        Informs listeners about how long the last successful ping operation took to run against the Gateway..
        Parameters:
        nodeRole - the redundant node role. May be "Master", "Backup", or "" for independent connections.
        pingTime - the number of milliseconds that it took to run the ping. Pass Double.NAN to indicate an error occurred during the ping.