Search in sources :

Example 6 with TopicException

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);
}
Also used : TopicException(com.swiftmq.swiftlet.topic.TopicException) InvalidDestinationException(javax.jms.InvalidDestinationException) InvalidDestinationException(javax.jms.InvalidDestinationException) IOException(java.io.IOException) JMSException(javax.jms.JMSException) SwiftletException(com.swiftmq.swiftlet.SwiftletException) AuthenticationException(com.swiftmq.swiftlet.auth.AuthenticationException) TopicException(com.swiftmq.swiftlet.topic.TopicException)

Aggregations

TopicException (com.swiftmq.swiftlet.topic.TopicException)6 AuthenticationException (com.swiftmq.swiftlet.auth.AuthenticationException)5 IOException (java.io.IOException)5 SwiftletException (com.swiftmq.swiftlet.SwiftletException)4 InvalidDestinationException (javax.jms.InvalidDestinationException)4 JMSException (javax.jms.JMSException)4 TopicImpl (com.swiftmq.jms.TopicImpl)3 AddressString (com.swiftmq.amqp.v100.generated.messaging.message_format.AddressString)1 MessageSelector (com.swiftmq.ms.MessageSelector)1 DataByteArrayInputStream (com.swiftmq.tools.util.DataByteArrayInputStream)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 InvalidSelectorException (javax.jms.InvalidSelectorException)1