GemFire 6.6.2

com.gemstone.gemfire.cache.util
Interface Gateway


public interface Gateway

A Gateway represents a local proxy for a remote WAN (or distributed system).

Since:
4.2

Nested Class Summary
static interface Gateway.Endpoint
          An Endpoint represents a proxy to a remote host
static class Gateway.OrderPolicy
          The order policy.
 
Field Summary
static int DEFAULT_CONCURRENCY_LEVEL
          The default number of parallel threads dispatching events from one member.
static int DEFAULT_SOCKET_BUFFER_SIZE
          The default buffer size for socket buffers from a sending Gateway to its receiving Gateway.
static int DEFAULT_SOCKET_READ_TIMEOUT
          The default amount of time in milliseconds that a socket read between a sending Gateway and its receiving Gateway will block.
static String STARTUP_POLICY_PRIMARY
          The 'primary' startup policy.
 
Method Summary
 void addEndpoint(String id, String host, int port)
          Add an Endpoint to this Gateway.
 void addListener(GatewayEventListener listener)
          Add a GatewayEventListener to this Gateway.
 int getConcurrencyLevel()
          Returns the concurrency level (number of parallel threads) processing GatewayEvents
 boolean getEarlyAck()
          Deprecated. EarlyAck communication is unsafe and no longer supported
 List getEndpoints()
          Returns the list of Endpoints
 String getGatewayHubId()
          Returns this Gateway's GatewayHub identifier.
 String getId()
          Returns this Gateway's identifier.
 List<GatewayEventListener> getListeners()
          Returns the list of GatewayEventListeners
 Gateway.OrderPolicy getOrderPolicy()
          Returns the OrderPolicy for this Gateway.
 GatewayQueueAttributes getQueueAttributes()
          Returns the GatewayQueueAttributess for this Gateway
 int getQueueSize()
          Returns the number of entries in this Gateway's queue.
 int getSocketBufferSize()
          Returns the configured buffer size of the socket connection between this Gateway and its receiving Gateway.
 int getSocketReadTimeout()
          Optional operation.
 boolean hasEndpoints()
          Returns whether this Gateway has Endpoints
 boolean hasListeners()
          Returns whether this Gateway has GatewayEventListeners
 boolean isConnected()
          Returns whether or not this Gateway is connected to its remote Gateway.
 boolean isPaused()
          Returns whether or not this Gateway is running.
 boolean isRunning()
          Returns whether or not this Gateway is running
 void pause()
          Pauses this Gateway.
 void resume()
          Resumes this paused Gateway.
 void setEarlyAck(boolean earlyAck)
          Deprecated. EarlyAck communication is unsafe and no longer supported
 void setOrderPolicy(Gateway.OrderPolicy orderPolicy)
          Sets the OrderPolicy for this Gateway.
 void setQueueAttributes(GatewayQueueAttributes queueAttributes)
          Sets the GatewayQueueAttributess for this Gateway.
 void setSocketBufferSize(int socketBufferSize)
          Sets the buffer size in bytes of the socket connection between this Gateway and its receiving Gateway.
 void setSocketReadTimeout(int socketReadTimeout)
          Optional operation.
 void start()
          Starts this Gateway.
 void stop()
          Stops this Gateway.
 

Field Detail

DEFAULT_SOCKET_BUFFER_SIZE

static final int DEFAULT_SOCKET_BUFFER_SIZE
The default buffer size for socket buffers from a sending Gateway to its receiving Gateway.

See Also:
Constant Field Values

DEFAULT_SOCKET_READ_TIMEOUT

static final int DEFAULT_SOCKET_READ_TIMEOUT
The default amount of time in milliseconds that a socket read between a sending Gateway and its receiving Gateway will block.


DEFAULT_CONCURRENCY_LEVEL

static final int DEFAULT_CONCURRENCY_LEVEL
The default number of parallel threads dispatching events from one member. The member has one logical queue and this many actual physical queues and dispatchers dispatching events from those queues. Events will be enqueued in the physical queues based on the hashCode of the member id and thread id. Per-thread ordering will be maintained. The current value is 1.

Since:
6.5.1
See Also:
Constant Field Values

STARTUP_POLICY_PRIMARY

static final String STARTUP_POLICY_PRIMARY
The 'primary' startup policy. This setting means that the VM will attempt to become the primary GatewayHub. If it can become the primary GatewayHub, it will. If not, then it will log a warning and become a secondary GatewayHub.

See Also:
Constant Field Values
Method Detail

getGatewayHubId

String getGatewayHubId()
Returns this Gateway's GatewayHub identifier.

Returns:
this Gateway's GatewayHub identifier.

getId

String getId()
Returns this Gateway's identifier.

Returns:
this Gateway's identifier.

addEndpoint

