com.ibm.websphere.collective.repository

Interface RepositoryConfigurationMBean



  • public interface RepositoryConfigurationMBean
    RepositoryConfigurationMBean defines the administrative interface for replica set configuration.

    The ObjectName for this MBean is "WebSphere:feature=collectiveController,type=RepositoryConfiguration,name=RepositoryConfiguration".

    Replicas may be added and removed from a live replica set. Additionally, the entire replica set may be redefined, as long as one of the replicas in the previous set exists in the new set.

    All endpoints specified to this MBean expect the replicaHost and replicaPort values defined in the server.xml of each replica. For example:

     <collectiveController replicaHost="localhost" replicaPort="10011" />
     
    The endpoint would be "localhost:10011".
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String OBJECT_NAME
      A String representing the ObjectName that this MBean maps to.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean addReplica(java.lang.String endpoint)
      Adds a replica endpoint to the active replica set.
      java.util.Set<java.lang.String> getActiveReplicas()
      This method returns the active replicas as Set
      java.util.Set<java.util.Map<java.lang.String,java.lang.String>> getAllReplicas()
      This method returns the union of the active set, the standby set, and the configured set as set of Map
      java.util.Set<java.lang.String> getConfiguredReplicas()
      This method returns the configured replicas as Set
      java.lang.String getReplicaId()
      This method returns the ID of the current replica
      java.util.Set<java.lang.String> getStandbyReplicas()
      This method returns the standby replicas as Set
      boolean reconfigureReplicas(java.lang.String endpoints)
      Redefines the active replica set.
      boolean removeReplica(java.lang.String endpoint)
      Removes a replica endpoint from the existing active replica set.
    • Field Detail

      • OBJECT_NAME

        static final java.lang.String OBJECT_NAME
        A String representing the ObjectName that this MBean maps to.
        See Also:
        Constant Field Values
    • Method Detail

      • getConfiguredReplicas

        java.util.Set<java.lang.String> getConfiguredReplicas()
                                                              throws java.io.IOException,
                                                                     java.lang.IllegalArgumentException,
                                                                     java.lang.IllegalStateException
        This method returns the configured replicas as Set

        A replica gets into this set:

        • Automatically when it is in the initial replica set in the configuration
        • When the "addReplica" command is invoked after the replica has been started
        A replica gets out this set when:
        • "removeReplica" command is invoked
        This set includes the active set and stopped/unreachable added replicas
        Returns:
        A copy of configured in the form of a set of Strings of the endpoints "replica_hostname:replicaPort". Returns an empty list if there are no configured endpoints.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
      • getActiveReplicas

        java.util.Set<java.lang.String> getActiveReplicas()
                                                          throws java.io.IOException,
                                                                 java.lang.IllegalArgumentException,
                                                                 java.lang.IllegalStateException
        This method returns the active replicas as Set

        A replica gets into this set:

        • Automatically when it is in the initial replica set in the configuration
        • When the "addReplica" command is invoked after the replica has been started
        A replica gets out this set when:
        • "removeReplica" command is invoked
        • The server is stopped or unreachable
        This set is also part of the configured set
        Returns:
        A copy of the active in the form of a set of Strings of the endpoints in the form "replica_hostname:replicaPort". Returns an empty list if there are no active endpoints.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
      • getStandbyReplicas

        java.util.Set<java.lang.String> getStandbyReplicas()
                                                           throws java.io.IOException,
                                                                  java.lang.IllegalArgumentException,
                                                                  java.lang.IllegalStateException
        This method returns the standby replicas as Set

        A replica gets into this set when:

        • It is started out of the configuration
        • It was removed (while running) using "removeReplica
        A replica gets out this set when:
        • "addReplica" command is invoked
        • The server is stopped or unreachable
        Returns:
        list of endpoint Strings of the form "replica_hostname:replicaPort". Returns an empty list if there are no standby endpoints.
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
      • getAllReplicas

        java.util.Set<java.util.Map<java.lang.String,java.lang.String>> getAllReplicas()
                                                                                       throws java.io.IOException,
                                                                                              java.lang.IllegalArgumentException,
                                                                                              java.lang.IllegalStateException
        This method returns the union of the active set, the standby set, and the configured set as set of Map

        This method assigns values of endpoint, status(STARTED/STOPPED), standby(TRUE/FALSE) to all of the replicas

        Returns:
        a set of the union of the active set, the standby set, and the configured set
        Throws:
        java.io.IOException
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
      • addReplica

        boolean addReplica(java.lang.String endpoint)
                           throws java.io.IOException,
                                  java.lang.IllegalArgumentException,
                                  java.net.UnknownHostException,
                                  java.lang.IllegalStateException
        Adds a replica endpoint to the active replica set.

        Only endpoints that are part of the stand-by set can be added. If the endpoint is not part of the active or stand-by replica sets, then an IllegalStateException will be thrown. If the endpoint is already part of the active replica set, then no change will be made and false will be returned.

        If the endpoint is malformed, an IllegalArgumentException will be thrown.

        Parameters:
        endpoint - The identifier for a replica in the form "host:port".
        Returns:
        true if the replica endpoint was added, false if the replica endpoint was already part of the set
        Throws:
        java.io.IOException - If there was a problem completing the request.
        java.lang.IllegalArgumentException - If the endpoint is not properly formatted. The input must be in the format "host:port".
        java.net.UnknownHostException - If the host specified in the endpoint cannot be resolved via DNS.
        java.lang.IllegalStateException - If the endpoint is properly formatted but it is not part of the stand-by or active replica set.
      • reconfigureReplicas

        boolean reconfigureReplicas(java.lang.String endpoints)
                                    throws java.io.IOException,
                                           java.lang.IllegalArgumentException,
                                           java.net.UnknownHostException
        Redefines the active replica set.

        The new active replica set will be comprised solely of the supplied endpoints. The replicas for reconfiguration are represented as a space delimited list endpoints. Only endpoints that are part of the active or stand-by replica sets can be specified. If the endpoints are not part of the active or stand-by replica sets, then an IllegalStateException will be thrown.

        If any of endpoints are malformed, an IllegalArgumentException will be thrown.

        Parameters:
        endpoints - A space delimited list of the replicas of the reconfigured replica set in the form "host:port host:port".
        Returns:
        true if the replica reconfiguration was successful, false if the operation was not successful.
        Throws:
        java.io.IOException - If there was a problem completing the request.
        java.lang.IllegalArgumentException - If the endpoint is not properly formatted. The input must be in the format "host:port".
        java.net.UnknownHostException - If any of the hosts specified in the endpoints cannot be resolved via DNS.
        java.lang.IllegalStateException - If the endpoints are properly formatted but at least one is not part of the stand-by or active replica set.
      • removeReplica

        boolean removeReplica(java.lang.String endpoint)
                              throws java.io.IOException,
                                     java.lang.IllegalArgumentException,
                                     java.net.UnknownHostException
        Removes a replica endpoint from the existing active replica set.

        Only endpoints that are part of the configured replica set can be removed. If the endpoint is not part of the active replica set, then no change will be made and false will be returned.

        If the endpoint is malformed, an IllegalArgumentException will be thrown.

        Parameters:
        endpoint - The identifier for a replica in the form "host:port".
        Returns:
        true if the replica endpoint was removed, false if the endpoint was not part of the active replica set.
        Throws:
        java.io.IOException - If there was a problem completing the request.
        java.lang.IllegalArgumentException - If the endpoint is not properly formatted. The input must be in the format "host:port"
        java.net.UnknownHostException - If the host specified in the endpoint cannot be resolved via DNS.
      • getReplicaId

        java.lang.String getReplicaId()
        This method returns the ID of the current replica
        Returns:
        the current replica ID as a String in the format HOST:PORT