GemFire 5.5

com.gemstone.gemfire.cache.util
Interface BridgeServer


public interface BridgeServer

A cache bridge server that serves the contents of a Cache to VMs in another distributed system via a socket. A bridge server is used in conjunction with a BridgeLoader and a BridgeWriter to connect two regions that reside in different distributed systems.

Since:
2.0.2
See Also:
Cache.addBridgeServer(), Cache.getBridgeServers()

Field Summary
static int DEFAULT_CONNECTION_LIMIT
          The default number of sockets accepted by a BridgeServer.
static int DEFAULT_MAXIMUM_MESSAGE_COUNT
          The default maximum number of messages that can be enqueued in a client-queue.
static int DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS
          The default maximum amount of time between client pings.
static int DEFAULT_MESSAGE_TIME_TO_LIVE
          The default time (in seconds ) after which a message in the client queue will expire.
static boolean DEFAULT_NOTIFY_BY_SUBSCRIPTION
          The default notify-by-subscription value which tells the BridgeServer whether or not to notify clients based on key subscription.
static int DEFAULT_PORT
          The default port on which a BridgeServer is configured to serve.
static int DEFAULT_SOCKET_BUFFER_SIZE
          The default socket buffer size for socket buffers from the server to the client.
static int DEFAULT_THREAD_LIMIT
          The default limit to the maximum number of server threads that can be created to service client requests.
 
Method Summary
 int getMaxConnections()
          Returns the maximum allowed client connections
 int getMaximumMessageCount()
          Returns the maximum number of messages that can be enqueued in a client-queue.
 int getMaximumTimeBetweenPings()
          Returns the maximum amount of time between client pings.
 int getMaxThreads()
          Returns the maxium number of threads allowed in this server to service client requests.
 int getMessageTimeToLive()
          Returns the time (in seconds ) after which a message in the client queue will expire.
 boolean getNotifyBySubscription()
          Answers whether or not this bridge server should notify clients based on key subscription.
 int getPort()
          Returns the port on which this bridge server listens for clients (BridgeLoaders and BridgeWriters) to connect.
 int getSocketBufferSize()
          Returns the configured buffer size of the socket connection for this BridgeServer.
 boolean isRunning()
          Returns whether or not this bridge server is running
 void setMaxConnections(int maxCons)
          Sets the maxium number of client connections allowed.
 void setMaximumMessageCount(int maxMessageCount)
          Sets maximum number of messages that can be enqueued in a client-queue.
 void setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
          Sets the maximum amount of time between client pings.
 void setMaxThreads(int maxThreads)
          Sets the maxium number of threads allowed in this server to service client requests.
 void setMessageTimeToLive(int messageTimeToLive)
          Sets the time (in seconds ) after which a message in the client queue will expire.
 void setNotifyBySubscription(boolean b)
          Sets whether or not this bridge server should notify clients based on key subscription.
 void setPort(int port)
          Sets the port on which this bridge server listens for clients (BridgeLoaders and BridgeWriters) to connect.
 void setSocketBufferSize(int socketBufferSize)
          Sets the buffer size in bytes of the socket connection for this BridgeServer.
 void start()
          Starts this bridge server.
 void stop()
          Stops this bridge server.
 

Field Detail

DEFAULT_PORT

static final int DEFAULT_PORT
The default port on which a BridgeServer is configured to serve.

See Also:
Constant Field Values

DEFAULT_CONNECTION_LIMIT

static final int DEFAULT_CONNECTION_LIMIT
The default number of sockets accepted by a BridgeServer. When the maximum is reached the server will stop accepting new connections. Current value: 800

See Also:
Constant Field Values

DEFAULT_THREAD_LIMIT

static final int DEFAULT_THREAD_LIMIT
The default limit to the maximum number of server threads that can be created to service client requests. Once this number of threads exist then connections must share the same thread to service their request. A selector is used to detect client connection requests and dispatch them to the thread pool. The default of 0 causes a thread to be bound to every connection and to be dedicated to detecting client requests on that connection. A selector is not used in this default mode. Current value: 0

Since:
5.1
See Also:
Constant Field Values

DEFAULT_NOTIFY_BY_SUBSCRIPTION

static final boolean DEFAULT_NOTIFY_BY_SUBSCRIPTION
The default notify-by-subscription value which tells the BridgeServer whether or not to notify clients based on key subscription.

See Also:
Constant Field Values

DEFAULT_SOCKET_BUFFER_SIZE

static final int DEFAULT_SOCKET_BUFFER_SIZE
The default socket buffer size for socket buffers from the server to the client.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS

