org.exist.cluster
Class ClusterComunication

java.lang.Object
  extended by org.exist.cluster.ClusterComunication
All Implemented Interfaces:
MembershipListener

public class ClusterComunication
extends Object
implements MembershipListener

Manage the Cluster communication via RPC JGroups Created by Nicola Breda.

Author:
Nicola Breda aka maiale, David Frontini aka spider Date: 05-aug-2005 Time: 18.09.08 Revision $Revision: 6186 $

Field Summary
static String CLUSTER_EXCLUDED_COLLECTIONS_ATTRIBUTE
           
static String CLUSTER_PROTOCOL_ATTRIBUTE
           
static String CLUSTER_PWD_ATTRIBUTE
           
static String CLUSTER_USER_ATTRIBUTE
           
static String CONFIGURATION_ELEMENT_NAME
           
static String DEFAULT_PROTOCOL_STACK
           
static String PROPERTY_CLUSTER_EXCLUDED_COLLECTIONS
           
static String PROPERTY_CLUSTER_PROTOCOL
           
static String PROPERTY_CLUSTER_PWD
           
static String PROPERTY_CLUSTER_USER
           
 
Method Summary
 void addCollection(String parent, String collectionName)
           
 void block()
           
static void configure(Configuration c)
          Configure the cluster communication
 Address getAddress()
           
 Configuration getConfiguration()
           
 HashMap getConsoleInfos(Vector address)
           
 ConsoleInfo getConsoleProperties()
           
 Address getCoordinator()
           
static String getDbaPwd()
           
static String getDbaUser()
           
 int[][] getHeaders()
           
static ClusterComunication getInstance()
          ********** --------------------------------------------------------- **********
 Vector getMembersNoCoordinator()
           
 int[] getNextDataRemote(String address)
           
 ArrayList getNextEvents(int[] header, int[] myHeader, Integer start)
           
 int[] getRemoteHeader()
           
 void invoke(ClusterEvent event)
           
 boolean isCoordinator()
          ************** --------- CONSOLE METHODS ---------- *******************************
 void removeCollection(String parent, String collection)
           
 void removeDocument(String collection, String documentName)
           
 void stop()
           
 void storeDocument(String collection, String documentName, String content)
           
 void suspect(Address address)
           
 void synch()
           
 void update(String resource, String name, String xupdate)
           
 void viewAccepted(View view)
          ---------------- MEMBERSHIP LISTENER METHODS ------------------------------ ****
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_ELEMENT_NAME

public static final String CONFIGURATION_ELEMENT_NAME
See Also:
Constant Field Values

CLUSTER_PROTOCOL_ATTRIBUTE

public static final String CLUSTER_PROTOCOL_ATTRIBUTE
See Also:
Constant Field Values

CLUSTER_USER_ATTRIBUTE

public static final String CLUSTER_USER_ATTRIBUTE
See Also:
Constant Field Values

CLUSTER_PWD_ATTRIBUTE

public static final String CLUSTER_PWD_ATTRIBUTE
See Also:
Constant Field Values

CLUSTER_EXCLUDED_COLLECTIONS_ATTRIBUTE

public static final String CLUSTER_EXCLUDED_COLLECTIONS_ATTRIBUTE
See Also:
Constant Field Values

PROPERTY_CLUSTER_PROTOCOL

public static final String PROPERTY_CLUSTER_PROTOCOL
See Also:
Constant Field Values

PROPERTY_CLUSTER_USER

public static final String PROPERTY_CLUSTER_USER
See Also:
Constant Field Values

PROPERTY_CLUSTER_PWD

public static final String PROPERTY_CLUSTER_PWD
See Also:
Constant Field Values

PROPERTY_CLUSTER_EXCLUDED_COLLECTIONS

public static final String PROPERTY_CLUSTER_EXCLUDED_COLLECTIONS
See Also:
Constant Field Values

DEFAULT_PROTOCOL_STACK

public static final String DEFAULT_PROTOCOL_STACK
See Also:
Constant Field Values
Method Detail

getDbaUser

public static String getDbaUser()

getDbaPwd

public static String getDbaPwd()

viewAccepted

public void viewAccepted(View view)
---------------- MEMBERSHIP LISTENER METHODS ------------------------------ ****

Specified by:
viewAccepted in interface MembershipListener

suspect

public void suspect(Address address)
Specified by:
suspect in interface MembershipListener

block

public void block()
Specified by:
block in interface MembershipListener

getInstance

public static ClusterComunication getInstance()
********** --------------------------------------------------------- **********


isCoordinator

public boolean isCoordinator()
************** --------- CONSOLE METHODS ---------- *******************************


getCoordinator

public Address getCoordinator()

getAddress

public Address getAddress()

getMembersNoCoordinator

public Vector getMembersNoCoordinator()

getConsoleInfos

public HashMap getConsoleInfos(Vector address)

getHeaders

public int[][] getHeaders()
                   throws ClusterException
Throws:
ClusterException

getConfiguration

public Configuration getConfiguration()

configure

public static void configure(Configuration c)
                      throws ClusterException
Configure the cluster communication

Parameters:
c -
Throws:
ClusterException

synch

public void synch()
           throws ClusterException
Throws:
ClusterException

removeDocument

public void removeDocument(String collection,
                           String documentName)
                    throws ClusterException
Throws:
ClusterException

storeDocument

public void storeDocument(String collection,
                          String documentName,
                          String content)
                   throws ClusterException
Throws:
ClusterException

addCollection

public void addCollection(String parent,
                          String collectionName)
                   throws ClusterException
Throws:
ClusterException

update

public void update(String resource,
                   String name,
                   String xupdate)
            throws ClusterException
Throws:
ClusterException

removeCollection

public void removeCollection(String parent,
                             String collection)
                      throws ClusterException
Throws:
ClusterException

getNextEvents

public ArrayList getNextEvents(int[] header,
                               int[] myHeader,
                               Integer start)

getNextDataRemote

public int[] getNextDataRemote(String address)

invoke

public void invoke(ClusterEvent event)
            throws ClusterException
Throws:
ClusterException

getRemoteHeader

public int[] getRemoteHeader()
                      throws ClusterException
Throws:
ClusterException

getConsoleProperties

public ConsoleInfo getConsoleProperties()
                                 throws ClusterException
Throws:
ClusterException

stop

public void stop()


Copyright (C) Wolfgang Meier. All rights reserved.