com.datastax.driver.core

## Interface SchemaChangeListener

• All Known Implementing Classes:
SchemaChangeListenerBase

public interface SchemaChangeListener
Interface for objects that are interested in tracking schema change events in the cluster.

An implementation of this interface can be registered against a Cluster object through the Cluster.register(SchemaChangeListener) method.

Note that the methods defined by this interface will be executed by internal driver threads, and are therefore expected to have short execution times. If you need to perform long computations or blocking calls in response to schema change events, it is strongly recommended to schedule them asynchronously on a separate thread provided by your application code.

• ### Method Summary

All Methods
Modifier and Type Method and Description
void onAggregateAdded(AggregateMetadata aggregate)
Called when a user-defined aggregate has been added.
void onAggregateChanged(AggregateMetadata current, AggregateMetadata previous)
Called when a user-defined aggregate has changed.
void onAggregateRemoved(AggregateMetadata aggregate)
Called when a user-defined aggregate has been removed.
void onFunctionAdded(FunctionMetadata function)
Called when a user-defined function has been added.
void onFunctionChanged(FunctionMetadata current, FunctionMetadata previous)
Called when a user-defined function has changed.
void onFunctionRemoved(FunctionMetadata function)
Called when a user-defined function has been removed.
void onKeyspaceAdded(KeyspaceMetadata keyspace)
Called when a keyspace has been added.
void onKeyspaceChanged(KeyspaceMetadata current, KeyspaceMetadata previous)
Called when a keyspace has changed.
void onKeyspaceRemoved(KeyspaceMetadata keyspace)
Called when a keyspace has been removed.
void onMaterializedViewAdded(MaterializedViewMetadata view)
Called when a materialized view has been added.
void onMaterializedViewChanged(MaterializedViewMetadata current, MaterializedViewMetadata previous)
Called when a materialized view has changed.
void onMaterializedViewRemoved(MaterializedViewMetadata view)
Called when a materialized view has been removed.
void onRegister(Cluster cluster)
Gets invoked when the listener is registered with a cluster.
void onTableAdded(TableMetadata table)
Called when a table has been added.
void onTableChanged(TableMetadata current, TableMetadata previous)
Called when a table has changed.
void onTableRemoved(TableMetadata table)
Called when a table has been removed.
void onUnregister(Cluster cluster)
Gets invoked when the listener is unregistered from a cluster, or at cluster shutdown if the tracker was not unregistered.
void onUserTypeAdded(UserType type)
Called when a user-defined type has been added.
void onUserTypeChanged(UserType current, UserType previous)
Called when a user-defined type has changed.
void onUserTypeRemoved(UserType type)
Called when a user-defined type has been removed.
• ### Method Detail

void onKeyspaceAdded(KeyspaceMetadata keyspace)
Called when a keyspace has been added.
Parameters:
keyspace - the keyspace that has been added.
• #### onKeyspaceRemoved

void onKeyspaceRemoved(KeyspaceMetadata keyspace)
Called when a keyspace has been removed.
Parameters:
keyspace - the keyspace that has been removed.
• #### onKeyspaceChanged

void onKeyspaceChanged(KeyspaceMetadata current,
KeyspaceMetadata previous)
Called when a keyspace has changed.
Parameters:
current - the keyspace that has changed, in its current form (after the change).
previous - the keyspace that has changed, in its previous form (before the change).

void onTableAdded(TableMetadata table)
Called when a table has been added.
Parameters:
table - the table that has been newly added.
• #### onTableRemoved

void onTableRemoved(TableMetadata table)
Called when a table has been removed.
Parameters:
table - the table that has been removed.
• #### onTableChanged

void onTableChanged(TableMetadata current,
TableMetadata previous)
Called when a table has changed.
Parameters:
current - the table that has changed, in its current form (after the change).
previous - the table that has changed, in its previous form (before the change).

void onUserTypeAdded(UserType type)
Called when a user-defined type has been added.
Parameters:
type - the type that has been newly added.
• #### onUserTypeRemoved

void onUserTypeRemoved(UserType type)
Called when a user-defined type has been removed.
Parameters:
type - the type that has been removed.
• #### onUserTypeChanged

void onUserTypeChanged(UserType current,
UserType previous)
Called when a user-defined type has changed.
Parameters:
current - the type that has changed, in its current form (after the change).
previous - the type that has changed, in its previous form (before the change).

void onFunctionAdded(FunctionMetadata function)
Called when a user-defined function has been added.
Parameters:
function - the function that has been newly added.
• #### onFunctionRemoved

void onFunctionRemoved(FunctionMetadata function)
Called when a user-defined function has been removed.
Parameters:
function - the function that has been removed.
• #### onFunctionChanged

void onFunctionChanged(FunctionMetadata current,
FunctionMetadata previous)
Called when a user-defined function has changed.
Parameters:
current - the function that has changed, in its current form (after the change).
previous - the function that has changed, in its previous form (before the change).

void onAggregateAdded(AggregateMetadata aggregate)
Called when a user-defined aggregate has been added.
Parameters:
aggregate - the aggregate that has been newly added.
• #### onAggregateRemoved

void onAggregateRemoved(AggregateMetadata aggregate)
Called when a user-defined aggregate has been removed.
Parameters:
aggregate - the aggregate that has been removed.
• #### onAggregateChanged

void onAggregateChanged(AggregateMetadata current,
AggregateMetadata previous)
Called when a user-defined aggregate has changed.
Parameters:
current - the aggregate that has changed, in its current form (after the change).
previous - the aggregate that has changed, in its previous form (before the change).

void onMaterializedViewAdded(MaterializedViewMetadata view)
Called when a materialized view has been added.
Parameters:
view - the materialized view that has been newly added.
• #### onMaterializedViewRemoved

void onMaterializedViewRemoved(MaterializedViewMetadata view)
Called when a materialized view has been removed.
Parameters:
view - the materialized view that has been removed.
• #### onMaterializedViewChanged

void onMaterializedViewChanged(MaterializedViewMetadata current,
MaterializedViewMetadata previous)
Called when a materialized view has changed.
Parameters:
current - the materialized view that has changed, in its current form (after the change).
previous - the materialized view that has changed, in its previous form (before the change).
• #### onRegister

void onRegister(Cluster cluster)
Gets invoked when the listener is registered with a cluster.
Parameters:
cluster - the cluster that this tracker is registered with.
• #### onUnregister

void onUnregister(Cluster cluster)
Gets invoked when the listener is unregistered from a cluster, or at cluster shutdown if the tracker was not unregistered.
Parameters:
cluster - the cluster that this tracker was registered with.