SGF-375 - The <gfe:gateway-hub> XML namespace element is missing the 'max-time-between-pings' attribute.

This commit is contained in:
John Blum
2015-02-24 14:47:12 -08:00
parent a5b743989b
commit d42d5b57fe
7 changed files with 90 additions and 75 deletions

View File

@@ -73,7 +73,7 @@ Sets the maximum amount of time between client pings.
ParsingUtils.setPropertyValue(element, builder, "bind-address");
ParsingUtils.setPropertyValue(element, builder, "manual-start");
//ParsingUtils.setPropertyValue(element, builder, "max-connections");
//ParsingUtils.setPropertyValue(element, builder, "max-time-between-pings", "maximumTimeBetweenPings");
ParsingUtils.setPropertyValue(element, builder, "max-time-between-pings", "maximumTimeBetweenPings");
ParsingUtils.setPropertyValue(element, builder, "port");
ParsingUtils.setPropertyValue(element, builder, "socket-buffer-size");
ParsingUtils.setPropertyValue(element, builder, "startup-policy");

View File

@@ -48,7 +48,7 @@ public class GatewayHubFactoryBean extends AbstractWANComponentFactoryBean<Gatew
private GatewayHub gatewayHub;
private Integer maxConnections;
//private Integer maxConnections;
private Integer maximumTimeBetweenPings;
private Integer port;
private Integer socketBufferSize;

View File

@@ -2957,7 +2957,7 @@ Scope also determines whether to allow remote invocation of some of the region
<xsd:enumeration value="global" />
</xsd:restriction>
</xsd:simpleType>
<!-- -->
<xsd:complexType name="gatewayTransportFilterType">
<xsd:annotation>
<xsd:documentation
@@ -2989,7 +2989,7 @@ use inner bean declarations.
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<!-- Gemfire 6 WAN Gateway schema -->
<!-- GemFire 6 WAN Gateway schema -->
<xsd:complexType name="gatewayHubType">
<xsd:annotation>
<xsd:documentation><![CDATA[
@@ -3013,13 +3013,6 @@ The id of this hub
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="port" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The port for this hub (integer value, if not specified, Gemfire will select an open port)
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="cache-ref" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
@@ -3027,32 +3020,42 @@ The id of the cache - default is gemfireCache
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="bind-address" type="xsd:string"
use="optional">
<xsd:attribute name="bind-address" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the bind address (IP address or host name) for the gateway hub
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-buffer-size" type="xsd:string"
use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the socket buffer size in bytes
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="manual-start" type="xsd:string"
use="optional">
<xsd:attribute name="manual-start" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies if the gateway hub is manually (true) or automatically(false) started
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="startup-policy" type="xsd:string"
use="optional">
<xsd:attribute name="max-time-between-pings" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the maximum amount of time between client pings.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="port" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The port for this hub (integer value, if not specified, Gemfire will select an open port)
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the socket buffer size in bytes
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="startup-policy" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the startup policy (primary,secondary, none) for the gateway hub
@@ -3067,12 +3070,12 @@ Specifies the startup policy (primary,secondary, none) for the gateway hub
Deprecated as of Gemfire 7
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="endpoint-id" type="xsd:string" use="required">
</xsd:attribute>
<xsd:attribute name="host" type="xsd:string" use="required">
</xsd:attribute>
<xsd:attribute name="port" type="xsd:string" use="required">
</xsd:attribute>
<xsd:attribute name="endpoint-id" type="xsd:string" use="required">
</xsd:attribute>
</xsd:complexType>
<!-- -->
<xsd:complexType name="gatewayQueueType">
@@ -3081,24 +3084,7 @@ Deprecated as of Gemfire 7
Deprecated as of Gemfire 7
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="enable-batch-conflation" type="xsd:string"
use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies whether batch conflation is enabled (true or false)
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="batch-time-interval" type="xsd:string"
use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The maximum time interval that can elapse before a partial batch is sent from a GatewaySender to its corresponding GatewayReceiver.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="alert-threshold" type="xsd:string"
use="optional">
<xsd:attribute name="alert-threshold" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the alert threshold in miliseconds, indicating the maximum time elapsed from when the gateway sent the message
@@ -3113,26 +3099,38 @@ Specifies the batch size
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="persistent" type="xsd:string" use="optional">
<xsd:attribute name="batch-time-interval" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies whether persistence is enabled: true or false(default)
The maximum time interval that can elapse before a partial batch is sent from a GatewaySender to its corresponding GatewayReceiver.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="disk-store-ref" type="xsd:string"
use="optional">
<xsd:attribute name="disk-store-ref" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Indicates the id of disk store to use for persistence
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="maximum-queue-memory" type="xsd:string"
use="optional">
<xsd:attribute name="enable-batch-conflation" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies whether batch conflation is enabled (true or false)
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="maximum-queue-memory" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the maximum memory in MB to allocate for the queue
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="persistent" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies whether persistence is enabled: true or false(default)
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -3146,7 +3144,7 @@ Deprecated as of Gemfire 7
</xsd:annotation>
<xsd:sequence>
<xsd:choice>
<xsd:element name="gateway-endpoint" minOccurs="1" maxOccurs="unbounded" type="gatewayEndpointType"/>
<xsd:element name="gateway-endpoint" type="gatewayEndpointType" minOccurs="1" maxOccurs="unbounded"/>
<xsd:element name="gateway-listener" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation
@@ -3181,8 +3179,7 @@ use inner bean declarations.
</xsd:complexType>
</xsd:element>
</xsd:choice>
<xsd:element name="gateway-queue" minOccurs="0"
maxOccurs="1" type="gatewayQueueType" />
<xsd:element name="gateway-queue" type="gatewayQueueType" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="gateway-id" type="xsd:string" use="required">
<xsd:annotation>
@@ -3191,24 +3188,14 @@ Specifies the id for this gateway
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-buffer-size" type="xsd:string"
use="optional">
<xsd:attribute name="concurrency-level" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the socket buffer size in bytes
Specifies the number of parallel threads
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-read-timeout" type="xsd:string"
use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the socket read timeout in milliseconds
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="order-policy" type="xsd:string"
use="optional">
<xsd:attribute name="order-policy" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the order policy - This only applies if parallel is enabled:
@@ -3218,11 +3205,17 @@ THREAD:Indicates that events will be parallelized based on the event's originati
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="concurrency-level" type="xsd:string"
use="optional">
<xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the number of parallel threads
Specifies the socket buffer size in bytes
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-read-timeout" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the socket read timeout in milliseconds
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -3235,8 +3228,7 @@ Deprecated as of Gemfire 7
]]></xsd:documentation>
</xsd:annotation>
</xsd:element>
<!-- End Gemfire 6 WAN Gateway schema -->
<!-- End GemFire 6 WAN Gateway schema -->
<!-- Function Annotation Support -->
<xsd:element name="annotation-driven">
<xsd:annotation>

