Class ArchiveManager
- java.lang.Object
-
- org.jivesoftware.openfire.container.BasicModule
-
- org.jivesoftware.openfire.archive.ArchiveManager
-
- All Implemented Interfaces:
Module
public class ArchiveManager extends BasicModule
A manager of tasks that write archives into storage.- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description static SystemProperty<Integer>
EXECUTOR_CORE_POOL_SIZE
The number of threads to keep in the thread pool that writes messages to the database, even if they are idle.static SystemProperty<Integer>
EXECUTOR_MAX_POOL_SIZE
The maximum number of threads to allow in the thread pool that writes messages to the database.static SystemProperty<Duration>
EXECUTOR_POOL_KEEP_ALIVE
The number of threads in the thread pool that writes messages to the database is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
-
Constructor Summary
Constructors Constructor Description ArchiveManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Archiver archiver)
Adds a new task, that is started immediately.Duration
availabilityETAOnLocalNode(String id, Instant instant)
void
destroy()
Destroys the module, by shutting down the thread pool that is being used to process archiving tasks.void
initialize(XMPPServer server)
Initializes the manager, by instantiating a thread pool that is used to process archiving tasks.void
remove(String id)
Stops and removes an existing task.void
remove(Archiver archiver)
Stops and removes an exiting task.-
Methods inherited from class org.jivesoftware.openfire.container.BasicModule
getName, start, stop
-
-
-
-
Field Detail
-
EXECUTOR_CORE_POOL_SIZE
public static final SystemProperty<Integer> EXECUTOR_CORE_POOL_SIZE
The number of threads to keep in the thread pool that writes messages to the database, even if they are idle.
-
EXECUTOR_MAX_POOL_SIZE
public static final SystemProperty<Integer> EXECUTOR_MAX_POOL_SIZE
The maximum number of threads to allow in the thread pool that writes messages to the database.
-
EXECUTOR_POOL_KEEP_ALIVE
public static final SystemProperty<Duration> EXECUTOR_POOL_KEEP_ALIVE
The number of threads in the thread pool that writes messages to the database is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
-
-
Method Detail
-
initialize
public void initialize(XMPPServer server)
Initializes the manager, by instantiating a thread pool that is used to process archiving tasks.- Specified by:
initialize
in interfaceModule
- Overrides:
initialize
in classBasicModule
- Parameters:
server
- the server hosting this module.
-
destroy
public void destroy()
Destroys the module, by shutting down the thread pool that is being used to process archiving tasks. No new archive tasks will be accepted any longer, although previously scheduled tasks can continue to be processed.- Specified by:
destroy
in interfaceModule
- Overrides:
destroy
in classBasicModule
-
add
public void add(Archiver archiver)
Adds a new task, that is started immediately.- Parameters:
archiver
- The task to be added. Cannot be null.
-
remove
public void remove(Archiver archiver)
Stops and removes an exiting task. No-op when the provided task is not managed by this manager.- Parameters:
archiver
- The task to be added. Cannot be null.
-
remove
public void remove(String id)
Stops and removes an existing task. No-op when the provided task is not managed by this manager.- Parameters:
id
- The identifier of task to be added. Cannot be null.
-
-