From 1835e4536984abac76c6d4317a73f1a7e851e960 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Tue, 13 Dec 2005 16:20:11 +0000 Subject: [PATCH] added some helper methods to make it easy to see the type of removal event git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@356522 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/activemq/command/RemoveInfo.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/activemq-core/src/main/java/org/activemq/command/RemoveInfo.java b/activemq-core/src/main/java/org/activemq/command/RemoveInfo.java index 0b3f62f8a5..825ce724ee 100755 --- a/activemq-core/src/main/java/org/activemq/command/RemoveInfo.java +++ b/activemq-core/src/main/java/org/activemq/command/RemoveInfo.java @@ -69,5 +69,33 @@ public class RemoveInfo extends BaseCommand { throw new IOException("Unknown remove command type: "+ objectId.getDataStructureType()); } } + + /** + * Returns true if this event is for a removed connection + */ + public boolean isConnectionRemove() { + return objectId.getDataStructureType() == ConnectionId.DATA_STRUCTURE_TYPE; + } + + /** + * Returns true if this event is for a removed session + */ + public boolean isSessionRemove() { + return objectId.getDataStructureType() == SessionId.DATA_STRUCTURE_TYPE; + } + + /** + * Returns true if this event is for a removed consumer + */ + public boolean isConsumerRemove() { + return objectId.getDataStructureType() == ConsumerId.DATA_STRUCTURE_TYPE; + } + + /** + * Returns true if this event is for a removed producer + */ + public boolean isProducerRemove() { + return objectId.getDataStructureType() == ProducerId.DATA_STRUCTURE_TYPE; + } }