Delete snapshot by specific contract

@param   contractId Contract ID
@param   ts Timestamp
@throws	JSONException If error occurred
@return	{@link JSONObject}
197530
public JSONObject deleteByContract(String contractId, String ts) throws JSONException {
        return oClient.delete("/team/v3/snapshots/contracts/" + contractId + "/" + ts);
    }
101247
public static void deleteMetadata(GeoPackageCore geoPackage, String table) {

		MetadataReferenceDao metadataReferenceDao = geoPackage
				.getMetadataReferenceDao();
		try {
			if (metadataReferenceDao.isTableExists()) {
				metadataReferenceDao.deleteByTableName(table);
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete Metadata extension. GeoPackage: "
							+ geoPackage.getName() + ", Table: " + table, e);
		}

	}
83619
public void delete() throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "delete");

    //check to see if this has already been deleted.
    //If it has return with out doing anything
    if(!deleted) {
      session.deleteTemporaryDestination(getConsumerSIDestinationAddress());
      deleted = true;
      ((JmsConnectionImpl)session.getConnection()).removeTemporaryDestination(this);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "delete");
  }
952929
@Override
  public void execute(final TSDB tsdb, final HttpQuery query) 
    throws IOException {
    
    // only accept GET/POST/DELETE
    if (query.method() != HttpMethod.GET && query.method() != HttpMethod.POST &&
        query.method() != HttpMethod.DELETE) {
      throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED, 
          "Method not allowed", "The HTTP method [" + query.method().getName() +
          "] is not permitted for this endpoint");
    }
    if (query.method() == HttpMethod.DELETE && 
        !tsdb.getConfig().getBoolean("tsd.http.query.allow_delete")) {
      throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
               "Bad request",
               "Deleting data is not enabled (tsd.http.query.allow_delete=false)");
    }
    
    final String[] uri = query.explodeAPIPath();
    final String endpoint = uri.length > 1 ? uri[1] : ""; 
    
    if (endpoint.toLowerCase().equals("last")) {
      handleLastDataPointQuery(tsdb, query);
    } else if (endpoint.toLowerCase().equals("gexp")){
      handleQuery(tsdb, query, true);
    } else if (endpoint.toLowerCase().equals("exp")) {
      handleExpressionQuery(tsdb, query);
      return;
    } else {
      handleQuery(tsdb, query, false);
    }
  }
969714
private static int delete(final TSDB tsdb, final byte[] table,
      final String[] args) throws Exception {
    final String kind = args[1];
    final String name = args[2];
    try {
      tsdb.deleteUidAsync(kind, name).join();
    } catch (HBaseException e) {
      LOG.error("error while processing delete " + name, e);
      return 3;
    } catch (NoSuchUniqueName e) {
      LOG.error(e.getMessage());
      return 1;
    }
    LOG.info("UID " + kind + ' ' + name + " deleted.");
    return 0;
  }
1339602
public synchronized void removeTimestamp(long ts) throws NoSuchElementException {
    Preconditions.checkState(!closed, "tracker closed ");
    Preconditions.checkState(allocationsInProgress > 0,
        "allocationsInProgress should be > 0 " + allocationsInProgress);
    Objects.requireNonNull(node);
    if (timestamps.remove(ts) == false) {
      throw new NoSuchElementException(
          "Timestamp " + ts + " was previously removed or does not exist");
    }

    allocationsInProgress--;
  }
