congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
com.nimbusds.infinispan.persistence.ldap
Code IndexAdd Tabnine to your IDE (free)

How to use com.nimbusds.infinispan.persistence.ldap

Best Java code snippets using com.nimbusds.infinispan.persistence.ldap (Showing top 20 results out of 315)

origin: com.nimbusds/infinispan-ldap-cache-store

@Override
public LDAPStoreConfigurationBuilder withProperties(final Properties properties) {
  return properties(properties);
}
origin: com.nimbusds/infinispan-cachestore-ldap

@Override
public void purge(final Executor executor, final PurgeListener<? super K> purgeListener) {
  Loggers.LDAP_LOG.trace("[IL0261] LDAP store: Purging {} entries", getCacheName());
  executor.execute(() -> reaper.purge(purgeListener));
}

origin: com.nimbusds/infinispan-cachestore-ldap

  @Override
  public void purge(final Executor executor, final ExpirationPurgeListener<K,V> purgeListener) {
    
    Loggers.LDAP_LOG.trace("[IL0267] LDAP store: Purging {} entries", getCacheName());
    
    executor.execute(() -> reaper.purgeExtended(purgeListener));
  }
}
origin: com.nimbusds/infinispan-ldap-cache-store

@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);
}
origin: com.nimbusds/infinispan-cachestore-ldap

@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);
}
origin: com.nimbusds/infinispan-ldap-cache-store

@Override
@SuppressWarnings("unchecked")
public void init(final InitializationContext ctx) {
  // This method will be invoked by the PersistenceManager during initialization. The InitializationContext
  // contains:
  // - this CacheLoader's configuration
  // - the cache to which this loader is applied. Your loader might want to use the cache's name to construct
  //   cache-specific identifiers
  // - the StreamingMarshaller that needs to be used to marshall/unmarshall the entries
  // - a TimeService which the loader can use to determine expired entries
  // - a ByteBufferFactory which needs to be used to construct ByteBuffers
  // - a MarshalledEntryFactory which needs to be used to construct entries from the data retrieved by the loader
  super.init(ctx);
  
  this.config = ctx.getConfiguration();
  Loggers.MAIN_LOG.info("[IL0201] LDAP store configuration properties for cache {}:", getCacheName());
  config.log();
  Loggers.MAIN_LOG.debug("[IL0202] Loading LDAP entry transformer class {} for cache {}...",
    config.ldapDirectory.entryTransformer,
    getCacheName());
  ldapEntryTransformer = loadEntryTransformerClass(config.ldapDirectory.entryTransformer);
  marshalledEntryFactory = (MarshalledEntryFactory<K, V>)ctx.getMarshalledEntryFactory();
  Loggers.MAIN_LOG.info("[IL0203] Initialized LDAP external store for cache {}", getCacheName());
}

origin: com.nimbusds/infinispan-cachestore-ldap

@Override
public int size() {
  // Infinispan code analysis on 8.2 shows that this method is never called in practise, and
  // is not wired to the data / cache container API
  Loggers.LDAP_LOG.trace("[IL0258] LDAP store: Counting {} entries", getCacheName());
  final int count = ldapConnector.countEntries();
  Loggers.LDAP_LOG.trace("[IL0259] LDAP store: Counted {} {} entries", count, getCacheName());
  return count;
}
origin: com.nimbusds/infinispan-cachestore-ldap

@Override
public void clear() {
  Loggers.LDAP_LOG.trace("[IL0260] LDAP store: Clearing {} entries", getCacheName());
  int numDeleted = ldapConnector.deleteEntries();
  Loggers.LDAP_LOG.debug("[IL0254] LDAP store: Cleared {} {} entries", numDeleted, getCacheName());
}
origin: com.nimbusds/infinispan-ldap-cache-store

@Override
public void stop() {
  if (ldapConnector != null) {
    ldapConnector.shutdown();
    Loggers.MAIN_LOG.info("[IL0205] Stopped LDAP external store connector for cache {}", getCacheName());
  }
  
  super.stop();
}
origin: com.nimbusds/infinispan-ldap-cache-store

