docs: public ConsumableKey attachToLocalDurableSubscription(
                                                            LocalConsumerPoint consumerPoint,
                                                            ConsumerDispatcherState subState)
                      throws
                      SIDurableSubscriptionMismatchException,
                      SIDurableSubscriptionNotFoundException,
                      SIDestinationLockedException,
                      SISelectorSyntaxException,
                      SIDiscriminatorSyntaxException,
                      SINotPossibleInCurrentConfigurationException,
                      SIResourceException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(
                          tc,
                          "attachToLocalDurableSubscription",
                          new Object[] { consumerPoint, subState });
  
          ConsumerDispatcher consumerDispatcher = null;
          ConsumableKey data = null;
          /*
           * Lock the list of durable subscriptions to prevent others creating/using an
           * identical subscription
           */
          synchronized (_consumerDispatchersDurable)
          {
              /*
               * Get the consumerDispatcher. If it does not exist then we create it. If it exists
               * already and is EXACTLY the same, then we connect to it. If it exists but only
               * the same in ID then throw exception.
               */
              consumerDispatcher = getDurableSubscriptionConsumerDispatcher(subState);
  
              if (consumerDispatcher != null)
              {
                  // If subscription already has consumers attached then reject the create
                  // unless we are setting up a cloned subscriber.
                  if (consumerDispatcher.hasConsumersAttached() && !subState.isCloned())
                  {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                          SibTr.exit(
                                     tc,
                                     "attachToLocalDurableSubscription",
                                     "Consumers already attached");
  
                      throw new SIDestinationLockedException(
                                      nls.getFormattedMessage(
                                                              "SUBSCRIPTION_IN_USE_ERROR_CWSIP0152",
                                                              new Object[] {
                                                                            subState.getSubscriberID(),
                                                                            _messageProcessor.getMessagingEngineName() },
                                                              null));
                  }
  
                  // Attach to the consumerDispatcher if it is EXACTLY the same
                  if (!consumerDispatcher.getConsumerDispatcherState().isReady()
                      || !consumerDispatcher.getConsumerDispatcherState().equals(subState))
                  {
                      // Found consumer dispatcher but only the IDs match, therefore cannot connect
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                          SibTr.exit(tc, "attachToLocalDurableSubscription", subState);
  
                      throw new SIDurableSubscriptionMismatchException(
                                      nls.getFormattedMessage(
                                                              "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
                                                              new Object[] {
                                                                            subState.getSubscriberID(),
                                                                            _messageProcessor.getMessagingEngineName() },
                                                              null));
                  }
  
                  // If security is enabled, then check the user who is attempting
                  // to attach matches the user who created the durable sub.
                  if (_messageProcessor.isBusSecure())
                  {
                      if (!consumerDispatcher
                                      .getConsumerDispatcherState()
                                      .equalUser(subState))
                      {
                          // Users don't match
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                              SibTr.exit(tc, "attachToLocalDurableSubscription", subState);
  
                          throw new SIDurableSubscriptionMismatchException(
                                          nls.getFormattedMessage(
                                                                  "USER_NOT_AUTH_ACTIVATE_ERROR_CWSIP0312",
                                                                  new Object[] {
                                                                                subState.getUser(),
                                                                                subState.getSubscriberID(),
                                                                                _baseDestinationHandler.getName() },
                                                                  null));
                      }
                  }
  
                  // Attach the consumerpoint to the subscription.
                  data =
                                  (ConsumableKey) consumerDispatcher.attachConsumerPoint(
                                                                                         consumerPoint,
                                                                                         null,
                                                                                         consumerPoint.getConsumerSession().getConnectionUuid(),
                                                                                         consumerPoint.getConsumerSession().getReadAhead(),
                                                                                         consumerPoint.getConsumerSession().getForwardScanning(),
                                                                                         null);
              } else
              {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(
                                 tc,
                                 "attachToLocalDurableSubscription",
                                 "SIDurableSubscriptionNotFoundException");
                  throw new SIDurableSubscriptionNotFoundException(
                                  nls.getFormattedMessage(
                                                          "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146",
                                                          new Object[] {
                                                                        subState.getSubscriberID(),
                                                                        _messageProcessor.getMessagingEngineName() },
                                                          null));
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "attachToLocalDurableSubscription", data);
  
          return data;
      }