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

com.sas.services.connection
Class Cluster

com.sas.services.connection.Cluster
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
FailoverCluster, LoadBalancingCluster

public abstract class Cluster
implements java.lang.Cloneable, java.io.Serializable

A base class representing a cluster of IOM servers.

See Also:
Serialized Form

Field Summary
static int TYPE_FAILOVER
          Flag for failover clusters.
static int TYPE_LOAD_BALANCING
          Flag for load-balancing clusters.
 
Constructor Summary
protected Cluster(Server[] serverArray)
          Construct a cluster of IOM servers.
 
Method Summary
 java.lang.Object clone()
           
protected abstract  int computeMaxClients()
           
 boolean equals(java.lang.Object that)
           
 java.lang.String getClassID()
          Get the class ID of the servers in this cluster.
abstract  int getClusterType()
          Get the cluster type.
 java.lang.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.
 java.lang.String toString()
           
 

Field Detail

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 Detail

Cluster

protected Cluster(Server[] serverArray)
Construct a cluster of IOM servers.

Parameters:
serverArray - the servers to add to the cluster.
Method Detail

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 java.lang.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 java.lang.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(java.lang.Object that)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

computeMaxClients

protected abstract int computeMaxClients()

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.