@SuppressWarnings("unchecked")
private K resolveKey(final Object key) {
  if (key instanceof byte[]) {
    throw new PersistenceException("Cannot resolve " + getCacheName() + " cache key from byte[], enable compatibility mode");
  }
  return (K)key;
}
origin: com.nimbusds/infinispan-ldap-cache-store

@Override
public LDAPStoreConfiguration create() {
    // This method should construct a new instance of a
  // LDAPStoreConfiguration object. There will be one instance
  // per cache.
  return new LDAPStoreConfiguration(
    purgeOnStartup,
    fetchPersistentState,
    ignoreModifications,
    async.create(),
    singletonStore.create(),
    preload,
    shared,
    properties);
}
origin: com.nimbusds/infinispan-cachestore-ldap

@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);
}
origin: com.nimbusds/infinispan-ldap-cache-store

@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);
}
origin: com.nimbusds/infinispan-ldap-cache-store

  @Override
  public void purge(final Executor executor, final PurgeListener<? super K> purgeListener) {

    Loggers.LDAP_LOG.trace("[IL0261] LDAP store: Purging {} entries", getCacheName());

    final AtomicInteger numPurged = new AtomicInteger();

    executor.execute(() -> numPurged.set(reaper.purge(purgeListener)));

    Loggers.LDAP_LOG.debug("[IL0255] LDAP store: Purged {} expired {} entries", numPurged.get(), getCacheName());
  }
}
origin: com.nimbusds/infinispan-ldap-cache-store

@Override
public int size() {
  // Infinispan code analysis on 8.2 shows that this method is never called in practise, and
  // is not wired to the data / cache container API
  Loggers.LDAP_LOG.trace("[IL0258] LDAP store: Counting {} entries", getCacheName());
  final int count = ldapConnector.countEntries();
  Loggers.LDAP_LOG.trace("[IL0259] LDAP store: Counted {} {} entries", count, getCacheName());
  return count;
}
origin: com.nimbusds/infinispan-ldap-cache-store

@Override
public void clear() {
  Loggers.LDAP_LOG.trace("[IL0260] LDAP store: Clearing {} entries", getCacheName());
  int numDeleted = ldapConnector.deleteEntries();
  Loggers.LDAP_LOG.debug("[IL0254] LDAP store: Cleared {} {} entries", numDeleted, getCacheName());
}
origin: com.nimbusds/infinispan-cachestore-ldap

@Override
public void stop() {
  if (ldapConnector != null) {
    ldapConnector.shutdown();
    Loggers.MAIN_LOG.info("[IL0205] Stopped LDAP external store connector for cache {}", getCacheName());
  }
  
  super.stop();
}
origin: com.nimbusds/infinispan-cachestore-ldap

@Override
public LDAPStoreConfigurationBuilder withProperties(final Properties properties) {
  return properties(properties);
}
origin: com.nimbusds/infinispan-cachestore-ldap

@SuppressWarnings("unchecked")
private K resolveKey(final Object key) {
  if (key instanceof byte[]) {
    throw new PersistenceException("Cannot resolve " + getCacheName() + " cache key from byte[], enable compatibility mode");
  }
  return (K)key;
}
origin: com.nimbusds/infinispan-cachestore-ldap

@Override
public LDAPStoreConfiguration create() {
    // This method should construct a new instance of a
  // LDAPStoreConfiguration object. There will be one instance
  // per cache.
  return new LDAPStoreConfiguration(
    purgeOnStartup,
    fetchPersistentState,
    ignoreModifications,
    async.create(),
    singletonStore.create(),
    preload,
    shared,
    properties);
}
com.nimbusds.infinispan.persistence.ldap

Most used classes

  • ExpiredEntryReaper
    Expired entry reaper.
  • LDAPEntry
    Encapsulates an LDAP entry with optional write strategy.
  • LDAPEntryTransformer
    Interface for transforming between Infinispan entries (key / value pair and metadata) and a correspo
  • LDAPStore
    LDAP store for Infinispan 8.2+ caches and maps.
  • LDAPStoreConfiguration$LDAPDirectory
    LDAP directory entry configuration.
  • LDAPStoreConfigurationBuilder,
  • LDAPWriteStrategy,
  • LDAPConnector,
  • LDAPModifyRequestFactory,
  • LDAPTimers,
  • LDAPQueryExecutor
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now