|
GemFire 6.6 | ||||||||
| 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.
Gateway| 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 String |
DEFAULT_DISTRIBUTION_POLICY
The default ( DISTRIBUTION_POLICY_ALL) distribution policy. |
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 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 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 |
DISTRIBUTION_POLICY_ALL
The 'all' distribution policy. |
static String |
DISTRIBUTION_POLICY_PARALLEL
The 'parallel' distribution policy. |
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. |
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()
Indicates cancellation of this hub |
String |
getDistributionPolicy()
Returns the current distribution policy of 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 processing events. |
void |
removeGateway(String id)
Removes a Gateway from this GatewayHub. |
void |
resumeGateways()
Notifies all of this GatewayHub's Gateways to
resume processing events. |
void |
setBindAddress(String address)
Sets the ip address or host name that this GatewayHub will
listen on for connections. |
void |
setDistributionPolicy(String distributionPolicy)
Sets the distribution policy for this GatewayHub. |
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 requested. |
void |
startGateways()
Notifies all of this GatewayHub's Gateways to
start. |
void |
stop()
Stops this GatewayHub by stopping its listener and
notifying each of its Gateways to stop. |
void |
stopGateways()
Notifies all of this GatewayHub's Gateways to
stop. |
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 String DISTRIBUTION_POLICY_ALL
GatewayEvents received by this GatewayHub
will be distributed to all of its defined Gateways.
static final String DISTRIBUTION_POLICY_PARALLEL
GatewayEvents received by this GatewayHub
will be distributed to only one of its defined Gateways
based on the hashCode of the GatewayEvent's key. The
hashCode value is used as an index into the list of defined
Gateways. The 'parallel' distribution policy provides a
means of processing GatewayEvents in parallel. Order is not
preserved with this policy.
One thing to note is that the Gateway chosen by this
GatewayHub must match the one chosen in any other VM that
defines this GatewayHub. Otherwise events will be lost. For
this reason, it is imperative that the order of the GatewayHub's
Gateway definitions matches in all VMs.
static final String DEFAULT_DISTRIBUTION_POLICY
DISTRIBUTION_POLICY_ALL) distribution policy.
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. Once the hub 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 requested. Once the hub is running,
its configuration cannot be changed.
startGateways - Whether to notify the Gateways to
start
IOException
void startGateways()
throws IOException
GatewayHub's Gateways to
start.
IOExceptionvoid stopGateways()
GatewayHub's Gateways to
stop.
@Deprecated boolean isRunning()
GatewayHub is running
void stop()
GatewayHub by stopping its listener and
notifying each of its Gateways to stop. Note that the
GatewayHub can be reconfigured and restarted if
desired.
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
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.
GatewayHub
void setDistributionPolicy(String distributionPolicy)
throws GatewayException
GatewayHub.
GatewayExceptionString getDistributionPolicy()
GatewayHub.
Object getAllGatewaysLock()
void setManualStart(boolean manualStart)
GatewayHub.
manualStart - the manual start boolean property for this
GatewayHubboolean getManualStart()
GatewayHub.
GatewayHubCancelCriterion getCancelCriterion()
void pauseGateways()
GatewayHub's Gateways to
pause processing events.
void resumeGateways()
GatewayHub's Gateways to
resume processing events.
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 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||