org.opends.server.replication.plugin
Class ReplicationServerListener

java.lang.Object
  extended by org.opends.server.replication.plugin.ReplicationServerListener
All Implemented Interfaces:
ConfigurationAddListener<ReplicationServerCfg>, ConfigurationDeleteListener<ReplicationServerCfg>

public class ReplicationServerListener
extends java.lang.Object
implements ConfigurationAddListener<ReplicationServerCfg>, ConfigurationDeleteListener<ReplicationServerCfg>

This class is used to create and object that can register in the admin framework as a listener for changes, add and delete on the ReplicationServer configuration objects.


Constructor Summary
ReplicationServerListener(ReplicationSynchronizationProviderCfg configuration)
          Build a ReplicationServer Listener from the given Multimaster configuration.
 
Method Summary
 ConfigChangeResult applyConfigurationAdd(ReplicationServerCfg configuration)
          Adds a new configuration to this add listener.
 ConfigChangeResult applyConfigurationDelete(ReplicationServerCfg configuration)
          Deletes an existing configuration from this delete listener.
 ReplicationServer getReplicationServer()
          Returns the associated Replication Server.
 boolean isConfigurationAddAcceptable(ReplicationServerCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed addition of a new configuration is acceptable to this add listener.
 boolean isConfigurationDeleteAcceptable(ReplicationServerCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed deletion of an existing configuration is acceptable to this delete listener.
 void shutdown()
          Shutdown the replication server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationServerListener

public ReplicationServerListener(ReplicationSynchronizationProviderCfg configuration)
                          throws ConfigException
Build a ReplicationServer Listener from the given Multimaster configuration.

Parameters:
configuration - The configuration that will be used to listen for replicationServer configuration changes.
Throws:
ConfigException - if the ReplicationServerListener can't register for listening to changes on the provided configuration object.
Method Detail

applyConfigurationAdd

public ConfigChangeResult applyConfigurationAdd(ReplicationServerCfg configuration)
Adds a new configuration to this add listener.

Specified by:
applyConfigurationAdd in interface ConfigurationAddListener<ReplicationServerCfg>
Parameters:
configuration - The configuration that will be added.
Returns:
Returns information about the result of adding the configuration.

isConfigurationAddAcceptable

public boolean isConfigurationAddAcceptable(ReplicationServerCfg configuration,
                                            java.util.List<Message> unacceptableReasons)
Indicates whether the proposed addition of a new configuration is acceptable to this add listener.

Specified by:
isConfigurationAddAcceptable in interface ConfigurationAddListener<ReplicationServerCfg>
Parameters:
configuration - The configuration that will be added.
unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
Returns:
Returns true if the proposed addition is acceptable, or false if it is not.

shutdown

public void shutdown()
Shutdown the replication server.


applyConfigurationDelete

public ConfigChangeResult applyConfigurationDelete(ReplicationServerCfg configuration)
Deletes an existing configuration from this delete listener.

Specified by:
applyConfigurationDelete in interface ConfigurationDeleteListener<ReplicationServerCfg>
Parameters:
configuration - The existing configuration that will be deleted.
Returns:
Returns information about the result of deleting the configuration.

isConfigurationDeleteAcceptable

public boolean isConfigurationDeleteAcceptable(ReplicationServerCfg configuration,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed deletion of an existing configuration is acceptable to this delete listener.

Specified by:
isConfigurationDeleteAcceptable in interface ConfigurationDeleteListener<ReplicationServerCfg>
Parameters:
configuration - The configuration that will be deleted.
unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
Returns:
Returns true if the proposed deletion is acceptable, or false if it is not.

getReplicationServer

public ReplicationServer getReplicationServer()
Returns the associated Replication Server.

Returns:
The replication server.