delete topic who is never used
<p>
This will delete all log files and remove node data from zookeeper
</p>

@param topic topic name
@param password auth password
@return number of deleted partitions or -1 if authentication failed
971661
public int deleteLogs(String topic, String password) {
        if (!config.getAuthentication().auth(password)) {
            return -1;
        }
        int value = 0;
        synchronized (logCreationLock) {
            Pool<Integer, Log> parts = logs.remove(topic);
            if (parts != null) {
                List<Log> deleteLogs = new ArrayList<Log>(parts.values());
                for (Log log : deleteLogs) {
                    log.delete();
                    value++;
                }
            }
            if (config.getEnableZookeeper()) {
                topicRegisterTasks.add(new TopicTask(TopicTask.TaskType.DELETE, topic));
            }
        }
        return value;
    }
909522
public void api_credential_credentialId_DELETE(Long credentialId) throws IOException {
		String qPath = "/me/api/credential/{credentialId}";
		StringBuilder sb = path(qPath, credentialId);
		exec(qPath, "DELETE", sb.toString(), null);
	}
425895
public void clearTopics()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "clearTopics");
    
    //we only clear the topics if the remote me
    //has subscribed to some topics on this me.
    if(_outputHandler!=null)
    {
      if (_outputHandler.getTopics() != null)
      {
        Iterator topics = 
          Arrays.asList(_outputHandler.getTopics()).iterator();

        LinkedList topicSpaces = new LinkedList();
        LinkedList topicSpaceMappings = new LinkedList();
        // Iterate through each of the topics and add the matching ts uuid and ts mapping
        for (int i = 0; i < _outputHandler.getTopics().length; i++)
        {
          topicSpaces.add(_outputHandler.getTopicSpaceUuid().toString());   
          topicSpaceMappings.add(_outputHandler.getTopicSpaceMapping());         
        }
  
        //get the NeighbourProxyListener
        NeighbourProxyListener listener = 
          _messageProcessor.getProxyHandler().getProxyListener();
        try
        {
          ExternalAutoCommitTransaction tran =
            _messageProcessor.getTXManager().createAutoCommitTransaction();
          listener.deleteProxySubscription(topics,
                                           topicSpaces.iterator(),
                                           topicSpaceMappings.iterator(),
                                           _outputHandler.getTargetMEUuid(),
                                           _outputHandler.getBusName(),
                                           tran);
        }
        catch(SIResourceException e)
        {
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.runtime.RemoteTopicSpaceControl.clearTopics",
            "1:456:1.34",
            this);
            
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
            new Object[] { "com.ibm.ws.sib.processor.runtime.RemoteTopicSpaceControl.clearTopics", 
                           "1:461:1.34", 
                           SIMPUtils.getStackTrace(e) });
          SibTr.exception(tc, e);
        }
      }
      else
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          SibTr.debug(tc, "No Topics to delete for topicspace with id " + _outputHandler.getDestinationName());
      }
    }//end if PSOH==null

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "clearTopics");        
  }
862359
protected void deleteCollection() throws PolicyIndexException {

        // get root collection management service
        Collection rootCol;
        try {
            rootCol = DatabaseManager.getCollection(m_databaseURI + ROOT_COLLECTION_PATH ,m_user, m_password);
            CollectionManagementService mgtService = (CollectionManagementService) rootCol.getService("CollectionManagementService", "1.0");

            // delete the collection
            mgtService.removeCollection(m_collectionName);

            log.debug("Policy collection deleted");
        } catch (XMLDBException e) {
            throw new PolicyIndexException("Error deleting collection " + e.getMessage(), e);
        }
    }
