public class GatewayHubHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GatewayHubHelper.Endpoint
Represents the endpoint for a gateway hub.
|
| Constructor and Description |
|---|
GatewayHubHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addGateways(String gatewayConfig)
Adds gateways to the current gateway hub, one per unique distributed system
different than the hub's.
|
static void |
addWBCLGateway(String gatewayConfig)
Adds
GatewayPrms.concurrencyLevel WBCL gateways to the current
gateway hub. |
static com.gemstone.gemfire.cache.util.GatewayHub |
createGatewayHub(String gatewayHubConfig)
Creates a gateway hub in the current cache.
|
static String |
gatewayHubToString(com.gemstone.gemfire.cache.util.GatewayHub hub)
Returns the given gateway hub as a string.
|
static Set |
getDistributedSystemNames(List endpoints)
Returns the set of distributed system names for all gateway hub endpoints,
a possibly empty list.
|
protected static GatewayHubHelper.Endpoint |
getEndpoint(String id)
Gets the gateway hub endpoint for this VM from the shared
GatewayHubBlackboard map. |
static List |
getEndpoints()
Returns all gateway hub endpoints from the
GatewayHubBlackboard
map, a possibly empty list. |
static com.gemstone.gemfire.cache.util.GatewayHub |
getGatewayHub()
Returns the gateway hub for the current cache, or null if no gateway
hub exists.
|
static GatewayHubDescription |
getGatewayHubDescription(String gatewayHubConfig)
Returns the
GatewayHubDescription with the given configuration name
from GatewayHubPrms.names. |
protected static String |
getId(GatewayHubDescription ghd) |
protected static int |
getPort(GatewayHubDescription ghd,
String id) |
static List |
getRemoteEndpoints()
Returns all remote gateway hub endpoints from the
GatewayHubBlackboard map, a possibly empty list. |
static void |
startGatewayHub()
Starts the gateway hub in the current cache, if it exists.
|
static void |
stopGatewayHub()
Stops the gateway hub in the current cache, if it exists.
|
public static com.gemstone.gemfire.cache.util.GatewayHub createGatewayHub(String gatewayHubConfig)
GatewayHubDescription corresponding to the given hub
configuration from GatewayHubPrms.names.
Upon initial creation, if GatewayHubPrms.acceptGatewayConnections
is true, selects a random port and registers the GatewayHubHelper.Endpoint in the
GatewayHubBlackboard map for use by gateways. Starts of the hub
will always use this port.
If GatewayHubPrms.haEnabled is true, the hub ID is the name of its
distributed system. Otherwise the hub is given a unique ID.
Gateways are added using addGateways(String). The hub is
started using startGatewayHub().
HydraRuntimeException - if an attempt is made to reconfigure an
existing gateway hub.public static void addGateways(String gatewayConfig)
GatewayDescription corresponding to the given gateway configuration from
GatewayPrms.names.
IMPORTANT: This method must be invoked after all hub VMs have completed
execution of createGatewayHub(String), so that their endpoints
are available for discovery. This is most easily done by creating gateway
hubs in an INITTASK and adding gateways in a later task, allowing the
hydra task scheduler to provide the necessary synchronization.
HydraRuntimeException - if the gateway hub has not been created.public static void addWBCLGateway(String gatewayConfig)
GatewayPrms.concurrencyLevel WBCL gateways to the current
gateway hub. The gateways are configured using the GatewayDescription corresponding to the given gateway configuration from
GatewayPrms.names.HydraRuntimeException - if the gateway hub has not been created.public static void startGatewayHub()
Lazily creates the gateway disk stores specified by #diskStoreName, using DiskStoreHelper.createDiskStore(String).
public static com.gemstone.gemfire.cache.util.GatewayHub getGatewayHub()
public static void stopGatewayHub()
public static String gatewayHubToString(com.gemstone.gemfire.cache.util.GatewayHub hub)
public static GatewayHubDescription getGatewayHubDescription(String gatewayHubConfig)
GatewayHubDescription with the given configuration name
from GatewayHubPrms.names.public static Set getDistributedSystemNames(List endpoints)
public static List getEndpoints()
GatewayHubBlackboard
map, a possibly empty list. This includes all hubs that have ever started,
regardless of their current active status.public static List getRemoteEndpoints()
GatewayHubBlackboard map, a possibly empty list. This includes all hubs
that have ever started, except for the caller (if it is a hub), regardless
of their current active status.protected static GatewayHubHelper.Endpoint getEndpoint(String id)
GatewayHubBlackboard map. Lazily selects a random port and registers
the endpoint in the map.protected static String getId(GatewayHubDescription ghd)
protected static int getPort(GatewayHubDescription ghd, String id)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.