@Override public void deleteEntry(String id) { if (!canDeleteMultiTenantEntry(id)) { throw new OperationNotAllowedException("Operation not allowed in the current tenant context", "label.directory.error.multi.tenant.operationNotAllowed", null); } checkPermission(SecurityConstants.WRITE); checkDeleteConstraints(id); for (Reference reference : getDirectory().getReferences()) { if (reference.getClass() == referenceClass) { reference.removeLinksForSource(id, this); } else { reference.removeLinksForSource(id); } } deleteEntryWithoutReferences(id); getDirectory().invalidateCaches(); }