From 5c4bd063d7673cfde074ec4b55786a862c07464d Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Mon, 9 Oct 2006 22:09:54 +0000 Subject: [PATCH] added additional properties for network control etc git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@454532 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/command/BrokerInfo.java | 36 +++++++++ .../activemq/command/ConnectionInfo.java | 16 ++++ .../activemq/command/ConsumerControl.java | 78 +++++++++++++++++++ .../openwire/v2/BrokerInfoMarshaller.java | 10 +++ .../openwire/v2/ConnectionInfoMarshaller.java | 5 ++ .../v2/ConsumerControlMarshaller.java | 15 ++++ .../activemq/openwire/v2/BrokerInfoTest.java | 2 + .../openwire/v2/ConnectionInfoTest.java | 1 + .../openwire/v2/ConsumerControlTest.java | 3 + 9 files changed, 166 insertions(+) diff --git a/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java b/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java index 44593fdffa..596b901c6f 100755 --- a/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java +++ b/activemq-core/src/main/java/org/apache/activemq/command/BrokerInfo.java @@ -33,6 +33,8 @@ public class BrokerInfo extends BaseCommand{ boolean slaveBroker; boolean masterBroker; boolean faultTolerantConfiguration; + boolean networkConnection; + boolean duplexConnection; BrokerInfo peerBrokerInfos[]; String brokerName; @@ -133,4 +135,38 @@ public class BrokerInfo extends BaseCommand{ public void setFaultTolerantConfiguration(boolean faultTolerantConfiguration){ this.faultTolerantConfiguration=faultTolerantConfiguration; } + + + /** + * @openwire:property version=2 + * @return the duplexConnection + */ + public boolean isDuplexConnection(){ + return this.duplexConnection; + } + + + /** + * @param duplexConnection the duplexConnection to set + */ + public void setDuplexConnection(boolean duplexConnection){ + this.duplexConnection=duplexConnection; + } + + + /** + * @openwire:property version=2 + * @return the networkConnection + */ + public boolean isNetworkConnection(){ + return this.networkConnection; + } + + + /** + * @param networkConnection the networkConnection to set + */ + public void setNetworkConnection(boolean networkConnection){ + this.networkConnection=networkConnection; + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ConnectionInfo.java b/activemq-core/src/main/java/org/apache/activemq/command/ConnectionInfo.java index 537596c16c..fb123dbb50 100755 --- a/activemq-core/src/main/java/org/apache/activemq/command/ConnectionInfo.java +++ b/activemq-core/src/main/java/org/apache/activemq/command/ConnectionInfo.java @@ -36,6 +36,7 @@ public class ConnectionInfo extends BaseCommand { protected BrokerId[] brokerPath; protected boolean brokerMasterConnector; protected boolean manageable; + protected boolean clientMaster; protected transient Object transportContext; public ConnectionInfo() { @@ -165,5 +166,20 @@ public class ConnectionInfo extends BaseCommand { public void setTransportContext(Object transportContext) { this.transportContext = transportContext; } + + /** + * @openwire:property version=2 + * @return the clientMaster + */ + public boolean isClientMaster(){ + return this.clientMaster; + } + + /** + * @param clientMaster the clientMaster to set + */ + public void setClientMaster(boolean clientMaster){ + this.clientMaster=clientMaster; + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/command/ConsumerControl.java b/activemq-core/src/main/java/org/apache/activemq/command/ConsumerControl.java index 8525cfa525..5d63442ce5 100644 --- a/activemq-core/src/main/java/org/apache/activemq/command/ConsumerControl.java +++ b/activemq-core/src/main/java/org/apache/activemq/command/ConsumerControl.java @@ -32,6 +32,9 @@ public class ConsumerControl extends BaseCommand { protected ConsumerId consumerId; protected boolean close; + protected boolean stop; + protected boolean start; + protected boolean flush; protected int prefetch; public byte getDataStructureType() { return DATA_STRUCTURE_TYPE; @@ -113,4 +116,79 @@ public class ConsumerControl extends BaseCommand { public void setPrefetch(int prefetch){ this.prefetch=prefetch; } + + + + + + + /** + * @openwire:property version=2 + * @return the flush + */ + public boolean isFlush(){ + return this.flush; + } + + + + + + + /** + * @param flush the flush to set + */ + public void setFlush(boolean flush){ + this.flush=flush; + } + + + + + + + /** + * @openwire:property version=2 + * @return the start + */ + public boolean isStart(){ + return this.start; + } + + + + + + + /** + * @param start the start to set + */ + public void setStart(boolean start){ + this.start=start; + } + + + + + + + /** + * @openwire:property version=2 + * @return the stop + */ + public boolean isStop(){ + return this.stop; + } + + + + + + + /** + * @param stop the stop to set + */ + public void setStop(boolean stop){ + this.stop=stop; + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java index c012759a8f..0646a68525 100644 --- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java +++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/BrokerInfoMarshaller.java @@ -84,6 +84,8 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller { info.setSlaveBroker(bs.readBoolean()); info.setMasterBroker(bs.readBoolean()); info.setFaultTolerantConfiguration(bs.readBoolean()); + info.setDuplexConnection(bs.readBoolean()); + info.setNetworkConnection(bs.readBoolean()); } @@ -103,6 +105,8 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller { bs.writeBoolean(info.isSlaveBroker()); bs.writeBoolean(info.isMasterBroker()); bs.writeBoolean(info.isFaultTolerantConfiguration()); + bs.writeBoolean(info.isDuplexConnection()); + bs.writeBoolean(info.isNetworkConnection()); return rc + 0; } @@ -125,6 +129,8 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller { bs.readBoolean(); bs.readBoolean(); bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); } @@ -157,6 +163,8 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller { info.setSlaveBroker(dataIn.readBoolean()); info.setMasterBroker(dataIn.readBoolean()); info.setFaultTolerantConfiguration(dataIn.readBoolean()); + info.setDuplexConnection(dataIn.readBoolean()); + info.setNetworkConnection(dataIn.readBoolean()); } @@ -176,6 +184,8 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller { dataOut.writeBoolean(info.isSlaveBroker()); dataOut.writeBoolean(info.isMasterBroker()); dataOut.writeBoolean(info.isFaultTolerantConfiguration()); + dataOut.writeBoolean(info.isDuplexConnection()); + dataOut.writeBoolean(info.isNetworkConnection()); } } diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java index b02539d56c..8296f8062f 100644 --- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java +++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConnectionInfoMarshaller.java @@ -84,6 +84,7 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller { } info.setBrokerMasterConnector(bs.readBoolean()); info.setManageable(bs.readBoolean()); + info.setClientMaster(bs.readBoolean()); } @@ -103,6 +104,7 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller { rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); bs.writeBoolean(info.isBrokerMasterConnector()); bs.writeBoolean(info.isManageable()); + bs.writeBoolean(info.isClientMaster()); return rc + 0; } @@ -125,6 +127,7 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller { tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs); bs.readBoolean(); bs.readBoolean(); + bs.readBoolean(); } @@ -157,6 +160,7 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller { } info.setBrokerMasterConnector(dataIn.readBoolean()); info.setManageable(dataIn.readBoolean()); + info.setClientMaster(dataIn.readBoolean()); } @@ -176,6 +180,7 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller { looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); dataOut.writeBoolean(info.isBrokerMasterConnector()); dataOut.writeBoolean(info.isManageable()); + dataOut.writeBoolean(info.isClientMaster()); } } diff --git a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java index 658fcca508..fe97c07afd 100644 --- a/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java +++ b/activemq-core/src/main/java/org/apache/activemq/openwire/v2/ConsumerControlMarshaller.java @@ -69,6 +69,9 @@ public class ConsumerControlMarshaller extends BaseCommandMarshaller { info.setClose(bs.readBoolean()); info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setPrefetch(dataIn.readInt()); + info.setFlush(bs.readBoolean()); + info.setStart(bs.readBoolean()); + info.setStop(bs.readBoolean()); } @@ -83,6 +86,9 @@ public class ConsumerControlMarshaller extends BaseCommandMarshaller { int rc = super.tightMarshal1(wireFormat, o, bs); bs.writeBoolean(info.isClose()); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); + bs.writeBoolean(info.isFlush()); + bs.writeBoolean(info.isStart()); + bs.writeBoolean(info.isStop()); return rc + 4; } @@ -101,6 +107,9 @@ public class ConsumerControlMarshaller extends BaseCommandMarshaller { bs.readBoolean(); tightMarshalNestedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs); dataOut.writeInt(info.getPrefetch()); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); } @@ -118,6 +127,9 @@ public class ConsumerControlMarshaller extends BaseCommandMarshaller { info.setClose(dataIn.readBoolean()); info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setPrefetch(dataIn.readInt()); + info.setFlush(dataIn.readBoolean()); + info.setStart(dataIn.readBoolean()); + info.setStop(dataIn.readBoolean()); } @@ -133,6 +145,9 @@ public class ConsumerControlMarshaller extends BaseCommandMarshaller { dataOut.writeBoolean(info.isClose()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeInt(info.getPrefetch()); + dataOut.writeBoolean(info.isFlush()); + dataOut.writeBoolean(info.isStart()); + dataOut.writeBoolean(info.isStop()); } } diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java index b3c23d1d5b..fb2ba0c955 100644 --- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/BrokerInfoTest.java @@ -64,5 +64,7 @@ public class BrokerInfoTest extends BaseCommandTestSupport { info.setSlaveBroker(true); info.setMasterBroker(false); info.setFaultTolerantConfiguration(true); + info.setDuplexConnection(false); + info.setNetworkConnection(true); } } diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java index f9c307bd4e..229637c739 100644 --- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConnectionInfoTest.java @@ -64,5 +64,6 @@ public class ConnectionInfoTest extends BaseCommandTestSupport { } info.setBrokerMasterConnector(true); info.setManageable(false); + info.setClientMaster(true); } } diff --git a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java index d7a6a5ed9e..34c4c962a0 100644 --- a/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/openwire/v2/ConsumerControlTest.java @@ -54,5 +54,8 @@ public class ConsumerControlTest extends BaseCommandTestSupport { info.setClose(true); info.setConsumerId(createConsumerId("ConsumerId:1")); info.setPrefetch(1); + info.setFlush(false); + info.setStart(true); + info.setStop(false); } }