|
GemFire 6.6.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface GatewayHub
A GatewayHub manages a collection of Gateways. It
has three primary purposes, namely:
EntryEvents to its Gateways
which in turn queue them for distribution to remote sites or
GatewayEventListeners as GatewayEvents
GatewayEvents from
remote sites
Gateway,
GatewayEvent,
GatewayEventListener| Field Summary | |
|---|---|
static String |
DEFAULT_BIND_ADDRESS
The default ip address or host name that this GatewayHub's
socket will listen on for connections. |
static boolean |
DEFAULT_MANUAL_START
The default value (false) for manually starting a GatewayHub. |
static int |
DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS
The default maximum amount of time (60000 ms) between client pings. |
static int |
DEFAULT_PORT
The default value (-1) for this GatewayHub's port. |
static int |
DEFAULT_SOCKET_BUFFER_SIZE
The default buffer size (32768 bytes) for socket buffers from a sending GatewayHub to the receiving one. |
static String |
DEFAULT_STARTUP_POLICY
The default startup policy ( STARTUP_POLICY_NONE). |
static String |
STARTUP_POLICY_NONE
The 'none' startup policy. |
static String |
STARTUP_POLICY_PRIMARY
The 'primary' startup policy. |
static String |
STARTUP_POLICY_SECONDARY
The 'secondary' startup policy. |
static int |
STARTUP_POLICY_SECONDARY_WAIT
The amount of time in milliseconds a GatewayHub defined with
secondary startup policy waits for a primary GatewayHub to
start before logging a warning and becoming the primary
GatewayHub itself. |
| Method Summary | |
|---|---|
Gateway |
addGateway(String id)
Adds a Gateway to this GatewayHub's
known Gateways. |
Gateway |
addGateway(String id,
int concurrencyLevel)
Adds a Gateway to this GatewayHub's known
Gateways. |
Object |
getAllGatewaysLock()
Return a mutex to lock when iterating over the list of gateways |
String |
getBindAddress()
Returns a string representing the ip address or host name that this GatewayHub will listen on. |
Cache |
getCache()
Returns this GatewayHub's GemFire cache |
CancelCriterion |
getCancelCriterion()
Returns the CancelCriterion for this GatewayHub. |
List<String> |
getGatewayIds()
Returns the ids of this GatewayHub's list of known
Gateways |
List<Gateway> |
getGateways()
Returns this GatewayHub's list of known
Gateways |
String |
getId()
Returns the identifier of this GatewayHub |
boolean |
getManualStart()
Returns the manual start boolean property for this GatewayHub. |
int |
getMaximumTimeBetweenPings()
Returns the maximum amount of time between client pings. |
int |
getPort()
Returns the port on which this GatewayHub listens for
remote connections |
int |
getSocketBufferSize()
Returns the configured buffer size of the socket connection for this GatewayHub. |
String |
getStartupPolicy()
Returns the startup policy for this GatewayHub. |
boolean |
isPrimary()
Returns whether this GatewayHub is the primary hub. |
boolean |
isRunning()
Deprecated. use getCancelCriterion().cancelInProgress() instead |
void |
pauseGateways()
Notifies all of this GatewayHub's Gateways to
pause sending events. |
void |
removeGateway(String id)
Removes a Gateway from this GatewayHub. |
void |
resumeGateways()
Notifies all of this GatewayHub's Gateways to
resume sending events. |
void |
setBindAddress(String address)
Sets the ip address or host name that this GatewayHub will
listen on for connections. |
void |
setId(String id)
Sets the identifier for this GatewayHub |
void |
setManualStart(boolean manualStart)
Sets the manual start boolean property for this GatewayHub. |
void |
setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
Sets the maximum amount of time between client pings. |
void |
setPort(int port)
Sets the port on which this GatewayHub listens for
remote connections |
void |
setSocketBufferSize(int socketBufferSize)
Sets the buffer size in bytes of the socket connection for this GatewayHub. |
void |
setStartupPolicy(String startupPolicy)
Sets the startup policy for this GatewayHub. |
void |
start()
Starts this GatewayHub and notifies all of its
Gateways to start. |
void |
start(boolean startGateways)
Starts this GatewayHub and notifies all of its
Gateways to start if startGateways is true. |
void |
startGateways()
Starts all of this GatewayHub's Gateways. |
void |
stop()
Stops this GatewayHub. |
void |
stopGateways()
Stops all of this GatewayHub's Gateways. |
String |
toDetailedString()
Returns detailed string representation of this GatewayHub. |
| Field Detail |
|---|
static final int DEFAULT_SOCKET_BUFFER_SIZE
GatewayHub to the receiving one.
static final int DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS
ClientHealthMonitor to determine the
health of this GatewayHub's clients.
static final String STARTUP_POLICY_NONE
GatewayHub. If it can become the primary
GatewayHub, it will. If not, then it will become a secondary
GatewayHub.
static final String STARTUP_POLICY_PRIMARY
GatewayHub. If it can become the primary
GatewayHub, it will. If not, then it will log a warning
and become a secondary GatewayHub.
static final String STARTUP_POLICY_SECONDARY
STARTUP_POLICY_SECONDARY_WAIT milliseconds for another VM to
start as the primary GatewayHub. If another VM does start as
the primary GatewayHub within
STARTUP_POLICY_SECONDARY_WAIT milliseconds, then this VM will
start as a secondary GatewayHub. If not, then it will log a
warning and start as the primary GatewayHub.
static final String DEFAULT_STARTUP_POLICY
STARTUP_POLICY_NONE).
static final int STARTUP_POLICY_SECONDARY_WAIT
GatewayHub defined with
secondary startup policy waits for a primary GatewayHub to
start before logging a warning and becoming the primary
GatewayHub itself. This value is 60000 milliseconds.
static final boolean DEFAULT_MANUAL_START
GatewayHub.
static final int DEFAULT_PORT
GatewayHub's port.
This is not a valid port for creating connections and should only be
used in cases in which the GatewayHub does not accept
any connections, such as database write behind applications.
static final String DEFAULT_BIND_ADDRESS
GatewayHub's
socket will listen on for connections.
The current default is null.
| Method Detail |
|---|
int getPort()
GatewayHub listens for
remote connections
GatewayHub listens for
remote connectionsvoid setPort(int port)
GatewayHub listens for
remote connections
port - The port on which this GatewayHub listens
for remote connectionsvoid setId(String id)
GatewayHub
id - The identifier for this GatewayHubString getId()
GatewayHub
GatewayHubvoid setSocketBufferSize(int socketBufferSize)
GatewayHub. The default is 32768 bytes.
socketBufferSize - The size in bytes of the socket bufferint getSocketBufferSize()
GatewayHub. The default is 32768 bytes.
GatewayHubvoid setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
ClientHealthMonitor to determine the health
of any foreign Gateways connected to this
GatewayHub. The default is 60000 ms.
maximumTimeBetweenPings - The maximum amount of time between client
pingsint getMaximumTimeBetweenPings()
ClientHealthMonitor to determine the health
of any foreign Gateways connected to this
GatewayHub. The default is 60000 ms.
void start()
throws IOException
GatewayHub and notifies all of its
Gateways to start. Starting a GatewayHub does
several actions, including:
GatewayEvents from
remote sites if the listen port is set
Gateways using startGateways() to queue
and send local EntryEvents to remote sites or local
GatewayEventListeners as GatewayEvents
GatewayHub is running, its configuration cannot be
changed.
IOException - If an error occurs while starting the GatewayHub
void start(boolean startGateways)
throws IOException
GatewayHub and notifies all of its
Gateways to start if startGateways is true. Starting a
GatewayHub does several actions, including:
GatewayEvents from
remote sites if the listen port is set
Gateways
using startGateways() to queue and send local
EntryEvents to remote sites or local
GatewayEventListeners as GatewayEvents. If the
startGateways argument is false, this GatewayHub will start
just as a receiver of remote GatewayEvents. It will neither
send nor queue local events for remote delivery. Setting startGateways to
false is useful when updates to the local site should not be sent to the
remote sites (e.g. during an initial load).
GatewayHub is running, its configuration cannot be
changed.
startGateways - Whether to notify the Gateways to start
IOException
void startGateways()
throws IOException
GatewayHub's Gateways. This
can be used to start Gateways that have been stopped using
stopGateways() or not started when this GatewayHub is
started.
IOExceptionvoid stopGateways()
GatewayHub's Gateways. Stopping
the Gateways will cause this GatewayHub to act
just as a receiver of remote GatewayEvents. It will neither
send nor queue local events for remote delivery. Stopping
Gateways is useful when updates to the local site should not
be sent to the remote sites (e.g. during an initial load). This action has
no effect on this GatewayHub's primary/secondary status.
@Deprecated boolean isRunning()
GatewayHub is running
GatewayHub is runningvoid stop()
GatewayHub. Stopping a GatewayHub does
several actions, including:
GatewayEvents are no longer
received from remote sites
Gateways using stopGateways() so
that GatewayEvents are no longer sent to remote sites
GatewayHub is running in the local site, it will take over as
primary if it is not already primary.
GatewayHub can be reconfigured and restarted if
desired. In this case, the GatewayHub will restart as
secondary if another GatewayHub is already running in the
local site.
Cache getCache()
GatewayHub's GemFire cache
GatewayHub's GemFire cache
Gateway addGateway(String id)
throws GatewayException
Gateway to this GatewayHub's
known Gateways.
id - The id of the Gateway
Gateway
GatewayException - if this GatewayHub already defines
a Gateway with this id
Gateway addGateway(String id,
int concurrencyLevel)
throws GatewayException
Gateway to this GatewayHub's known
Gateways.
id - The id of the GatewayconcurrencyLevel - The concurrency level (number of parallel threads) processing
GatewayEvents *
Gateway
GatewayException - if this GatewayHub already defines a
Gateway with this id
void removeGateway(String id)
throws GatewayException
Gateway from this GatewayHub.
id - The id of the Gateway
GatewayException - if this GatewayHub does not contain
a Gateway with this idList<Gateway> getGateways()
GatewayHub's list of known
Gateways
GatewayHub's list of known
GatewaysList<String> getGatewayIds()
GatewayHub's list of known
Gateways
GatewayHub's list of known
Gatewaysboolean isPrimary()
GatewayHub is the primary hub.
GatewayHub is the primary hubString toDetailedString()
void setStartupPolicy(String startupPolicy)
throws GatewayException
GatewayHub.
startupPolicy - the startup policy for this GatewayHub
GatewayException - if the input startup policy is not valid.String getStartupPolicy()
GatewayHub.
GatewayHubObject getAllGatewaysLock()
void setManualStart(boolean manualStart)
GatewayHub.
This property is mainly used for controlling when a GatewayHub
configured in xml is started. By default, a GatewayHub is
started right after the Regions are created. Setting this to
true allows the application to start a GatewayHub when desired
(e.g. after all remote Regions are created and initialized).
manualStart - the manual start boolean property for this GatewayHubboolean getManualStart()
GatewayHub.
GatewayHubCancelCriterion getCancelCriterion()
CancelCriterion for this GatewayHub.
CancelCriterion for this GatewayHubvoid pauseGateways()
GatewayHub's Gateways to
pause sending events. Events will continue to be queued while the
Gateway is paused. Pausing a Gateway only affects
outgoing events. It has no affect on incoming ones. It also has no effect
on the primary status of this GatewayHub.
void resumeGateways()
GatewayHub's Gateways to
resume sending events. Processing the queue will resume when a
Gateway is resumed.
String getBindAddress()
GatewayHub will listen on.
GatewayHub
will listen onDEFAULT_BIND_ADDRESSvoid setBindAddress(String address)
GatewayHub will
listen on for connections.
Setting a specific bind address will cause the GatewayHub
to always use this address and ignore any address specified by "server-bind-address"
or "bind-address" in the gemfire.properties file
(see DistributedSystem
for a description of these properties).
The value "" does not override the gemfire.properties.
It will cause the local machine's default address to be listened on if the
properties file does not specify and address.
If you wish to override the properties and want to have your GatewayHub
bind to all local addresses then use this bind address "0.0.0.0".
A null value will be treated the same as the default "".
address - the ip address or host name that this GatewayHub
will listen onDEFAULT_BIND_ADDRESS
|
GemFire 6.6.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||