org.neo4j.kernel.ha.cluster
Enum HighAvailabilityMemberState

java.lang.Object
  extended by java.lang.Enum<HighAvailabilityMemberState>
      extended by org.neo4j.kernel.ha.cluster.HighAvailabilityMemberState
All Implemented Interfaces:
Serializable, Comparable<HighAvailabilityMemberState>

public enum HighAvailabilityMemberState
extends Enum<HighAvailabilityMemberState>

This represents the different states that a cluster member can have internally.


Enum Constant Summary
MASTER
          Cluster member is available as master for other cluster members to use.
PENDING
          This state is the initial state, and is also the state used when leaving the cluster.
SLAVE
          Cluster member is ready as a slave
TO_MASTER
          The cluster member knows that it has been elected as master, and starts the transitioning process.
TO_SLAVE
          Member now knows that a master is available, and is transitioning itself to become a slave to that master.
 
Method Summary
abstract  boolean isAccessAllowed(HighAvailabilityMemberContext context)
           
abstract  HighAvailabilityMemberState masterIsAvailable(HighAvailabilityMemberContext context, URI masterClusterUri, URI masterHaURI)
           
abstract  HighAvailabilityMemberState masterIsElected(HighAvailabilityMemberContext context, URI masterUri)
           
abstract  HighAvailabilityMemberState slaveIsAvailable(HighAvailabilityMemberContext context, URI slaveUri)
           
static HighAvailabilityMemberState valueOf(String name)
          Returns the enum constant of this type with the specified name.
static HighAvailabilityMemberState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PENDING

public static final HighAvailabilityMemberState PENDING
This state is the initial state, and is also the state used when leaving the cluster.

Here we are waiting for events that transitions this member either to becoming a master or slave.


TO_SLAVE

public static final HighAvailabilityMemberState TO_SLAVE
Member now knows that a master is available, and is transitioning itself to become a slave to that master. It is performing the transition process here, and so is not yet available as a slave.


TO_MASTER

public static final HighAvailabilityMemberState TO_MASTER
The cluster member knows that it has been elected as master, and starts the transitioning process.


MASTER

public static final HighAvailabilityMemberState MASTER
Cluster member is available as master for other cluster members to use.


SLAVE

public static final HighAvailabilityMemberState SLAVE
Cluster member is ready as a slave

Method Detail

values

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

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

valueOf

public static HighAvailabilityMemberState 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
NullPointerException - if the argument is null

masterIsElected

public abstract HighAvailabilityMemberState masterIsElected(HighAvailabilityMemberContext context,
                                                            URI masterUri)

masterIsAvailable

public abstract HighAvailabilityMemberState masterIsAvailable(HighAvailabilityMemberContext context,
                                                              URI masterClusterUri,
                                                              URI masterHaURI)

slaveIsAvailable

public abstract HighAvailabilityMemberState slaveIsAvailable(HighAvailabilityMemberContext context,
                                                             URI slaveUri)

isAccessAllowed

public abstract boolean isAccessAllowed(HighAvailabilityMemberContext context)


Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.