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
This commit is contained in:
James Strachan 2005-12-13 16:20:11 +00:00
parent ecfbe6168d
commit 1835e45369
1 changed files with 28 additions and 0 deletions

View File

@ -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;
}
}