use of com.swiftmq.swiftlet.topic.TopicException in project swiftmq-ce by iitsoftware.
the class TopicManagerImpl method deleteDurable.
/**
* @param durableName
* @param activeLogin
* @throws InvalidDestinationException
*/
public synchronized void deleteDurable(String durableName, ActiveLogin activeLogin) throws InvalidDestinationException, QueueException, UnknownQueueException, TopicException {
String durableQueueName = DurableSubscription.createDurableQueueName(activeLogin.getClientId(), durableName);
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(getName(), "deleteDurable: durableQueueName = " + durableQueueName);
DurableSubscription durable = (DurableSubscription) durableSubscriptions.get(durableQueueName);
if (durable == null)
throw new InvalidDestinationException("no durable subscriber found with clientId '" + activeLogin.getClientId() + "' and name = '" + durableName + "'");
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(getName(), "deleteDurable: durable found, deleting ...");
unsubscribe(durable.getTopicSubscription().getSubscriberId());
ctx.queueManager.deleteQueue(durableQueueName, false);
durableSubscriptions.remove(durableQueueName);
try {
durableStore.deleteDurableStoreEntry(durable.getClientId(), durable.getDurableName());
} catch (Exception e) {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(getName(), "deleteDurable: error deleting durable subscription: " + e);
throw new TopicException("error deleting durable subscription: " + e);
}
ctx.activeDurableList.removeDynamicEntity(durable);
}
Aggregations