Class 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
    • Constructor Detail

      • ArchiveManager

        public ArchiveManager()
    • 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 interface Module
        Overrides:
        initialize in class BasicModule
        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 interface Module
        Overrides:
        destroy in class BasicModule
      • 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 exiting 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.
      • availabilityETAOnLocalNode

        public Duration availabilityETAOnLocalNode​(String id,
                                                   Instant instant)