/* (non-Javadoc)
@see com.ibm.ws.sib.msgstore.cache.xalist.Link#assertCanDelete(long)
494101
public SevereMessageStoreException assertCanDelete(final PersistentTransaction transaction)
    {
    	SevereMessageStoreException ex = super.assertCanDelete(transaction);
        if (null == ex)
        {
            if (0 < _referenceCount)
            {
                ex = new SevereMessageStoreException("Cannot delete Item with references");
                FFDCFilter.processException(ex, "ItemLink.delete", "1:111:1.104.1.1");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception :  Cannot delete Item with references");
            }
        }
        return ex;
    }
1354650
@DELETE
    @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
    @Path("/{name}")
    public Response delete(@Auth final DbCredential credential, @PathParam("name") final String name){
        if(!credential.getRoles().contains(AvailableRoles.DATA_DELETER)){
            throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
        }

        LOG.info("Got a delete license request.");
        getLicenseHandler().deleteLicense(name);
        cacheUtils.clear(CacheName.PROMOTION_REPORTS);
        return Response.ok("done").build();
    }
1273351
public boolean deleteExisting(final File file) {
    if (!file.exists()) {
      return true;
    }
    boolean deleted = false;
    if (file.canWrite()) {
      deleted = file.delete();
    } else {
      LogLog.debug(file + " is not writeable for delete (retrying)");
    }
    if (!deleted) {
      if (!file.exists()) {
        deleted = true;
      } else {
        file.delete();
        deleted = (!file.exists());
      }
    }
    return deleted;
  }
734329
public void saveAndDeleteEntities(
        final CmsEntity lastEditedEntity,
        final List<String> deletedEntites,
        final boolean clearOnSuccess,
        final I_CmsSimpleCallback<Boolean> callback) {

        CmsRpcAction<CmsSaveResult> asyncCallback = new CmsRpcAction<CmsSaveResult>() {

            @Override
            public void execute() {

                start(200, true);
                getService().saveAndDeleteEntities(
                    lastEditedEntity,
                    m_clientId,
                    deletedEntites,
                    getSkipPaths(),
                    m_locale,
                    clearOnSuccess,
                    this);
            }

            @Override
            protected void onResponse(CmsSaveResult result) {

                stop(false);
                if ((result != null) && result.hasErrors()) {
                    showValidationErrorDialog(result.getValidationResult());
                } else {
                    callback.execute(Boolean.valueOf((result != null) && result.isHasChangedSettings()));
                    if (clearOnSuccess) {
                        destroyForm(true);
                    }
                }
            }
        };
        asyncCallback.execute();
    }
311667
public void deleteTrait(String guid, String traitName) throws AtlasServiceException {
        callAPIWithBodyAndParams(API.DELETE_TRAITS, null, guid, TRAITS, traitName);
    }
1274662
@Override
    public void deleteServerLease(String recoveryIdentity) throws Exception {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "deleteServerLease", new java.lang.Object[] { recoveryIdentity, this });

        Connection conn = null;
        boolean sqlSuccess = false;
        SQLException currentSqlEx = null;

        Statement deleteStmt = null;

        try
        {
            // Have we acquired the reference to the DataSource yet?
            if (_theDS == null)
            {
                _theDS = getDataSourceFromProperties();
                // We've looked up the DS, so now we can get a JDBC connection
                if (_theDS != null)
                {
                    conn = getConnection(_theDS);
                }
            }
            else
            {
                // Try and get a new connection
                conn = _theDS.getConnection();
            }

            // If we were unable to get a connection, throw an exception
            if (conn == null)
            {
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "deleteServerLease", "Null connection InternalLogException");
                throw new InternalLogException("Failed to get JDBC Connection", null);
            }

            if (tc.isDebugEnabled())
                Tr.debug(tc, "Set autocommit FALSE on the connection");
            conn.setAutoCommit(false);

            // We can go ahead and write to the Database
            deleteStmt = conn.createStatement();

            String deleteString = "DELETE FROM " + _leaseTableName +
                                  " WHERE SERVER_IDENTITY='" + recoveryIdentity + "'";
            if (tc.isDebugEnabled())
                Tr.debug(tc, "delete server lease for " + recoveryIdentity + "using string " + deleteString);

            int ret = deleteStmt.executeUpdate(deleteString);

            if (tc.isDebugEnabled())
                Tr.debug(tc, "Have deleted row with return: " + ret + ", commit the change");

            conn.commit();
            Tr.audit(tc, "WTRN0108I: Deleted Lease for server with recovery identity " + recoveryIdentity);
        }
        // Catch and report an SQLException. In the finally block we'll determine whether the condition is transient or not.
        catch (SQLException sqlex)
        {
            if (tc.isDebugEnabled())
                Tr.debug(tc, "Lease delete failed with exception: " + sqlex);
        } finally
        {

            if (deleteStmt != null && !deleteStmt.isClosed())
                deleteStmt.close();
            if (conn != null)
                conn.close();
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "deleteServerLease");
    }
497328
public void delete() throws DocumentStoreNotDeletedException {
        try {
            this.close();
        } catch (Exception e) {
            // caught exception could be something benign like DocumentStore already closed, so just log
            logger.log(Level.WARNING, "Caught exception whilst closing DocumentStore in delete()", e);
        }
        if (!location.exists()) {
            String msg = String.format("DocumentStore %s doesn't exist on disk", location);
            logger.warning(msg);
            throw new DocumentStoreNotDeletedException(msg);
        } else {
            try {
                FileUtils.deleteDirectory(location);
            } catch (IOException ioe) {
                String msg = String.format("DocumentStore %s not deleted", location);
                logger.log(Level.WARNING, msg, ioe);
                throw new DocumentStoreNotDeletedException(msg, ioe);
            }
            eventBus.post(new DocumentStoreDeleted(databaseName));
        }
    }
1294040
static void assertTableExistence(CallInfo callInfo, DB db, String tableName, boolean expected) {
    boolean actual = tableExists(callInfo, db, tableName);
    SimpleAssertion assertion = new SimpleAssertion(null, expected, actual);
    db.log(callInfo, assertion);
    if (!assertion.passed()) {
      throw new DBAssertionError(callInfo.getMessage());
    }
  }
980712
@Override
	public synchronized void delete(int type, String url) throws DatabaseException {
    	try {
			psDeleteUrls.setInt(1, type);
			psDeleteUrls.setString(2, url);
			psDeleteUrls.executeUpdate();
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
902774
@Deprecated
    public void deleteDB(String dbName, String confirm) {
        if (!"delete database".equals(confirm)) {
            throw new IllegalArgumentException("Invalid confirm!");
        }
        deleteDB(dbName);
    }
798139
@Override
    public CompletableFuture<DeleteScopeStatus> deleteScope(final String scopeName) {
        return getScope(scopeName).deleteScope().handle((result, e) -> {
            Throwable ex = Exceptions.unwrap(e);
            if (ex == null) {
                return DeleteScopeStatus.newBuilder().setStatus(DeleteScopeStatus.Status.SUCCESS).build();
            }
            if (ex instanceof StoreException.DataNotFoundException) {
                return DeleteScopeStatus.newBuilder().setStatus(DeleteScopeStatus.Status.SCOPE_NOT_FOUND).build();
            } else if (ex instanceof StoreException.DataNotEmptyException) {
                return DeleteScopeStatus.newBuilder().setStatus(DeleteScopeStatus.Status.SCOPE_NOT_EMPTY).build();
            } else {
                log.debug("DeleteScope failed due to {} ", ex);
                return DeleteScopeStatus.newBuilder().setStatus(DeleteScopeStatus.Status.FAILURE).build();
            }
        });
    }
559263
@SuppressWarnings("unchecked")
	@Override
	public int delete(final Object entity) {
		@SuppressWarnings("rawtypes")
		EntityHandler handler = this.getEntityHandler();
		if (!handler.getEntityType().isInstance(entity)) {
			throw new IllegalArgumentException("Entity type not supported");
		}

		try {
			Class<?> type = entity.getClass();
			TableMetadata metadata = handler.getMetadata(this.transactionManager, type);
			SqlContext context = handler.createDeleteContext(this, metadata, type, true);
			context.setSqlKind(SqlKind.DELETE);
			handler.setDeleteParams(context, entity);
			return handler.doDelete(this, context, entity);
		} catch (SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.DELETE, e);
		}
	}
221539
public void performDeletion()
    {
        if(deletionMap == null)
            return;
        else
        {
            PersistenceBroker broker = tx.getBroker();
            Iterator it = deletionMap.values().iterator();
            while(it.hasNext())
            {
                NamedEntry namedEntry = (NamedEntry) it.next();
                broker.delete(namedEntry);
            }
        }
    }
1032360
Result executeDeleteStatement(Session session) {

        int                       count   = 0;
        RowSetNavigatorLinkedList oldRows = new RowSetNavigatorLinkedList();
        RangeIterator it = RangeVariable.getIterator(session,
            targetRangeVariables);

        while (it.next()) {
            Row currentRow = it.getCurrentRow();

            oldRows.add(currentRow);
        }

        count = delete(session, baseTable, oldRows);

        if (restartIdentity && targetTable.identitySequence != null) {
            targetTable.identitySequence.reset();
        }

        return Result.getUpdateCountResult(count);
    }
575110
public void remove(Token token,
                       boolean requiresCurrentCheckpoint)
                    throws ObjectManagerException {
        final String methodName = "remove";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        methodName,
                        new Object[] { token, new Boolean(requiresCurrentCheckpoint) });

        super.remove(token, requiresCurrentCheckpoint);

        // Cancel any writing.
        managedObjectsToWrite.remove(new Long(token.storedObjectIdentifier));

        // Schedule the deletion of the disk copy.
        if (storeStrategy == STRATEGY_SAVE_ONLY_ON_SHUTDOWN) {
            // We don't need to add Objects that are not in the directory as they wont need to be 
            // deleted. This is important for Stores only written at shutdown as they may 
            // accumulate a lot of delete operations.
            Directory.StoreArea storeArea = (Directory.StoreArea) directory.getEntry(new Long(token.storedObjectIdentifier));
            if (storeArea != null)
                tokensToDelete.put(new Long(token.storedObjectIdentifier),
                                   token);

        } else if (requiresCurrentCheckpoint) {
            // The checkpoint logic in ObjectManagerState never calls flush until all of the
            // requiresCurrentCheckpoint transactions have been checkpointed. So no need to synchronize 
            // on checkpointManagedObjectsToWrite.
            if (checkpointTokensToDelete == null)
                captureCheckpointManagedObjects();

            checkpointTokensToDelete.put(new Long(token.storedObjectIdentifier),
                                         token);

        } else {
            // If flush() gets ahead of our addition to this table it will be deleted
            // next time.
            // Repeat attempts to insert the token into the tokensToDelete until we find one that 
            // we can be sure was included in a flush().
            for (;;) {
                java.util.Map myTokensToDelete = tokensToDelete;
                myTokensToDelete.put(new Long(token.storedObjectIdentifier),
                                     token);
                // Make sure the flush() did not steal tokensToDelete while we were adding to it.
                if (myTokensToDelete == tokensToDelete)
                    break;
            } // for (;;).
        }

        // Cancel the ManagedObjects reference from the cache, if it is in memory. We might get the wrong
        // ManagedObject if the slot has been reused, that's OK because it's just the same as if it 
        // is being reused.
        if (token.managedObjectReference != null) {
            ManagedObject managedObject = (ManagedObject) token.managedObjectReference.get();
            if (managedObject != null) {
                java.lang.ref.SoftReference[] localCachedManagedObjects = cachedManagedObjects;
                if (managedObject.objectStoreCacheIndex < localCachedManagedObjects.length)
                    localCachedManagedObjects[managedObject.objectStoreCacheIndex] = null;
            }
        } // if (token.managedObjectReference != null).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       methodName);
    }
922
@Override
  public boolean delete(Object bean) throws OptimisticLockException {
    methodCalls.add(MethodCall.of("bean").with("bean", bean));
    capturedBeans.addDeleted(bean);
    if (persistDeletes) {
      return delete.delete(bean, null);
    }
    return true;
  }
462303
@Override
    public Delete createDelete(URI id, String tableName) throws IOException {
        Delete del = null;
        HTable hTable = getTable(tableName);
        if (hTable != null) {
            del = new Delete(Bytes.toBytes(id.toString()));
        }
        return del;
    }