docs: public void deleteLocalDurableSubscription(
                                                 String subscriptionId)
                      throws
                      SIResourceException,
                      SIMPDestinationLockedException,
                      SIDurableSubscriptionNotFoundException
      {
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(
                          tc,
                          "deleteLocalDurableSubscription",
                          new Object[] { subscriptionId });
  
          // Lock the table of durable subscriptions to prevent others accessing the subscription 
          // We must perform the following work inside the sync block, in the following
          // order to protect against any chance of a duplicate subscription:
          // - Find the ConsumerDispatcher from the map
          // - Find the matching subscription item stream
          // - Persist the toBeDeleted flag on the item stream, so that it can never pop
          //   back into existence in the future.
          // - Remove the ConsumerDispatcher from both the map and subscription index,
          //   allowing a new subscription to be created with the same ID
          // We can then release the lock before attempting to cleanup the messages on the
          // existing subscription.
          DurableSubscriptionItemStream rstream = null;
          synchronized (_consumerDispatchersDurable)
          {
              // Get the consumer dispatcher from the table of durable subscriptions
              ConsumerDispatcher consumerDispatcher =
                              (ConsumerDispatcher) _consumerDispatchersDurable.get(subscriptionId);
  
              if (consumerDispatcher == null
                  || !consumerDispatcher.getConsumerDispatcherState().isReady())
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(
                                 tc,
                                 "deleteLocalDurableSubscription",
                                 "Sub not found " + subscriptionId);
                  throw new SIDurableSubscriptionNotFoundException(
                                  nls.getFormattedMessage(
                                                          "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146",
                                                          new Object[] {
                                                                        subscriptionId,
                                                                        _messageProcessor.getMessagingEngineName() },
                                                          null));
              }
  
              // If consumers are attached to this consumerDispatcher then reject the delete.
              if (consumerDispatcher.hasConsumersAttached())
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(
                                 tc,
                                 "deleteLocalDurableSubscription",
                                 " SIDestinationLockedException" + subscriptionId);
  
                  throw new SIMPDestinationLockedException(// defect 177277
                  nls.getFormattedMessage(
                                          "SUBSCRIPTION_IN_USE_ERROR_CWSIP0152",
                                          new Object[] {
                                                        subscriptionId,
                                                        _messageProcessor.getMessagingEngineName() },
                                          null),
                                  SIMPDestinationLockedException.CONSUMERS_ATTACHED);
              }
  
              // Now find the matching item stream, using the consumer dispatcher
              final SubscriptionStateFilter subStateFilter =
                              new SubscriptionStateFilter();
              subStateFilter.setConsumerDispatcherStateFilter(consumerDispatcher.getConsumerDispatcherState());
  
              try
              {
                  // Find the subscription in the topicspace itemstream
                  rstream = (DurableSubscriptionItemStream) _pubsubMessageItemStream.
                                  findFirstMatchingReferenceStream(subStateFilter);
  
                  // Check there are no in-doubt receives on this stream.
                  // Note this does not prevent us deleting a stream with in-doubt sends, which
                  // is correct as producers sending to a subscription shouldn't prevent the
                  // subscriber from deleting its subscription.
                  if (rstream != null)
                  {
                      if (rstream.getStatistics().getRemovingItemCount() != 0)
                      {
                          // There are uncommitted gets on this stream.           // 177786
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                              SibTr.exit(
                                         tc,
                                         "deleteLocalDurableSubscription",
                                         "SIDestinationLockedException"
                                                         + rstream.getStatistics().getUnavailableItemCount()
                                                         + ":"
                                                         + subscriptionId);
  
                          throw new SIMPDestinationLockedException(
                                          nls.getFormattedMessage("SUBSCRIPTION_IN_USE_ERROR_CWSIP0153",
                                                                  new Object[] { subscriptionId, _messageProcessor.getMessagingEngineName() },
                                                                  null),
                                          SIMPDestinationLockedException.UNCOMMITTED_MESSAGES);
                      }
                  }
  
              } catch (MessageStoreException e)
              {
                  // MessageStoreException shouldn't occur so FFDC.
                  FFDCFilter.processException(
                                              e,
                                              "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.deleteLocalDurableSubscription",
                                              "1:1472:1.35.2.4",
                                              this);
  
                  SibTr.exception(tc, e);
                  SibTr.error(
                              tc,
                              "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                              new Object[] {
                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                            "1:1481:1.35.2.4",
                                            e,
                                            subscriptionId });
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(tc, "deleteLocalDurableSubscription", e);
  
                  throw new SIResourceException(
                                  nls.getFormattedMessage(
                                                          "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                          new Object[] {
                                                                        "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                        "1:1493:1.35.2.4",
                                                                        e,
                                                                        subscriptionId },
                                                          null),
                                  e);
              }
  
              // Mark the subscription to be deleted, and persist the flag
              boolean persistingToBeDeletedFlag = false;
              try
              {
                  if (rstream != null)
                  {
                      rstream.markAsToBeDeleted();
                      if (rstream.isInStore())
                      {
                          // If we fail while performing the persistent update,
                          // we need to rollback the toBeDeleted mark.
                          persistingToBeDeletedFlag = true;
                          rstream.requestUpdate(
                                          _messageProcessor.getTXManager().createAutoCommitTransaction());
                          persistingToBeDeletedFlag = false;
                      }
                  }
              } catch (MessageStoreException e)
              {
                  // MessageStoreException shouldn't occur so FFDC.
                  FFDCFilter.processException(
                                              e,
                                              "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.deleteLocalDurableSubscription",
                                              "1:1523:1.35.2.4",
                                              this);
  
                  SibTr.exception(tc, e);
                  SibTr.error(
                              tc,
                              "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                              new Object[] {
                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                            "1:1532:1.35.2.4",
                                            e,
                                            subscriptionId });
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(tc, "deleteLocalDurableSubscription", e);
  
                  throw new SIResourceException(
                                  nls.getFormattedMessage(
                                                          "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                          new Object[] {
                                                                        "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                        "1:1544:1.35.2.4",
                                                                        e,
                                                                        subscriptionId },
                                                          null),
                                  e);
              } finally
              {
                  if (persistingToBeDeletedFlag)
                  {
                      // We failed while persisting the toBeDeleted flag.
                      // We cannot remove the subscription from the in-memory tables, as otherwise
                      // we could have a duplicate subscription on restart if the user created a new one.
                      // As such we unmark the deletion before throwing the exception, allowing the user
                      // to continue to use this subscription (and attempt the deletion again later).
                      rstream.clearToBeDeleted();
                  }
              }
  
              // Now we can safely remove this subscription from our map, allowing the
              // user to create a new subscription with the same ID.
              // Remove consumerDispatcher from durable subscriptions table
              _consumerDispatchersDurable.remove(subscriptionId);
  
              // Delete consumerDispatcher ( implicit remove from matchspace) 
              try
              {
                  // Delete from matchspace and send proxy message
                  consumerDispatcher.deleteConsumerDispatcher(
                                  true);
              } catch (SIException e)
              {
                  FFDCFilter.processException(
                                              e,
                                              "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.deleteLocalDurableSubscription",
                                              "1:1580:1.35.2.4",
                                              this);
  
                  SibTr.exception(tc, e);
  
                  // Could not delete consumer dispatcher
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(tc, "deleteLocalDurableSubscription", e);
              }
  
          } // Drop synchronization on durable subscription map
  
          // If all was well, attempt cleanup of the subscription.
          if (rstream != null)
          {
              // Synchronization and exception handling all dealt with in SubscriptionItemStream
              rstream.deleteIfPossible(true);
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "deleteLocalDurableSubscription", subscriptionId);
  
      }