58940
public void deleteSeen(SITransaction transaction)
  throws SISessionUnavailableException, SISessionDroppedException,
         SIResourceException, SIConnectionLostException, SILimitExceededException,
         SIIncorrectCallException,
         SIErrorException, SIMPMessageNotLockedException
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.entry(CoreSPILockedMessageEnumeration.tc, "deleteSeen",
        new Object[] {new Integer(hashCode()), transaction, this});

    checkValidState("deleteSeen");

    localConsumerPoint.checkNotClosed();

    if (transaction != null && !((TransactionCommon)transaction).isAlive())
    {
      SIIncorrectCallException e = new SIIncorrectCallException( nls.getFormattedMessage(
        "TRANSACTION_DELETE_USAGE_ERROR_CWSIP0778",
           new Object[] { consumerSession.getDestinationAddress() },
           null) );

      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
        SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
        SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteSeen", e);

      throw e;
    }

    // if ordered, check that the provided tran is the current tran
    if (localConsumerPoint.getConsumerManager().getDestination().isOrdered() &&
        !localConsumerPoint.getConsumerManager().isNewTransactionAllowed((TransactionCommon) transaction))
    {
      if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
        SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteSeen", "Ordering error - Transaction active");

      throw new SIIncorrectCallException(
          nls.getFormattedMessage("ORDERED_MESSAGING_ERROR_CWSIP0194",
              new Object[] { localConsumerPoint.getConsumerManager().getDestination().getName(),
              localConsumerPoint.getConsumerManager().getMessageProcessor().getMessagingEngineName()},
              null));
    }

    LocalTransaction localTransaction = null;
    int deletedActiveMessages = 0;
    SIMPMessageNotLockedException notLockedException = null;
    int notLockedExceptionMessageIndex = 0;

    synchronized(this)
    {
      if(currentUnlockedMessage != null)
      {
        removeMessage(currentUnlockedMessage);
        currentUnlockedMessage = null;
      }
      messageAvailable = false;

      if(firstMsg != null)
      {
        // Make the array atleast the size of the number of locked msgs
        SIMessageHandle[] messageHandles = new SIMessageHandle[getNumberOfLockedMessages()];
        LMEMessage pointerMsg = firstMsg;

        LMEMessage removedMsg;
        LMEMessage endMsg;

        // There are two reasons for the currentMsg to be null, either it hasn't
        // been used jet and therefore nothing has been 'seen' so nothing for us
        // to do or it's moved off the end of the list in which case we delete
        // the whole list
        if((currentMsg == null) && endReached)
          endMsg = lastMsg;
        else
          endMsg = currentMsg;

        if(endMsg != null)
        {
          TransactionCommon tranImpl = (TransactionCommon)transaction;
          boolean more = true;

          if(tranImpl != null)
            tranImpl.registerCallback(pointerMsg.message);

          while(more)
          {
            if(pointerMsg == endMsg)
              more = false;

            // If the message is in the MS we need to remove it
            if(pointerMsg.isStored)
            {
              // Create a local tran if we weren't given one
              if(tranImpl == null)
              {
                localTransaction = txManager.createLocalTransaction(!isRMQ());
                tranImpl = localTransaction;
                tranImpl.registerCallback(pointerMsg.message);
              }

              try
              {
                removeMessageFromStore(pointerMsg.message,
                                       tranImpl,
                                       true); // true = decrement active message count (on commit)
              }
              catch (SIMPMessageNotLockedException e)
              {
                // No FFDC code needed
                SibTr.exception(tc, e);
                // See defect 387591
                // We should only get this exception if the message was deleted via
                // the controllable objects i.e. the admin console. If we are here for
                // another reason that we have a real error.

                SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                    new Object[] {
                    "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration",
                    "1:1081:1.154.3.1",
                    e });

                // Place the problem messagehandle in the array
                messageHandles[notLockedExceptionMessageIndex] = pointerMsg.getJsMessage().getMessageHandle();
                notLockedExceptionMessageIndex++;

                notLockedException = e;

//              Because we couldn't do the remove we wouldn't get the callback on the
                // afterCompletion to removeActiveMessages so we should do it here now
                if (localTransaction != null)
                  deletedActiveMessages++;
              }
            }
            // If the message wasn't stored we need to decrement the count now, but we can't
            // while we hold the LME lock.
            else
              deletedActiveMessages++;

            removedMsg = pointerMsg;
            pointerMsg = pointerMsg.next;
            removeMessage(removedMsg);
          }
        }
      }
    } // synchronized

    // Now we've released the lock we can decrement the active message count (which
    // may resume the consumer)
    if(deletedActiveMessages != 0)
      localConsumerPoint.removeActiveMessages(deletedActiveMessages);

    // Commit outside of the lock - it may be expensive and we may need other locks
    // if we fail and events are driven on the messages
    if(localTransaction != null)
    {
      localTransaction.commit();
    }

    if (notLockedException != null)
    {
      if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
        SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteSeen", this);

      throw notLockedException;
    }

    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteSeen", this);
  }
