me.prettyprint.cassandra.connection
Interface ConnectionManagerListener

All Superinterfaces:
Serializable
All Known Implementing Classes:
ConnectionManagerEmptyListener

public interface ConnectionManagerListener
extends Serializable

Listener for the status of CassandraHosts in order to use it - simply implement it and apply your own actions on the events Use HConnectionManager.addListener(String, ConnectionManagerListener) You can also extend the empty implementation ConnectionManagerEmptyListener if you only need some of the events

Author:
Elyran Kogan

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
 

Method Detail

onHostDown

void onHostDown(CassandraHost cassandraHost)
fires when a CassandraHost was detected as down

Parameters:
cassandraHost - - the host that was detected as down

onHostRestored

void onHostRestored(CassandraHost cassandraHost)
fires when a CassandraHost was restored by the CassandraHostRetryService CassandraHostRetryService must be enabled for this event to fire

Parameters:
cassandraHost - - the restored host

onAllHostsDown

void onAllHostsDown()
fires when the CassandraHostRetryService detects that all nodes are down CassandraHostRetryService must be enabled for this event to fire


onSuspendHost

void onSuspendHost(CassandraHost cassandraHost,
                   boolean removed)
fired when a suspend action was triggered on the host

Parameters:
cassandraHost - - the host to be suspended
removed - - true if was successfully suspended

onUnSuspendHost

void onUnSuspendHost(CassandraHost cassandraHost,
                     boolean readded)
fired when an un-suspend action was triggered on the host

Parameters:
cassandraHost - - the host to be un-suspended
readded - - true if was successfully un-suspended

onAddHost

void onAddHost(CassandraHost cassandraHost,
               boolean added,
               String errorMessage,
               Exception e)
fires when an action to add CassandraHost was triggered

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

void onRemoveHost(CassandraHost cassandraHost,
                  boolean removed,
                  String message)
fires when an action to remove CassandraHost was triggered

Parameters:
cassandraHost - - the host to remove
removed - - true if successfully removed
message - - the message received with the action

getName

String getName()
Returns:
the name of the listener


Copyright © 2013. All Rights Reserved.