### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.connection

# Class Cluster

java.lang.Object
com.sas.services.connection.Cluster

All Implemented Interfaces:
  `Serializable`, `Cloneable`

Direct Known Subclasses:
  `FailoverCluster`, `LoadBalancingCluster`

@SASScope("ALL") @BinaryCompatibilityOnly public abstract class Cluster extends Object implements Cloneable, Serializable
A base class representing a cluster of IOM servers.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `TYPE_FAILOVER`
  Flag for failover clusters.
  `static final int`
  `TYPE_LOAD_BALANCING`
  Flag for load-balancing clusters.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Cluster(Server[] serverArray)`
  Construct a cluster of IOM servers.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `protected abstract int`
  `computeMaxClients()`
  `boolean`
  `equals(Object that)`
  `String`
  `getClassID()`
  Get the class ID of the servers in this cluster.
  `abstract int`
  `getClusterType()`
  Get the cluster type.
  `String`
  `getDomain()`
  Get the domain of the servers in this cluster.
  `static Cluster`
  `getInstance(Server[] servers, int clusterType)`
  Construct and return a cluster of IOM servers.
  `int`
  `getMaxClients()`
  Get the maximum number of clients this cluster can support at one time.
  `Server[]`
  `getServerArray()`
  Get the array of servers that have been added to the cluster.
  `int`
  `hashCode()`
  `void`
  `setServerArray(Server[] serverArray)`
  Set the array of servers in the cluster.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### TYPE_LOAD_BALANCING

    public static final int TYPE_LOAD_BALANCING
    Flag for load-balancing clusters. A load-balancing cluster is implemented with a IOM Object Spawner that monitors the load of a set of redundant servers and directs requests for new connections to the least loaded server.
    See Also:
      - Constant Field Values

  - ### TYPE_FAILOVER

    public static final int TYPE_FAILOVER
    Flag for failover clusters. A failover cluster is a set of redundant servers. The connection factory will attempt to connect to one of them, and, if that server is not available it will try another server in the cluster. The factory will raise an exception only if none of the servers in the cluster are available at the time of a connection request.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Cluster

    protected Cluster(Server[] serverArray)
    Construct a cluster of IOM servers.
    Parameters:
      `serverArray` - the servers to add to the cluster.

- ## Method Details

  - ### getInstance

    public static Cluster getInstance(Server[] servers, int clusterType)
    Construct and return a cluster of IOM servers.
    Parameters:
      `servers` - the servers to add to the cluster.
      `clusterType` - the cluster type
    See Also:
      - `TYPE_FAILOVER`
      - `TYPE_LOAD_BALANCING`

  - ### setServerArray

    public void setServerArray(Server[] serverArray)
    Set the array of servers in the cluster.
    Parameters:
      `serverArray` - the array of servers to add to the cluster

  - ### getServerArray

    public Server[] getServerArray()
    Get the array of servers that have been added to the cluster.
    Returns:
      the array of servers that have been added to the cluster

  - ### getClusterType

    public abstract int getClusterType()
    Get the cluster type.
    Returns:
      the cluster type
    See Also:
      - `TYPE_FAILOVER`
      - `TYPE_LOAD_BALANCING`

  - ### getClassID

    public String getClassID()
    Get the class ID of the servers in this cluster. All servers in a cluster must have the same class ID.
    Returns:
      the class ID of the servers in this cluster

  - ### getDomain

    public String getDomain()
    Get the domain of the servers in this cluster. All servers in a cluster must have the same domain.
    Returns:
      the domain of the servers in this cluster

  - ### getMaxClients

    public int getMaxClients()
    Get the maximum number of clients this cluster can support at one time. If this is a load balancing cluster, then this value is the sum of maxClients for all servers in the cluster. If this is a fail over cluster, then this value is equal to the smallest value of maxClients for all servers in the cluster.
    Returns:
      the maximum number of clients this cluster can support at one time

  - ### equals

    public boolean equals(Object that)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### clone

    public Object clone()
    Overrides:
      `clone` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### computeMaxClients

    protected abstract int computeMaxClients()