Attempt to delete a durable subscription on a remote ME.
10082
public static void deleteRemoteDurableSub(
    MessageProcessor MP,
    String subName,
    String userName,
    SIBUuid8 remoteMEUuid)
    throws SIResourceException,
           SIDurableSubscriptionNotFoundException,
           SIDestinationLockedException,
           SINotAuthorizedException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "deleteRemoteDurableSub", 
        new Object[]{MP, subName, userName, remoteMEUuid});

    // Issue the request
    int status = issueDeleteDurableRequest(MP, subName, userName, remoteMEUuid);

    switch (status)
    {
      case DurableConstants.STATUS_SUB_NOT_FOUND:
      {      
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
          SibTr.exit(tc, "deleteRemoteDurableSub", "SIDurableSubscriptionNotFoundException");

        throw new SIDurableSubscriptionNotFoundException(
          nls.getFormattedMessage(
            "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072",
            new Object[] { subName,
                remoteMEUuid },
            null));
      }
        
      case DurableConstants.STATUS_SUB_CARDINALITY_ERROR:
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())       
          SibTr.exit(tc, "deleteRemoteDurableSub", "SIDurableSubscriptionLockedException");

        throw new SIDestinationLockedException(
          nls.getFormattedMessage(
            "SUBSCRIPTION_IN_USE_ERROR_CWSIP0152", 
            new Object[] { subName,
                remoteMEUuid }, 
            null));
      }

      case DurableConstants.STATUS_NOT_AUTH_ERROR:
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())       
          SibTr.exit(tc, "deleteRemoteDurableSub", "SINotAuthorizedException");

        throw new SINotAuthorizedException(
          nls.getFormattedMessage(
            "USER_NOT_AUTH_DELETE_ERROR_CWSIP0311",
            new Object[] { userName, subName, null},
            null));
      }
      
      case DurableConstants.STATUS_SIB_LOCKED_ERROR:
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())       
          SibTr.exit(tc, "deleteRemoteDurableSub", "SIDestinationLockedException");

        throw new SIDestinationLockedException(
            nls.getFormattedMessage(
              "SUBSCRIPTION_IN_USE_ERROR_CWSIP0153",
              new Object[] { subName,
                  remoteMEUuid },
              null));
      }
     
      case DurableConstants.STATUS_SUB_GENERAL_ERROR:
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
          SibTr.exit(tc, "deleteRemoteDurableSub", "SIResourceException");
          
        SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
        new Object[] {
          "com.ibm.ws.sib.processor.impl.DurableInputHandler",
          "1:1053:1.52.1.1" });
          
        throw new SIResourceException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0001",
            new Object[] {
              "com.ibm.ws.sib.processor.impl.DurableInputHandler",
              "1:1060:1.52.1.1" },
            null));
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "deleteRemoteDurableSub");
    
  }
363116
async def unsubscribe(self):
        
        await self._nc.unsubscribe(self.sid)

        try:
            # Stop the processing task for the subscription.
            sub = self._sc._sub_map[self.inbox]
            sub._msgs_task.cancel()
            del self._sc._sub_map[self.inbox]
        except KeyError:
            pass

        req = protocol.UnsubscribeRequest()
        req.clientID = self._sc._client_id
        req.subject = self.subject
        req.inbox = self.ack_inbox

        if self.durable_name is not None:
            req.durableName = self.durable_name

        msg = await self._nc.request(
            self._sc._unsub_req_subject,
            req.SerializeToString(),
            self._sc._connect_timeout,
            )
        resp = protocol.SubscriptionResponse()
        resp.ParseFromString(msg.data)

        if resp.error != "":
            raise StanError(resp.error)
