config, getCacheName(), ldapEntryTransformer.getModifiableAttributes(), ldapEntryTransformer.includesAttributesWithOptions());
DN dn = new DN(ldapEntryTransformer.resolveRDN(resolveKey(key)), config.ldapDirectory.baseDN); InfinispanEntry<K,V> infinispanEntry = ldapEntryTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
InfinispanEntry<K,V> infinispanEntry = entityTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
@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); }
LDAPEntry ldapEntry = ldapEntryTransformer.toLDAPEntry( config.ldapDirectory.baseDN, new InfinispanEntry<>(
InfinispanEntry<K,V> infinispanEntry = entityTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
@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); }
LDAPEntry ldapEntry = ldapEntryTransformer.toLDAPEntry( config.ldapDirectory.baseDN, new InfinispanEntry<>(
DN dn = new DN(ldapEntryTransformer.resolveRDN(resolveKey(key)), config.ldapDirectory.baseDN); InfinispanEntry<K,V> infinispanEntry = ldapEntryTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
config, getCacheName(), ldapEntryTransformer.getModifiableAttributes(), ldapEntryTransformer.includesAttributesWithOptions());
InfinispanEntry<K,V> infinispanEntry = entityTransformer.toInfinispanEntry(new LDAPEntry(ldapEntry));
@Override public boolean contains(final Object key) { // This method will be invoked by the PersistenceManager to determine if the loader contains the specified key. // The implementation should be as fast as possible, e.g. it should strive to transfer the least amount of data possible // from the external storage to perform the check. Also, if possible, make sure the field is indexed on the external storage // so that its existence can be determined as quickly as possible. // // 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("[IL0250] LDAP store: Checking {} cache key {}", getCacheName(), key); DN dn = new DN(ldapEntryTransformer.resolveRDN(resolveKey(key)), config.ldapDirectory.baseDN); return ldapConnector.entryExists(dn); }
@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 boolean contains(final Object key) { // This method will be invoked by the PersistenceManager to determine if the loader contains the specified key. // The implementation should be as fast as possible, e.g. it should strive to transfer the least amount of data possible // from the external storage to perform the check. Also, if possible, make sure the field is indexed on the external storage // so that its existence can be determined as quickly as possible. // // 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("[IL0250] LDAP store: Checking {} cache key {}", getCacheName(), key); DN dn = new DN(ldapEntryTransformer.resolveRDN(resolveKey(key)), config.ldapDirectory.baseDN); return ldapConnector.entryExists(dn); }
@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); } } })); }