void addEndpoint(String id,
                 String host,
                 int port)
                 throws GatewayException
Add an Endpoint to this Gateway.

Parameters:
id - The id of the endpoint
host - The host of the endpoint
port - The port that the endpoint is listening on
Throws:
GatewayException - if this Gateway already defines an Endpoint with this id

getEndpoints

List getEndpoints()
Returns the list of Endpoints

Returns:
the list of Endpoints

hasEndpoints

boolean hasEndpoints()
Returns whether this Gateway has Endpoints

Returns:
whether this Gateway has Endpoints

addListener

void addListener(GatewayEventListener listener)
                 throws GatewayException
Add a GatewayEventListener to this Gateway.

Parameters:
listener - The GatewayEventListener to add
Throws:
GatewayException - if this Gateway already defines any Endpoints
Since:
5.1

getListeners

List<GatewayEventListener> getListeners()
Returns the list of GatewayEventListeners

Returns:
the list of GatewayEventListeners
Since:
5.1

hasListeners

boolean hasListeners()
Returns whether this Gateway has GatewayEventListeners

Returns:
whether this Gateway has GatewayEventListeners
Since:
5.1

setEarlyAck

@Deprecated
void setEarlyAck(boolean earlyAck)
Deprecated. EarlyAck communication is unsafe and no longer supported

Sets whether to enable early acknowledgement for this Gateway's queue.

Parameters:
earlyAck - Whether or not to enable early acknowledgement for batches sent from this Gateway to its corresponding Gateway.
Throws:
UnsupportedOperationException - because of deprecation

getEarlyAck

@Deprecated
boolean getEarlyAck()
Deprecated. EarlyAck communication is unsafe and no longer supported

Gets whether to enable early acknowledgement for this Gateway's queue.

Returns:
whether to enable early acknowledgement for batches sent from this Gateway to its corresponding Gateway.

setSocketBufferSize

void setSocketBufferSize(int socketBufferSize)
Sets the buffer size in bytes of the socket connection between this Gateway and its receiving Gateway. 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 between this Gateway and its receiving Gateway. The default is 32768 bytes.

Returns:
the configured buffer size of the socket connection between this Gateway and its receiving Gateway
Since:
4.2.1

setSocketReadTimeout

void setSocketReadTimeout(int socketReadTimeout)
Optional operation. Sets the amount of time in milliseconds that a socket read between a sending Gateway and its receiving Gateway will block. The default is 10000 seconds.

Parameters:
socketReadTimeout - The amount of time to block
Since:
4.2.2

getSocketReadTimeout

int getSocketReadTimeout()
Optional operation. Returns the amount of time in milliseconds that a socket read between a sending Gateway and its receiving Gateway will block. The default is 10000 seconds.

Returns:
the amount of time in milliseconds that a socket read between a sending Gateway and its receiving Gateway will block
Since:
4.2.2

setQueueAttributes

void setQueueAttributes(GatewayQueueAttributes queueAttributes)
Sets the GatewayQueueAttributess for this Gateway. Calling setQueueAttributes on a stopped Gateway will destroy the existing queue and create a new empty queue.

Parameters:
queueAttributes - The GatewayQueueAttributes to use

getQueueAttributes

GatewayQueueAttributes getQueueAttributes()
Returns the GatewayQueueAttributess for this Gateway

Returns:
the GatewayQueueAttributess for this Gateway

start

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

Throws:
IOException - If an error occurs while starting the Gateway

isRunning

boolean isRunning()
Returns whether or not this Gateway is running


stop

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


isConnected

boolean isConnected()
Returns whether or not this Gateway is connected to its remote Gateway.


getQueueSize

int getQueueSize()
Returns the number of entries in this Gateway's queue.

Returns:
the number of entries in this Gateway's queue

pause

void pause()
Pauses this Gateway.

Since:
6.0

resume

void resume()
Resumes this paused Gateway.

Since:
6.0

isPaused

boolean isPaused()
Returns whether or not this Gateway is running.

Since:
6.0

getConcurrencyLevel

int getConcurrencyLevel()
Returns the concurrency level (number of parallel threads) processing GatewayEvents

Returns:
the concurrency level (number of parallel threads) processing GatewayEvents
Since:
6.5.1
See Also:
DEFAULT_CONCURRENCY_LEVEL

setOrderPolicy

void setOrderPolicy(Gateway.OrderPolicy orderPolicy)
Sets the OrderPolicy for this Gateway.

Parameters:
orderPolicy - the OrderPolicy for this Gateway
Since:
6.5.1

getOrderPolicy

Gateway.OrderPolicy getOrderPolicy()
Returns the OrderPolicy for this Gateway.

Returns:
the OrderPolicy for this Gateway
Since:
6.5.1

GemFire 6.6.2

Copyright © 1997-2012 VMware, Inc. All rights reserved.