19088
@Override
    public void deleteDurableSubscription(String subscriptionName,
                                          String durableSubscriptionHome,
                                          String alternateUser)

                    throws SIConnectionUnavailableException, SIConnectionDroppedException,
                    SIResourceException, SIConnectionLostException,
                    SIErrorException,
                    SINotAuthorizedException,
                    SIIncorrectCallException,
                    SIDurableSubscriptionNotFoundException,
                    SIDestinationLockedException
    {

        //liberty code change : chetan
        //Since there is no ME-ME communication the durableSubscriptionHome is always the local ME 
        durableSubscriptionHome = _messageProcessor.getMessagingEngineName();

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConnection.tc, "deleteDurableSubscription",
                        new Object[] { this, subscriptionName, durableSubscriptionHome, alternateUser });

        // Synchronize on the connection object, we don't want the connection closing
        // while we try to delete the subscription.
        synchronized (this)
        {
            SIBUuid8 durableHomeID =
                            checkDurableSubscriptionInformation(subscriptionName,
                                                                durableSubscriptionHome,
                                                                null,
                                                                false,
                                                                false,
                                                                true,
                                                                false);

            HashMap durableSubs = _destinationManager.getDurableSubscriptionsTable();

            // Is durableHome local?
            if (durableHomeID.equals(_messageProcessor.getMessagingEngineUuid()))
            {
                // Yes, then there should be an existing consumer dispatcher which we'll
                // invoke directly
                synchronized (durableSubs)
                {
                    //Look up the consumer dispatcher for this subId in the system durable subs list
                    ConsumerDispatcher cd =
                                    (ConsumerDispatcher) durableSubs.get(subscriptionName);

                    // Check that the durable subscription existed
                    if (cd == null)
                    {
                        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
                            SibTr.exit(CoreSPIConnection.tc, "deleteDurableSubscription");

                        throw new SIDurableSubscriptionNotFoundException(
                                        nls.getFormattedMessage(
                                                                "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072",
                                                                new Object[] { subscriptionName,
                                                                              _messageProcessor.getMessagingEngineName() },
                                                                null));
                    }

                    //Obtain the destination from the consumer dispatcher
                    DestinationHandler destination = cd.getDestination();

                    // Check that the destination is a TopicSpace
                    if (!destination.isPubSub())
                    {
                        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
                            SibTr.exit(CoreSPIConnection.tc, "deleteDurableSubscription", "SIDestinationWrongTypeException");

                        SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
                                    new Object[] {
                                                  "com.ibm.ws.sib.processor.impl.ConnectionImpl",
                                                  "1:2759:1.347.1.25" });

                        throw new SIErrorException(
                                        nls.getFormattedMessage(
                                                                "INTERNAL_MESSAGING_ERROR_CWSIP0001",
                                                                new Object[] { "ConnectionImpl",
                                                                              "1:2765:1.347.1.25" },
                                                                null));
                    }

                    // decalre variables used in security checks
                    AuthUtils sibAuthUtils = _messageProcessor.getAuthorisationUtils();
                    String topicName = null;
                    String topicSpaceName = null;
                    String theUser = null;

                    // If security is disabled then we'll bypass the check
                    if (_isBusSecure)
                    {
                        // get the consumer dispatcher state from the consumer dispatcher
                        ConsumerDispatcherState subState = cd.getConsumerDispatcherState();

                        topicName = subState.getTopic();
                        topicSpaceName = subState.getTopicSpaceName();

                        // Check that the user who is attempting to delete this durable subscription
                        // matches that set in the CD state when the subscription was created           
                        boolean isPriv = false;
                        if (alternateUser == null)
                        {
                            theUser = getResolvedUserid();
                            isPriv = isSIBServerSubject();
                        }
                        else
                        {
                            theUser = alternateUser;
                        }

                        boolean userMatch = subState.equalUser(theUser, isPriv);

                        // Throw not auth exception if the user who is trying to delete the durable
                        // subscription isn't the same user that created the subscription
                        if (!userMatch)
                        {
                            // ensure that a security audit event takes place for this authorization failure
                            sibAuthUtils.deleteDurSubAuthorizationFailed(theUser, topicName, topicSpaceName, 0L);

                            // trace the exception
                            if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
                                SibTr.exit(CoreSPIConnection.tc, "deleteDurableSubscription", "SINotAuthorizedException");

                            // throw the exception
                            throw new SINotAuthorizedException(
                                            nls.getFormattedMessage(
                                                                    "USER_NOT_AUTH_DELETE_ERROR_CWSIP0311",
                                                                    new Object[] { theUser, subscriptionName, destination.getName() },
                                                                    null));
                        }
                    }

                    //Call the deleteDurableSubscription method on the destination
                    destination.deleteDurableSubscription(subscriptionName, durableSubscriptionHome);

                    if (_isBusSecure)
                    {
                        // ensure that a security audit event takes place for this successful dur sub delete
                        sibAuthUtils.deleteDurSubAuthorizationPassed(theUser, topicName, topicSpaceName, 0L);
                    }
                }
            }
            else
            {
                // No, issue a remote request
                DurableInputHandler.deleteRemoteDurableSub(_messageProcessor,
                                                           subscriptionName,
                                                           getResolvedUserid(),
                                                           durableHomeID);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConnection.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConnection.tc, "deleteDurableSubscription");

    }