View File

@@ -2986,6 +2986,13 @@ Specifies if the gateway hub is manually (true) or automatically(false) started
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="max-time-between-pings" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the maximum amount of time between client pings.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[

View File

@@ -83,7 +83,7 @@ public class GatewayHubNamespaceTest {
assertEquals("localhost", gatewayHub.getBindAddress());
assertEquals("testGatewayHub", gatewayHub.getId());
assertTrue(gatewayHub.getManualStart());
//assertEquals(GatewayHub.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS, gatewayHub.getMaximumTimeBetweenPings());
assertEquals(5000, gatewayHub.getMaximumTimeBetweenPings());
assertEquals(45123, gatewayHub.getPort());
assertEquals(16384, gatewayHub.getSocketBufferSize());
assertEquals("primary", gatewayHub.getStartupPolicy());

View File

@@ -51,6 +51,7 @@ public class MockGatewayHubFactory extends AbstractMockerySupport {
private Boolean manualStart = GatewayHub.DEFAULT_MANUAL_START;
//private Integer maximumConnections = GatewayHub.DEFAULT_MAXIMUM_CONNECTIONS;
private Integer maximumTimeBetweenPings = GatewayHub.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS;
private Integer socketBufferSize = GatewayHub.DEFAULT_SOCKET_BUFFER_SIZE;
@@ -93,6 +94,21 @@ public class MockGatewayHubFactory extends AbstractMockerySupport {
}
});
/*
doAnswer(new Answer<Void>() {
@Override public Void answer(final InvocationOnMock invocation) throws Throwable {
maximumConnections = invocation.getArgumentAt(0, Integer.class);
return null;
}
}).when(mockGatewayHub).setMaximumConnections(anyInt());
when(mockGatewayHub.getMaximumConnections()).thenAnswer(new Answer<Integer>() {
@Override public Integer answer(final InvocationOnMock invocation) throws Throwable {
return maximumConnections;
}
});
*/
doAnswer(new Answer<Void>() {
@Override public Void answer(final InvocationOnMock invocation) throws Throwable {
maximumTimeBetweenPings = invocation.getArgumentAt(0, Integer.class);

View File

@@ -23,8 +23,8 @@
<gfe:disk-dir location="./gemfire/GatewayHubNamespaceTest/Gateway/Queue"/>
</gfe:disk-store>
<gfe:gateway-hub id="testGatewayHub" bind-address="localhost" manual-start="true" port="45123"
socket-buffer-size="16384" startup-policy="primary">
<gfe:gateway-hub id="testGatewayHub" bind-address="localhost" manual-start="true" max-time-between-pings="5000"
port="45123" socket-buffer-size="16384" startup-policy="primary">
<gfe:gateway gateway-id="gateway1" concurrency-level="8" order-policy="thread" socket-buffer-size="65536">
<gfe:gateway-listener>
<bean class="org.springframework.data.gemfire.config.GatewayHubNamespaceTest.TestGatewayListener"/>