static final int DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS
The default maximum amount of time between client pings. This value is used by the ClientHealthMonitor to determine the health of this BridgeServer's clients.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_MESSAGE_COUNT

static final int DEFAULT_MAXIMUM_MESSAGE_COUNT
The default maximum number of messages that can be enqueued in a client-queue.

See Also:
Constant Field Values

DEFAULT_MESSAGE_TIME_TO_LIVE

static final int DEFAULT_MESSAGE_TIME_TO_LIVE
The default time (in seconds ) after which a message in the client queue will expire.

See Also:
Constant Field Values
Method Detail

getPort

int getPort()
Returns the port on which this bridge server listens for clients (BridgeLoaders and BridgeWriters) to connect.


setPort

void setPort(int port)
Sets the port on which this bridge server listens for clients (BridgeLoaders and BridgeWriters) to connect.

Throws:
IllegalStateException - If this bridge server is running

setNotifyBySubscription

void setNotifyBySubscription(boolean b)
Sets whether or not this bridge server should notify clients based on key subscription. If false, then an update to any key on the server causes an update to be sent to all clients. This update does not push the actual data to the clients. Instead, it causes the client to locally invalidate or destroy the corresponding entry. The next time the client requests the key, it goes to the bridge server for the value. If true, then an update to any key on the server causes an update to be sent to only those clients who have registered interest in that key. Other clients are not notified of the change. In addition, the actual value is pushed to the client. The client does not need to request the new value from the bridge server.

Since:
4.2

getNotifyBySubscription

boolean getNotifyBySubscription()
Answers whether or not this bridge server should notify clients based on key subscription.

Since:
4.2

setSocketBufferSize

void setSocketBufferSize(int socketBufferSize)
Sets the buffer size in bytes of the socket connection for this BridgeServer. The default is 32768 bytes.

Parameters:
socketBufferSize - The size in bytes of the socket buffer
Since:
4.2.1

getSocketBufferSize

int getSocketBufferSize()
Returns the configured buffer size of the socket connection for this BridgeServer. The default is 32768 bytes.

Returns:
the configured buffer size of the socket connection for this BridgeServer
Since:
4.2.1

setMaximumTimeBetweenPings

void setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
Sets the maximum amount of time between client pings. This value is used by the ClientHealthMonitor to determine the health of this BridgeServer's clients. The default is 60000 ms.

Parameters:
maximumTimeBetweenPings - The maximum amount of time between client pings
Since:
4.2.3

getMaximumTimeBetweenPings

int getMaximumTimeBetweenPings()
Returns the maximum amount of time between client pings. This value is used by the ClientHealthMonitor to determine the health of this BridgeServer's clients. The default is 60000 ms.

Returns:
the maximum amount of time between client pings.
Since:
4.2.3

start

void start()
           throws IOException
Starts this bridge server. Once the server is running, its configuration cannot be changed.

Throws:
IOException - If an error occurs while starting the bridge server

isRunning

boolean isRunning()
Returns whether or not this bridge server is running


stop

void stop()
Stops this bridge server. Note that the BridgeServer can be reconfigured and restarted if desired.


getMaxConnections

int getMaxConnections()
Returns the maximum allowed client connections


setMaxConnections

void setMaxConnections(int maxCons)
Sets the maxium number of client connections allowed. When the maximum is reached the server will stop accepting connections.

See Also:
DEFAULT_CONNECTION_LIMIT

getMaxThreads

int getMaxThreads()
Returns the maxium number of threads allowed in this server to service client requests. The default of 0 causes the server to dedicate a thread for every client connection.

Since:
5.1

setMaxThreads

void setMaxThreads(int maxThreads)
Sets the maxium number of threads allowed in this server to service client requests. The default of 0 causes the server to dedicate a thread for every client connection.

Since:
5.1
See Also:
DEFAULT_THREAD_LIMIT

getMaximumMessageCount

int getMaximumMessageCount()
Returns the maximum number of messages that can be enqueued in a client-queue.


setMaximumMessageCount

void setMaximumMessageCount(int maxMessageCount)
Sets maximum number of messages that can be enqueued in a client-queue.

See Also:
DEFAULT_MAXIMUM_MESSAGE_COUNT

getMessageTimeToLive

int getMessageTimeToLive()
Returns the time (in seconds ) after which a message in the client queue will expire.


setMessageTimeToLive

void setMessageTimeToLive(int messageTimeToLive)
Sets the time (in seconds ) after which a message in the client queue will expire.

See Also:
DEFAULT_MESSAGE_TIME_TO_LIVE

GemFire 5.5

Copyright © 2002-2008 GemStone Systems, Inc. All Rights Reserved.