GatewaySender
and GatewayReceiver
insteadpublic interface GatewayHub
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
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_BIND_ADDRESS
Deprecated.
The default ip address or host name that this
GatewayHub 's
socket will listen on for connections. |
static boolean |
DEFAULT_MANUAL_START
Deprecated.
The default value (false) for manually starting a
GatewayHub . |
static int |
DEFAULT_MAX_CONNECTIONS
Deprecated.
The default number of sockets accepted by this
GatewayHub . |
static int |
DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS
Deprecated.
The default maximum amount of time (60000 ms) between client pings.
|
static int |
DEFAULT_PORT
Deprecated.
The default value (-1) for this
GatewayHub 's port. |
static int |
DEFAULT_SOCKET_BUFFER_SIZE
Deprecated.
The default buffer size (32768 bytes) for socket buffers from a sending
GatewayHub to the receiving one. |
static String |
DEFAULT_STARTUP_POLICY
Deprecated.
The default startup policy (
STARTUP_POLICY_NONE ). |
static String |
STARTUP_POLICY_NONE
Deprecated.
The 'none' startup policy.
|
static String |
STARTUP_POLICY_PRIMARY
Deprecated.
The 'primary' startup policy.
|
static String |
STARTUP_POLICY_SECONDARY
Deprecated.
The 'secondary' startup policy.
|
static int |
STARTUP_POLICY_SECONDARY_WAIT
Deprecated.
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. |
Modifier and Type | Method and Description |
---|---|
Gateway |
addGateway(String id)
Deprecated.
Adds a
Gateway to this GatewayHub 's
known Gateway s. |
Gateway |
addGateway(String id,
int concurrencyLevel)
Deprecated.
|
Object |
getAllGatewaysLock()
Deprecated.
Return a mutex to lock when iterating over the list of gateways
|
String |
getBindAddress()
Deprecated.
Returns a string representing the ip address or host name that this
GatewayHub will listen on. |
Cache |
getCache()
Deprecated.
Returns this
GatewayHub 's GemFire cache |
CancelCriterion |
getCancelCriterion()
Deprecated.
Returns the
CancelCriterion for this GatewayHub . |
List<String> |
getGatewayIds()
Deprecated.
Returns the ids of this
GatewayHub 's list of known
Gateway s |
List<Gateway> |
getGateways()
Deprecated.
Returns this
GatewayHub 's list of known
Gateway s |
String |
getId()
Deprecated.
Returns the identifier of this
GatewayHub |
boolean |
getManualStart()
Deprecated.
Returns the manual start boolean property for this
GatewayHub . |
int |
getMaxConnections()
Deprecated.
Returns the maximum number of
Gateway connections allowed. |
int |
getMaximumTimeBetweenPings()
Deprecated.
Returns the maximum amount of time between client pings.
|
int |
getPort()
Deprecated.
Returns the port on which this
GatewayHub listens for
remote connections |
int |
getSocketBufferSize()
Deprecated.
Returns the configured buffer size of the socket connection for this
GatewayHub . |
String |
getStartupPolicy()
Deprecated.
Returns the startup policy for this
GatewayHub . |
boolean |
isPrimary()
Deprecated.
Returns whether this
GatewayHub is the primary hub. |
boolean |
isRunning()
Deprecated.
use getCancelCriterion().cancelInProgress() instead
|
void |
pauseGateways()
Deprecated.
Notifies all of this
GatewayHub 's Gateway s to
pause sending events. |
void |
removeGateway(String id)
Deprecated.
Removes a
Gateway from this GatewayHub . |
void |
resumeGateways()
Deprecated.
Notifies all of this
GatewayHub 's Gateway s to
resume sending events. |
void |
setBindAddress(String address)
Deprecated.
Sets the ip address or host name that this
GatewayHub will
listen on for connections. |
void |
setId(String id)
Deprecated.
Sets the identifier for this
GatewayHub |
void |
setManualStart(boolean manualStart)
Deprecated.
Sets the manual start boolean property for this
GatewayHub . |
void |
setMaxConnections(int maxConnections)
Deprecated.
Sets the maximum number of
Gateway connections allowed. |
void |
setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
Deprecated.
Sets the maximum amount of time between client pings.
|
void |
setPort(int port)
Deprecated.
Sets the port on which this
GatewayHub listens for
remote connections |
void |
setSocketBufferSize(int socketBufferSize)
Deprecated.
Sets the buffer size in bytes of the socket connection for this
GatewayHub . |
void |
setStartupPolicy(String startupPolicy)
Deprecated.
Sets the startup policy for this
GatewayHub . |
void |
start()
Deprecated.
Starts this
GatewayHub and notifies all of its
Gateways to start. |
void |
start(boolean startGateways)
Deprecated.
Starts this
GatewayHub and notifies all of its
Gateways to start if startGateways is true. |
void |
startGateways()
Deprecated.
Starts all of this
GatewayHub's Gateways . |
void |
stop()
Deprecated.
Stops this
GatewayHub . |
void |
stopGateways()
Deprecated.
Stops all of this
GatewayHub's Gateways . |
String |
toDetailedString()
Deprecated.
Returns detailed string representation of this GatewayHub.
|
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.static final int DEFAULT_MAX_CONNECTIONS
GatewayHub
.
When the maximum is reached this GatewayHub
will stop
accepting new connections. The current default is 800.int getPort()
GatewayHub
listens for
remote connectionsGatewayHub
listens for
remote connectionsvoid setPort(int port)
GatewayHub
listens for
remote connectionsport
- The port on which this GatewayHub
listens
for remote connectionsvoid setId(String id)
GatewayHub
id
- The identifier for this GatewayHub
String getId()
GatewayHub
GatewayHub
void 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.GatewayHub
void setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
ClientHealthMonitor
to determine the health
of any foreign Gateway
s 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 Gateway
s 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 startIOException
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.IOException
void 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 runningGatewayHub
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 cacheGatewayHub
's GemFire cacheGateway addGateway(String id) throws GatewayException
Gateway
to this GatewayHub
's
known Gateway
s.id
- The id of the Gateway
Gateway
GatewayException
- if this GatewayHub
already defines
a Gateway
with this id@Deprecated Gateway addGateway(String id, int concurrencyLevel) throws GatewayException
Gateway
to this GatewayHub
's known
Gateway
s.id
- The id of the Gateway
concurrencyLevel
- The concurrency level (number of parallel threads) processing
GatewayEvent
s *Gateway
GatewayException
- if this GatewayHub
already defines a
Gateway
with this idvoid 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
Gateway
sGatewayHub
's list of known
Gateway
sList<String> getGatewayIds()
GatewayHub
's list of known
Gateway
sGatewayHub
's list of known
Gateway
sboolean 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.STARTUP_POLICY_NONE
,
STARTUP_POLICY_PRIMARY
,
STARTUP_POLICY_SECONDARY
String getStartupPolicy()
GatewayHub
.GatewayHub
Object 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 Region
s are created. Setting this to
true allows the application to start a GatewayHub
when desired
(e.g. after all remote Region
s are created and initialized).manualStart
- the manual start boolean property for this GatewayHub
boolean getManualStart()
GatewayHub
.GatewayHub
CancelCriterion getCancelCriterion()
CancelCriterion
for this GatewayHub
.CancelCriterion
for this GatewayHub
void pauseGateways()
GatewayHub
's Gateway
s 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 Gateway
s 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_ADDRESS
void 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
int getMaxConnections()
Gateway
connections allowed.Gateway
connections allowedvoid setMaxConnections(int maxConnections)
Gateway
connections allowed. When
the maximum is reached this GatewayHub
will stop accepting
connections.DEFAULT_MAX_CONNECTIONS
Copyright © 1997-2017 Pivotal Software, Inc. All rights reserved.