# The Java Embedded Database Cluster Parameter Classes

The classes and interfaces below define the eXtremeDB Cluster interface parameters.

### For an overview see page Java Database Class

### Class Definitions

        public static class ClusterNodeParams
        {
            public String addr;
            public int    qrank;

            public ClusterNodeParams(String addr, int qrank)
            {
                this.addr  = addr;
                this.qrank = qrank;
            };

            public ClusterNodeParams(String addr)
            {
                this(addr, 1);
            }
        };

        public static class ClusterNodeInfo
        {
            public String addr;
            public int qrank;
            public int nodeId;

            public ClusterNodeInfo(String addr, int qrank, int nodeId)
            {
                this.addr = addr;
                this.qrank = qrank;
                this.nodeId = nodeId;
            }
        }

        public static class ClusterWindow
        {
            public int                  length; /* in transactions */
            public int                  bsize;  /* in bytes */
            public int                  timeout;

            public ClusterWindow(int length, int bsize, int timeout)
            {
                this.length  = length;
                this.bsize   = bsize;
                this.timeout = timeout;
            };

            public ClusterWindow(int length)
            {
                this(length, 0, 1);
            };
        }

        public abstract static class ClusterNWParams { };

        public static class ClusterTCPParams extends ClusterNWParams
        {
            public int                   socketSendBuf;
            public int                   socketRecvBuf;
            public int                   connectTimeout;
            public int                   connectInterval;
            public int                   socketDomain;
            public int                   keepAliveTime;
            public int                   keepAliveProbes;
            public int                   compressionLevel;
            public Database.SSLParameters sslParameters;

            public ClusterTCPParams()
            {
                socketSendBuf   = 0;
                socketRecvBuf   = 0;
                connectTimeout  = 5 * 1000;
                connectInterval = 200;
                socketDomain    = SOCK_INET_DOMAIN;
                keepAliveTime   = 1000;
                keepAliveProbes = 10;
                compressionLevel = 0;
                sslParameters = null;
            }
        }

        public static class ClusterMPIParams extends ClusterNWParams
        {
            public int flags;

            public ClusterMPIParams()
            {
                flags = 0;
            }
        }

        public interface ClusterQuorumCallback
        {
            public boolean checkQuorum(int neighborIds[]);
        }

        public interface ClusterNotifying
        {
            public static final int NODE_CONNECT    = 0;
            public static final int NODE_DISCONNECT = 1;
            public void onNotify(int code, ClusterNodeInfo nodeInfo);
        }

### Definitions:

ClusterNodeParams and ClusterNodeInfo
`addr` | The IP address of this cluster node
`qrank` | The Quorum rank of this cluster node
`nodeId` | The integer identifier of this cluster node
ClusterWindow
`length` | The number of in transactions in each window instance
`bsize` | The window size in bytes
`timeout` | The window timeout in milliseconds
ClusterTCPParams
`socketSendBuf` | The send buffer size in bytes
`socketRecvBuf` | The receive buffer size in bytes
`connectTimeout` | The connection timeout period in milliseconds
`connectInterval` | The interval between connection attempts in milliseconds
`socketDomain` |
`keepAliveTime` | The time window for the KEEP_ALIVE message
`keepAliveProbes` | The number of keep-alive probes to send before the node disconnects
`sslParameters` | The Cluster-specific SSL settings
ClusterMPIParams
`flags` | Possible combination of `CLUSTER_MPI_BUSYWAIT` and/or `CLUSTER_MPI_SERIALIZED_SEND`
Cluster Callbacks
`ClusterQuorumCallback` | The callback function to be called when a Cluster Quorum is not reached
`ClusterNotifying` | The callback function to receive Cluster notifications