InfinispanEntry<K,V> infinispanEntry = entityTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
LDAPWriteStrategy writeStrategy = ldapEntry.getWriteStrategy(); if (ldapConnector.addEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0256] LDAP store: Added new {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (ldapConnector.replaceEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0257] LDAP store: Replaced {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (! ldapConnector.addEntry(ldapEntry.getEntry())) { throw new PersistenceException("Failed recovery from concurrent LDAP delete (" + getCacheName() + " cache): " + ldapEntry.getEntry().getDN()); if (ldapConnector.replaceEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0265] LDAP store: Replaced {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (ldapConnector.addEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0266] LDAP store: Added new {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (! ldapConnector.replaceEntry(ldapEntry.getEntry())) { throw new PersistenceException("Failed recovery from concurrent LDAP add (" + getCacheName() + " cache): " + ldapEntry.getEntry().getDN());
LDAPWriteStrategy writeStrategy = ldapEntry.getWriteStrategy(); if (ldapConnector.addEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0256] LDAP store: Added new {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (ldapConnector.replaceEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0257] LDAP store: Replaced {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (! ldapConnector.addEntry(ldapEntry.getEntry())) { throw new PersistenceException("Failed recovery from concurrent LDAP delete (" + getCacheName() + " cache): " + ldapEntry.getEntry().getDN()); if (ldapConnector.replaceEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0265] LDAP store: Replaced {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (ldapConnector.addEntry(ldapEntry.getEntry())) { Loggers.LDAP_LOG.trace("[IL0266] LDAP store: Added new {} entry with DN {}", getCacheName(), ldapEntry.getEntry().getDN()); return; // success if (! ldapConnector.replaceEntry(ldapEntry.getEntry())) { throw new PersistenceException("Failed recovery from concurrent LDAP add (" + getCacheName() + " cache): " + ldapEntry.getEntry().getDN());
InfinispanEntry<K,V> infinispanEntry = entityTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
InfinispanEntry<K,V> infinispanEntry = entityTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
InfinispanEntry<K,V> infinispanEntry = ldapEntryTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
InfinispanEntry<K,V> infinispanEntry = ldapEntryTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
@Override public void process(final KeyFilter<? super K> keyFilter, final CacheLoaderTask<K, V> cacheLoaderTask, final Executor executor, final boolean fetchValue, final boolean fetchMetadata) { Loggers.LDAP_LOG.trace("[IL0262] LDAP store: Processing key filter for {} cache: fetchValue={} fetchMetadata=", getCacheName(), fetchValue, fetchMetadata); final TaskContext taskContext = new TaskContextImpl(); // TODO consider multi-threaded LDAP retrieval? executor.execute(() -> ldapConnector.retrieveEntries(ldapEntry -> { // Retrieves entire entry, fetchValue / fetchMetadata params are ignored TODO consider if (taskContext.isStopped()) { // TODO Consider pushing task context to LDAP connector routine return; } InfinispanEntry<K,V> infinispanEntry = ldapEntryTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry)); if (keyFilter.accept(infinispanEntry.getKey())) { MarshalledEntry<K,V> marshalledEntry = marshalledEntryFactory.newMarshalledEntry( infinispanEntry.getKey(), infinispanEntry.getValue(), infinispanEntry.getMetadata()); try { cacheLoaderTask.processEntry(marshalledEntry, taskContext); } catch (InterruptedException e) { throw new PersistenceException(e.getMessage(), e); } } })); }
@Override public void process(final KeyFilter<? super K> keyFilter, final CacheLoaderTask<K, V> cacheLoaderTask, final Executor executor, final boolean fetchValue, final boolean fetchMetadata) { Loggers.LDAP_LOG.trace("[IL0262] LDAP store: Processing key filter for {} cache: fetchValue={} fetchMetadata=", getCacheName(), fetchValue, fetchMetadata); final TaskContext taskContext = new TaskContextImpl(); // TODO consider multi-threaded LDAP retrieval? executor.execute(() -> ldapConnector.retrieveEntries(ldapEntry -> { // Retrieves entire entry, fetchValue / fetchMetadata params are ignored TODO consider if (taskContext.isStopped()) { // TODO Consider pushing task context to LDAP connector routine return; } InfinispanEntry<K,V> infinispanEntry = ldapEntryTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry)); if (keyFilter.accept(infinispanEntry.getKey())) { MarshalledEntry<K,V> marshalledEntry = marshalledEntryFactory.newMarshalledEntry( infinispanEntry.getKey(), infinispanEntry.getValue(), infinispanEntry.getMetadata()); try { cacheLoaderTask.processEntry(marshalledEntry, taskContext); } catch (InterruptedException e) { throw new PersistenceException(e.getMessage(), e); } } })); }