1303791
def delete_topic_groups(self, group_id, topic_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - PATH - topic_id
        """ID"""
        path["topic_id"] = topic_id

        self.logger.debug("DELETE /api/v1/groups/{group_id}/discussion_topics/{topic_id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/groups/{group_id}/discussion_topics/{topic_id}".format(**path), data=data, params=params, no_data=True)
297084
@Override
	public int unregisterTopicSession(String topic, Session session) {
		if (isInconsistenceContext(topic, session)) {
			return 0;
		}
		logger.debug("'{}' unsubscribe to '{}'", session.getId(), topic);
		if (Constants.Topic.ALL.equals(topic)) {
			for (Map.Entry<String, Collection<Session>> entry : map.entrySet()) {
				Collection<Session> sessions = entry.getValue();
				removeSessionToSessions(session, sessions);
				if (sessions.isEmpty()) {
					map.remove(entry.getKey());
				}
			}
		} else {
			Collection<Session> sessions = map.get(topic);
			removeSessionToSessions(session, sessions);
			if (sessions==null || sessions.isEmpty()) {
				map.remove(topic);
			}
		}
		return getNumberSubscribers(topic);
	}
146477
public static syslog_sslvpn delete(nitro_service client, syslog_sslvpn resource) throws Exception
	{
		resource.validate("delete");
		return ((syslog_sslvpn[]) resource.delete_resource(client))[0];
	}
867864
public void removeTopic(String topic)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeTopic", topic);

        SelectionCriteria[] tmp = selectionCriteriaList;

        // Loop through the selectionCriteriaList
        for (int i = 0; i < selectionCriteriaList.length; ++i)
        {
            if ((selectionCriteriaList[i].getDiscriminator() == null && topic == null) ||
                (topic != null && selectionCriteriaList[i].getDiscriminator().equals(topic)))
            {
                // If there was only one criteria and we have removed it then
                // nullify lists
                if (selectionCriteriaList.length == 1)
                {
                    selectionCriteriaList = null;
                    topics = null;
                }
                else
                {
                    // The criteria match, so resize the array without this
                    // criteria in it.
                    tmp = new SelectionCriteria[selectionCriteriaList.length - 1];
                    System.arraycopy(selectionCriteriaList, 0, tmp, 0, i);
                    System.arraycopy(selectionCriteriaList, i + 1, tmp, i, selectionCriteriaList.length - i - 1);

                    selectionCriteriaList = tmp;

                    // And copy into the topics array so that they always match
                    this.topics = new String[selectionCriteriaList.length];
                    for (int t = 0; t < selectionCriteriaList.length; t++)
                    {
                        topics[t] = (selectionCriteriaList[t] == null) ? null : selectionCriteriaList[t].getDiscriminator();
                    }
                }

                break;
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "removeTopic");
    }
902856
public void removeTopic(String topic)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "removeTopic", topic);

    if (_subscriptionState == null)
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "removeTopic", "Topic not found");
    }
    else
      _subscriptionState.removeTopic(topic);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "removeTopic");
  }
749328
@DELETE
    public Response deleteContent(@PathParam("spaceID") String spaceID,
                                  @PathParam("contentID") String contentID,
                                  @QueryParam("storeID") String storeID) {
        StringBuilder msg = new StringBuilder("deleting content(");
        msg.append(spaceID);
        msg.append(", ");
        msg.append(contentID);
        msg.append(", ");
        msg.append(storeID);
        msg.append(")");

        try {
            contentResource.deleteContent(spaceID, contentID, storeID);
            String responseText = "Content " + contentID + " deleted successfully";
            return responseOk(msg.toString(), responseText);

        } catch (ResourceNotFoundException e) {
            return responseNotFound(msg.toString(), e, NOT_FOUND);

        } catch (ResourceException e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);

        } catch (Exception e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);
        }
    }
882377
@Override
	public final void deleteTemporaryTopic(String topicName) throws JMSException
    {
        DeleteTemporaryTopicQuery query = new DeleteTemporaryTopicQuery();
        query.setTopicName(topicName);
        transportEndpoint.blockingRequest(query);
    }
954709
@Override
    public java.util.concurrent.Future<RemovePermissionResult> removePermissionAsync(String topicArn, String label) {

        return removePermissionAsync(new RemovePermissionRequest().withTopicArn(topicArn).withLabel(label));
    }
189715
def empty_topic(self, topic):
        """"""
        nsq.assert_valid_topic_name(topic)
        return self._request('POST', '/topic/empty', fields={'topic': topic})
431678
@Override
	public void remove(String oid) throws IndexerException {
		log.debug("Deleting " + oid + " from index");
		try {
			solr.deleteByQuery("storage_id:\"" + oid + "\"");
			solr.commit();
		} catch (SolrServerException sse) {
			throw new IndexerException(sse);
		} catch (IOException ioe) {
			throw new IndexerException(ioe);
		}
	}
553753
@Override
    public java.util.concurrent.Future<DeleteTopicResult> deleteTopicAsync(String topicArn,
            com.amazonaws.handlers.AsyncHandler<DeleteTopicRequest, DeleteTopicResult> asyncHandler) {

        return deleteTopicAsync(new DeleteTopicRequest().withTopicArn(topicArn), asyncHandler);
    }
171111
def delete(options = {})
      options = options.merge(topic_arn: @arn)
      resp = @client.delete_topic(options)
      resp.data
    end
1190309
def get_sns_topic_arn(topic_name, account, region):
    
    if topic_name.count(':') == 5 and topic_name.startswith('arn:aws:sns:'):
        return topic_name
    session = boto3.Session(profile_name=account, region_name=region)
    sns_client = session.client('sns')

    topics = sns_client.list_topics()['Topics']

    matched_topic = None
    for topic in topics:
        topic_arn = topic['TopicArn']
        if topic_name == topic_arn.split(':')[-1]:
            matched_topic = topic_arn
            break
    else:
        LOG.critical("No topic with name %s found.", topic_name)
        raise SNSTopicNotFound('No topic with name {0} found'.format(topic_name))
    return matched_topic