1352710
public static base_responses delete(nitro_service client, String jsoncontenttypevalue[]) throws Exception {
		base_responses result = null;
		if (jsoncontenttypevalue != null && jsoncontenttypevalue.length > 0) {
			appfwjsoncontenttype deleteresources[] = new appfwjsoncontenttype[jsoncontenttypevalue.length];
			for (int i=0;i<jsoncontenttypevalue.length;i++){
				deleteresources[i] = new appfwjsoncontenttype();
				deleteresources[i].jsoncontenttypevalue = jsoncontenttypevalue[i];
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}
889720
@Override
    @Transactional
    public Snapshot transferToStorageComplete(String snapshotId)
        throws SnapshotException {
        try {
            Snapshot snapshot = getSnapshot(snapshotId);
            snapshot = changeSnapshotStatus(snapshot, SnapshotStatus.CLEANING_UP, "");

            File snapshotDir = new File(
                ContentDirUtils.getDestinationPath(snapshot.getName(),
                                                   BridgeConfiguration.getContentRootDir()));

            File zipFile = zipMetadata(snapshotId, snapshotDir);

            DuracloudEndPointConfig source = snapshot.getSource();

            ContentStore store = getContentStore(source);

            ensureMetadataSpaceExists(store);

            String zipChecksum = createChecksumGenerator().generateChecksum(zipFile);

            try {
                new Retrier(4, 1000, 2).execute(new Retriable() {
                    public Object retry() throws Exception {
                        try (FileInputStream zipStream = new FileInputStream(zipFile)) {
                            return store.addContent(Constants.SNAPSHOT_METADATA_SPACE,
                                                    zipFile.getName(),
                                                    zipStream,
                                                    zipFile.length(),
                                                    "application/zip",
                                                    zipChecksum,
                                                    null);
                        }
                    }
                });
            } catch (Exception ex) {
                log.error("failed to upload snapshot zip ("
                          + zipFile.getAbsolutePath() + ") to duracloud: " + ex.getMessage(), ex);
                throw new Exception(ex);
            } finally {
                zipFile.delete();
            }

            FileUtils.deleteDirectory(snapshotDir);

            String spaceId = source.getSpaceId();
            // Call DuraCloud to clean up snapshot
            getSnapshotTaskClient(source).cleanupSnapshot(spaceId);
            log.info("successfully initiated snapshot cleanup on DuraCloud for snapshotId = "
                     + snapshotId + "; spaceId = " + spaceId);

            return snapshot;
        } catch (Exception e) {
            String message = "failed to initiate snapshot clean up: " + e.getMessage();
            log.error(message, e);
            throw new SnapshotManagerException(e.getMessage());
        }
    }
141146
public JSONObject deleteBy(Query query, RequestOptions requestOptions) throws AlgoliaException {
    String paramsString = query.getQueryString();
    JSONObject body = new JSONObject();
    try {
      body.put("params", paramsString);
    } catch (JSONException e) {
      throw new RuntimeException(e);
    }
    return client.postRequest("/1/indexes/" + encodedIndexName + "/deleteByQuery", body.toString(), false, false, requestOptions);
  }
758393
@SuppressWarnings("unchecked")
    public <T extends IEntity> T delete(T entity) throws FMSException {

        IntuitMessage intuitMessage = prepareDelete(entity);

        //execute interceptors
        executeInterceptors(intuitMessage);

        return (T) retrieveEntity(intuitMessage);
    }
1331941
public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {
		if (mappedDelete == null) {
			mappedDelete = MappedDelete.build(dao, tableInfo);
		}
		int result = mappedDelete.delete(databaseConnection, data, objectCache);
		if (dao != null && !localIsInBatchMode.get()) {
			dao.notifyChanges();
		}
		return result;
	}
403108
public void deleteExpired(IEntityLock lock) throws LockingException {
        deleteExpired(new Date(), lock.getEntityType(), lock.getEntityKey());
    }
1177056
public boolean deleteWithCustomTimeout(CompositeVoldemortRequest<K, V> deleteRequestObject) {
        List<Versioned<V>> versionedValues;

        validateTimeout(deleteRequestObject.getRoutingTimeoutInMs());
        boolean hasVersion = deleteRequestObject.getVersion() == null ? false : true;
        String keyHexString = "";
        if(!hasVersion) {
            long startTimeInMs = System.currentTimeMillis();
            if(logger.isDebugEnabled()) {
                ByteArray key = (ByteArray) deleteRequestObject.getKey();
                keyHexString = RestUtils.getKeyHexString(key);
                logger.debug("DELETE without version requested for key: " + keyHexString
                             + " , for store: " + this.storeName + " at time(in ms): "
                             + startTimeInMs + " . Nested GET and DELETE requests to follow ---");
            }
            // We use the full timeout for doing the Get. In this, we're being
            // optimistic that the subsequent delete might be faster all the
            // steps might finish within the allotted time
            deleteRequestObject.setResolveConflicts(true);
            versionedValues = getWithCustomTimeout(deleteRequestObject);
            Versioned<V> versioned = getItemOrThrow(deleteRequestObject.getKey(),
                                                    null,
                                                    versionedValues);

            if(versioned == null) {
                return false;
            }

            long timeLeft = deleteRequestObject.getRoutingTimeoutInMs()
                            - (System.currentTimeMillis() - startTimeInMs);

            // This should not happen unless there's a bug in the
            // getWithCustomTimeout
            if(timeLeft < 0) {
                throw new StoreTimeoutException("DELETE request timed out");
            }

            // Update the version and the new timeout
            deleteRequestObject.setVersion(versioned.getVersion());
            deleteRequestObject.setRoutingTimeoutInMs(timeLeft);

        }
        long deleteVersionStartTimeInNs = System.currentTimeMillis();
        if(logger.isDebugEnabled()) {
            ByteArray key = (ByteArray) deleteRequestObject.getKey();
            keyHexString = RestUtils.getKeyHexString(key);
            debugLogStart("DELETE",
                          deleteRequestObject.getRequestOriginTimeInMs(),
                          deleteVersionStartTimeInNs,
                          keyHexString);
        }
        boolean result = store.delete(deleteRequestObject);
        if(logger.isDebugEnabled()) {
            debugLogEnd("DELETE",
                        deleteRequestObject.getRequestOriginTimeInMs(),
                        deleteVersionStartTimeInNs,
                        System.currentTimeMillis(),
                        keyHexString,
                        0);
        }
        if(!hasVersion && logger.isDebugEnabled()) {
            logger.debug("DELETE without version response received for key: " + keyHexString
                         + ", for store: " + this.storeName + " at time(in ms): "
                         + System.currentTimeMillis());
        }
        return result;
    }
232048
@SuppressWarnings("unchecked")
	@Override
	public <E> SqlEntityDelete<E> delete(final Class<? extends E> entityType) {
		@SuppressWarnings("rawtypes")
		EntityHandler handler = this.getEntityHandler();
		if (!handler.getEntityType().isAssignableFrom(entityType)) {
			throw new IllegalArgumentException("Entity type not supported");
		}

		try {
			TableMetadata metadata = handler.getMetadata(this.transactionManager, entityType);

			SqlContext context = handler.createDeleteContext(this, metadata, entityType, false);
			context.setSqlKind(SqlKind.DELETE);

			return new SqlEntityDeleteImpl<>(this, handler, metadata, context);
		} catch (SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.DELETE, e);
		}
	}
587002
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);

    }
984507
public T delete(String entityId, MnoHttpClient httpClient) throws AuthenticationException, ApiException {
		String jsonBody = httpClient.delete(getInstanceUrl(entityId));

		Type parsingType = new MnoAccountResponseParameterizedType(entitityClass);
		MnoAccountResponse<T> resp = GSON.fromJson(jsonBody, parsingType);

		return resp.getData();
	}