@Override public boolean delete(final Object key) { // The CacheWriter should remove from the external storage the entry identified by the specified key. // Note that keys will be in the cache's native format, which means that if the cache is being used by a remoting protocol // such as HotRod or REST and compatibility mode has not been enabled, then they will be encoded in a byte[]. Loggers.LDAP_LOG.trace("[IL0252] LDAP store: Deleting {} entry with key {}", getCacheName(), key); DN dn = new DN(ldapEntryTransformer.resolveRDN(resolveKey(key)), config.ldapDirectory.baseDN); return ldapConnector.deleteEntry(dn); }
@Override public boolean delete(final Object key) { // The CacheWriter should remove from the external storage the entry identified by the specified key. // Note that keys will be in the cache's native format, which means that if the cache is being used by a remoting protocol // such as HotRod or REST and compatibility mode has not been enabled, then they will be encoded in a byte[]. Loggers.LDAP_LOG.trace("[IL0252] LDAP store: Deleting {} entry with key {}", getCacheName(), key); DN dn = new DN(ldapEntryTransformer.resolveRDN(resolveKey(key)), config.ldapDirectory.baseDN); return ldapConnector.deleteEntry(dn); }
if (ldapConnector.deleteEntry(pair.getLeft())) {
if (ldapConnector.deleteEntry(pair.getLeft())) {
/** * Deletes all entries under the base DN. * * @return The number of deleted entries, zero if none found. */ public int deleteEntries() { SearchRequest request = new SearchRequest( config.ldapDirectory.baseDN.toString(), SearchScope.ONE, MATCH_ANY_FILTER, SearchRequest.NO_ATTRIBUTES); List<String> entryDNs = new LinkedList<>(); doSearch(request, entry -> entryDNs.add(entry.getDN())); int count = 0; for(String dn: entryDNs) { try { if (deleteEntry(new DN(dn))) { ++count; } } catch (LDAPException e) { throw new PersistenceException(e.getMessage(), e); } } return count; }
/** * Deletes all entries under the base DN. * * @return The number of deleted entries, zero if none found. */ public int deleteEntries() { SearchRequest request = new SearchRequest( config.ldapDirectory.baseDN.toString(), SearchScope.ONE, MATCH_ANY_FILTER, SearchRequest.NO_ATTRIBUTES); List<String> entryDNs = new LinkedList<>(); doSearch(request, entry -> entryDNs.add(entry.getDN())); int count = 0; for(String dn: entryDNs) { try { if (deleteEntry(new DN(dn))) { ++count; } } catch (LDAPException e) { throw new PersistenceException(e.getMessage(), e); } } return count; }
if (ldapConnector.deleteEntry(pair.getLeft())) {