Class InMemoryConfigStore
java.lang.Object
org.apache.tika.pipes.core.config.InMemoryConfigStore
- All Implemented Interfaces:
ConfigStore,TikaExtension
Default in-memory implementation of
ConfigStore using a ConcurrentHashMap.
Thread-safe and suitable for single-instance deployments.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String id) Checks if a configuration exists.Retrieves a configuration by ID.keySet()Returns all configuration IDs.voidput(String id, ExtensionConfig config) Stores a configuration.Removes a configuration by ID.voidsetExtensionConfig(ExtensionConfig extensionConfig) intsize()Returns the number of stored configurations.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.tika.pipes.core.config.ConfigStore
init
-
Constructor Details
-
InMemoryConfigStore
public InMemoryConfigStore()
-
-
Method Details
-
getExtensionConfig
- Specified by:
getExtensionConfigin interfaceTikaExtension
-
setExtensionConfig
-
put
Description copied from interface:ConfigStoreStores a configuration.- Specified by:
putin interfaceConfigStore- Parameters:
id- the configuration ID (must not be null)config- the configuration to store (must not be null)
-
get
Description copied from interface:ConfigStoreRetrieves a configuration by ID.- Specified by:
getin interfaceConfigStore- Parameters:
id- the configuration ID (must not be null)- Returns:
- the configuration, or null if not found
-
containsKey
Description copied from interface:ConfigStoreChecks if a configuration exists.- Specified by:
containsKeyin interfaceConfigStore- Parameters:
id- the configuration ID (must not be null)- Returns:
- true if the configuration exists
-
keySet
Description copied from interface:ConfigStoreReturns all configuration IDs. Implementations should return an immutable snapshot to avoid ConcurrentModificationException during iteration.- Specified by:
keySetin interfaceConfigStore- Returns:
- an immutable set of all configuration IDs
-
size
public int size()Description copied from interface:ConfigStoreReturns the number of stored configurations.- Specified by:
sizein interfaceConfigStore- Returns:
- the number of configurations
-
remove
Description copied from interface:ConfigStoreRemoves a configuration by ID.- Specified by:
removein interfaceConfigStore- Parameters:
id- the configuration ID (must not be null)- Returns:
- the removed configuration, or null if not found
-