1374137
def unsubscribe(self, socket_id, channel):
        """"""
        con = self._get_connection(socket_id, create=False)
        if con is not None:
            con.subscriptions.discard(channel)
        try:
            self.subscriptions[channel].discard(socket_id)
        except KeyError:
            pass
875617
function(client, subscriptions, channel, callback, done_callback) {
    if (subscriptions[channel]===undefined)
        return;
    subscriptions[channel].splice(subscriptions[channel].indexOf(callback), 1);
    if (subscriptions[channel].length===0) {
        delete subscriptions[channel];
        client.unsubscribe(channel, function() {
            // If there is a done_callback defined, execute it
            if (done_callback!==undefined) done_callback();
        });
    }
}
648381
def delete_bundle(self, bundleId):
        """"""
        if not bundleId:
            return None
        url = self.__get_base_bundle_url() + "/" + bundleId
        response = self.__perform_rest_call(requestURL=url, restType='DELETE')
        return response
88440
def delete(method, hmc, uri, uri_parms, logon_required):
        """"""
        try:
            resource = hmc.lookup_by_uri(uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        resource.manager.remove(resource.oid)
1303536
def remove(self, address):
        
        with self._lock:
            try:
                subscriber = self.addr_sub[address]
            except KeyError:
                return False
            LOGGER.info("Subscriber removing address %s", str(address))
            if self.poller:
                self.poller.unregister(subscriber)
            del self.addr_sub[address]
            del self.sub_addr[subscriber]
            subscriber.close()
            return True
1047538
def removeRemote(self, remote: Remote, clear=True):
        
        name = remote.name
        pkey = remote.publicKey
        vkey = remote.verKey
        if name in self.remotes:
            self.remotes.pop(name)
            self.remotesByKeys.pop(pkey, None)
            self.verifiers.pop(vkey, None)
        else:
            logger.info('No remote named {} present')
503746
def remove(cls, resource_id, parent_id=None, grandparent_id=None,
               wait=True, timeout=None):
        """"""
        raise exception.NotSupported(feature="DELETE",
                                     context="VirtualSwitchManager")
647956
def remove_from_watched(self, watched):
        
        assert isinstance(watched, github.Repository.Repository), watched
        headers, data = self._requester.requestJsonAndCheck(
            "DELETE",
            "/repos/" + watched._identity + "/subscription"
        )
141467
def delete_subscription(self, subscription_id):
        
        url = self.SUBSCRIPTIONS_ID_URL % subscription_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.delete_request()
177632
def delete_subscription(self, subscription_id):
        
        return self.client._delete(self.url + 'subscriptions/{}'.format(subscription_id), headers=self.get_headers())
1190270
protected static void handleDeleteDurable(
    DestinationManager DM,
    ControlDeleteDurable msg,
    MessageProcessor MP)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "handleDeleteDurable", new Object[] {DM, msg, MP});

    int status = STATUS_SUB_GENERAL_ERROR;
    
    try 
    {
      // Track down a handler for this durable sub, error if we can't find one
      String  subName     = msg.getDurableSubName();
      HashMap durableSubs = DM.getDurableSubscriptionsTable();

      synchronized (durableSubs)
      {
        //Look up the consumer dispatcher for this subId in the system durable subs list
        ConsumerDispatcher cd =
          (ConsumerDispatcher) durableSubs.get(subName);
          
        // Check that the durable subscription existed
        if (cd == null) 
        {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
            SibTr.exit(tc, "handleDeleteDurable", "SIDurableSubscriptionNotFoundException");
          
          status = DurableConstants.STATUS_SUB_NOT_FOUND;
          
          throw new SIDurableSubscriptionNotFoundException(
            nls.getFormattedMessage(
              "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072",
              new Object[] { subName,                
                             MP.getMessagingEngineName() },
              null));
        }
          
        // Obtain the destination from the consumer dispatcher
        // A cast error here will result in an error sent back to the caller
        BaseDestinationHandler handler = cd.getDestination();

        boolean userMatch = true;
        // If security is disabled then we'll bypass the check
        if(MP.isBusSecure())
        {                
          // Check that the user who is attempting to delete this durable subscription
          // matches that set in the CD state when the subscription was created
        
          ConsumerDispatcherState subState = cd.getConsumerDispatcherState();
          String theUser = msg.getSecurityUserid(); 
          if(theUser == null)
          {
            if(subState.getUser() != null)
              userMatch = false;
          }
          else
          {
            if (!theUser.equals(subState.getUser()))
              userMatch = false;  
          }
        }  
        // Handle the case where the users do not match
        if (!userMatch)
        {  
          status = DurableConstants.STATUS_NOT_AUTH_ERROR;
        }        
        else
        {
          status = handler.deleteDurableFromRemote(subName);
        }
      }
    }
    catch (SIDurableSubscriptionNotFoundException e) 
    {
       // No FFDC code needed
       SibTr.exception(tc, e);
    }
    catch (Exception e)
    {
      // FFDC
      // Any other exception is unexpected
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.DurableOutputHandler.handleDeleteDurable",
        "1:387:1.45.1.1",
        DurableOutputHandler.class);
    }
    
    // Forward the status to the caller and we're done
    SIBUuid8              sender = msg.getGuaranteedSourceMessagingEngineUUID(); 
    ControlDurableConfirm reply  = createDurableConfirm(MP, sender, msg.getRequestID(), status);
    MP.getMPIO().sendToMe(sender, SIMPConstants.CONTROL_MESSAGE_PRIORITY, reply);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "handleDeleteDurable");
  }
1319481
def _remove_player(self, player_id):
        
        player = self._mpris_players.get(player_id)
        if player:
            if player.get("subscription"):
                player["subscription"].disconnect()
            del self._mpris_players[player_id]
713283
def cancel_subscription(self, idempotency_key=None, **params):
        """"""
        warnings.warn(
            'The `cancel_subscription` method is deprecated. Instead, use the '
            '`subscriptions` resource on the customer object to cancel a '
            'subscription',
            DeprecationWarning)
        url = self.instance_url() + '/subscription'
        headers = populate_headers(idempotency_key)
        d = self.request('delete', url, params, headers)
        d.addCallback(lambda response: self.refresh_from(
            {'subscription': response}, api_key, True))
        return d.addCallback(lambda _: self.subscription)
1255562
def remove(self):
        
        self.logger.debug('Remove subscription from server...')

        data = {
            'command': 'unsubscribe',
            'identifier': self._identifier_string()
        }

        self.connection.send(data)
        self.state = 'unsubscribed'