com.streamhub.client
Enum FailoverAlgorithm

java.lang.Object
  extended by java.lang.Enum<FailoverAlgorithm>
      extended by com.streamhub.client.FailoverAlgorithm
All Implemented Interfaces:
Serializable, Comparable<FailoverAlgorithm>

public enum FailoverAlgorithm
extends Enum<FailoverAlgorithm>

The failover algorithm to use when choosing a server to failover to.

See Also:
FailoverParameters}

Enum Constant Summary
ORDERED
          The servers will be tried in order from top to bottom.
PRIORITY
          The first server in the failover list will always be tried upon each connection lost.
RANDOM
          A failover server wil be chosen at random.
 
Method Summary
 String toString()
           
static FailoverAlgorithm valueOf(String name)
          Returns the enum constant of this type with the specified name.
static FailoverAlgorithm[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ORDERED

public static final FailoverAlgorithm ORDERED
The servers will be tried in order from top to bottom.


PRIORITY

public static final FailoverAlgorithm PRIORITY
The first server in the failover list will always be tried upon each connection lost. This algorithm favours servers higher up the list.


RANDOM

public static final FailoverAlgorithm RANDOM
A failover server wil be chosen at random.

Method Detail

values

public static final FailoverAlgorithm[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(FailoverAlgorithm c : FailoverAlgorithm.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static FailoverAlgorithm valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

toString

public String toString()
Overrides:
toString in class Enum<FailoverAlgorithm>


Copyright © 2009 StreamHub. Tutorials, news and guides can be found on the StreamHub Comet Blog.