Class MultiConnectionListener.MultiConnectionListenerBase

java.lang.Object
com.streambase.liveview.client.MultiConnectionListener.MultiConnectionListenerBase
All Implemented Interfaces:
MultiConnectionListener
Enclosing interface:
MultiConnectionListener

public static class MultiConnectionListener.MultiConnectionListenerBase extends Object implements MultiConnectionListener
When implmenting MultiConnectionListener, if you extend this base class you'll have version protection. If any methods are added to the interface, then a nop method will also be added to this base class.
  • Constructor Details

    • MultiConnectionListenerBase

      public MultiConnectionListenerBase()
  • Method Details

    • smoothFailover

      public void smoothFailover(LiveViewConnectionControl failedConnection, LiveViewConnectionControl connection)
      Description copied from interface: MultiConnectionListener
      This will be called if the current server has failed, but there is already another server ready to fail over to. This will be called just before the process of resubmitting all the queries to the new primary server. If you do not want the queries to be resubmitted, you can close all the queries before returning from this call. This method exists as a convenience to UI developers. Note that we could simply have connectionLost, perhaps with an isCurrent flag, followed by a connectionEstablished, but how is the UI to know what to do during the connectionLost event? At that point he wants to put up a serious message to the user if there is not going to be an immediate connectionEstablished but he doesn't want to put anything up if there is already another connection made and ready to take over.
      Specified by:
      smoothFailover in interface MultiConnectionListener
      Parameters:
      failedConnection - the connection that was lost, which was the current connection
      connection - the new current connection, which is already up and running
    • roughFailover

      public void roughFailover(LiveViewConnectionControl failedConnection)
      Description copied from interface: MultiConnectionListener
      This will be called if the current server has failed and there is no other server currently connected to fail over to. The system is already trying to connect to other servers in the list. However, it will not resubmit any queries until this call has completed. If you do not want the queries to be resubmitted, you can close all the queries before returning from this call.
      Specified by:
      roughFailover in interface MultiConnectionListener
    • connectionEstablished

      public void connectionEstablished(LiveViewConnectionControl connection, boolean isCurrent)
      Description copied from interface: MultiConnectionListener
      This will be called whenever any connection succeeds, including the very first one. After a roughFailover, the first server to which a successful connection is made will become the primary, and any active queries will be resubmitted to it.
      Specified by:
      connectionEstablished in interface MultiConnectionListener
      isCurrent - true if this is now the current connection.
    • secondaryConnectionLost

      public void secondaryConnectionLost(LiveViewConnectionControl lostConnection)
      Description copied from interface: MultiConnectionListener
      This will be called when one of the secondary connections has been lost. Since the primary connection is still working fine this is just for information. Nothing will happen to any ongoing queries.
      Specified by:
      secondaryConnectionLost in interface MultiConnectionListener
    • reconnectFailed

      public void reconnectFailed(LiveViewConnectionControl failedConnection, int failureCount)
      Description copied from interface: MultiConnectionListener
      This will be called when any attempt to make a connection fails. Note that this is, by definition, not the primary connection, because it was already known to be in a failed state. That is, you would already have received a smoothFailover or roughFailover call if this used to be the primary connection, or you would already have received a secondaryConnectionLost if this used to be a successful secondary connection. Or you might never have connected to this server, yet.
      Specified by:
      reconnectFailed in interface MultiConnectionListener
      failureCount - The number of times we have tried and failed to connect to this Connection, since the last successful connection to it (or since startup, if we have never successfully connected to it).