me.prettyprint.cassandra.connection
Class ConnectionManagerEmptyListener

java.lang.Object
  extended by me.prettyprint.cassandra.connection.ConnectionManagerEmptyListener
All Implemented Interfaces:
Serializable, ConnectionManagerListener

public abstract class ConnectionManagerEmptyListener
extends Object
implements ConnectionManagerListener

an Empty implementation of ConnectionManagerListener can be extended if you need only some of the events

Author:
Elyran Kogan
See Also:
Serialized Form

Constructor Summary
ConnectionManagerEmptyListener()
           
 
Method Summary
 String getName()
           
 void onAddHost(CassandraHost cassandraHost, boolean added, String errorMessage, Exception e)
          fires when an action to add CassandraHost was triggered
 void onAllHostsDown()
          fires when the CassandraHostRetryService detects that all nodes are down CassandraHostRetryService must be enabled for this event to fire
 void onHostDown(CassandraHost cassandraHost)
          fires when a CassandraHost was detected as down
 void onHostRestored(CassandraHost cassandraHost)
          fires when a CassandraHost was restored by the CassandraHostRetryService CassandraHostRetryService must be enabled for this event to fire
 void onRemoveHost(CassandraHost cassandraHost, boolean removed, String message)
          fires when an action to remove CassandraHost was triggered
 void onSuspendHost(CassandraHost cassandraHost, boolean removed)
          fired when a suspend action was triggered on the host
 void onUnSuspendHost(CassandraHost cassandraHost, boolean readded)
          fired when an un-suspend action was triggered on the host
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionManagerEmptyListener

public ConnectionManagerEmptyListener()
Method Detail

onHostDown

public void onHostDown(CassandraHost cassandraHost)
Description copied from interface: ConnectionManagerListener
fires when a CassandraHost was detected as down

Specified by:
onHostDown in interface ConnectionManagerListener
Parameters:
cassandraHost - - the host that was detected as down

onHostRestored

public void onHostRestored(CassandraHost cassandraHost)
Description copied from interface: ConnectionManagerListener
fires when a CassandraHost was restored by the CassandraHostRetryService CassandraHostRetryService must be enabled for this event to fire

Specified by:
onHostRestored in interface ConnectionManagerListener
Parameters:
cassandraHost - - the restored host

onAllHostsDown

public void onAllHostsDown()
Description copied from interface: ConnectionManagerListener
fires when the CassandraHostRetryService detects that all nodes are down CassandraHostRetryService must be enabled for this event to fire

Specified by:
onAllHostsDown in interface ConnectionManagerListener

onSuspendHost

public void onSuspendHost(CassandraHost cassandraHost,
                          boolean removed)
Description copied from interface: ConnectionManagerListener
fired when a suspend action was triggered on the host

Specified by:
onSuspendHost in interface ConnectionManagerListener
Parameters:
cassandraHost - - the host to be suspended
removed - - true if was successfully suspended

onUnSuspendHost

public void onUnSuspendHost(CassandraHost cassandraHost,
                            boolean readded)
Description copied from interface: ConnectionManagerListener
fired when an un-suspend action was triggered on the host

Specified by:
onUnSuspendHost in interface ConnectionManagerListener
Parameters:
cassandraHost - - the host to be un-suspended
readded - - true if was successfully un-suspended

onAddHost

public void onAddHost(CassandraHost cassandraHost,
                      boolean added,
                      String errorMessage,
                      Exception e)
Description copied from interface: ConnectionManagerListener
fires when an action to add CassandraHost was triggered

Specified by:
onAddHost in interface ConnectionManagerListener
Parameters:
cassandraHost - - the host to add
added - - true if added successfully
errorMessage - - the message in case of an error (can be null otherwise)
e - - exception when trying to add

onRemoveHost

public void onRemoveHost(CassandraHost cassandraHost,
                         boolean removed,
                         String message)
Description copied from interface: ConnectionManagerListener
fires when an action to remove CassandraHost was triggered

Specified by:
onRemoveHost in interface ConnectionManagerListener
Parameters:
cassandraHost - - the host to remove
removed - - true if successfully removed
message - - the message received with the action

getName

public String getName()
Specified by:
getName in interface ConnectionManagerListener
Returns:
the name of the listener


Copyright © 2012. All Rights Reserved.