Class CatalogBackupPlugin

java.lang.Object
ddf.catalog.backup.CatalogBackupPlugin
All Implemented Interfaces:
ddf.catalog.plugin.PostIngestPlugin

public class CatalogBackupPlugin extends Object implements ddf.catalog.plugin.PostIngestPlugin
The CatalogBackupPlugin backups up metacards to the file system. It is a PostIngestPlugin, so it processes CreateResponses, DeleteResponses, and UpdateResponses.

The root backup directory and subdirectory levels can be configured in the Backup Post-Ingest Plugin section in the admin console.

This feature can be installed/uninstalled with the following commands:

ddf@local>feature:install catalog-core-backupplugin ddf@local>feature:uninstall catalog-core-backupplugin

  • Field Details

  • Constructor Details

    • CatalogBackupPlugin

      public CatalogBackupPlugin()
  • Method Details

    • process

      public ddf.catalog.operation.CreateResponse process(ddf.catalog.operation.CreateResponse input)
      Backs up created metacards to the file system backup.
      Specified by:
      process in interface ddf.catalog.plugin.PostIngestPlugin
      Parameters:
      input - the CreateResponse to process
      Returns:
      CreateResponse
    • process

      public ddf.catalog.operation.UpdateResponse process(ddf.catalog.operation.UpdateResponse input)
      Backs up updated metacards to the file system backup.
      Specified by:
      process in interface ddf.catalog.plugin.PostIngestPlugin
      Parameters:
      input - the UpdateResponse to process
      Returns:
      UpdateResponse
    • process

      public ddf.catalog.operation.DeleteResponse process(ddf.catalog.operation.DeleteResponse input)
      Removes deleted metacards from the file system backup.
      Specified by:
      process in interface ddf.catalog.plugin.PostIngestPlugin
      Parameters:
      input - the DeleteResponse to process
      Returns:
      DeleteResponse
    • shutdown

      public void shutdown()
      Throws:
      IllegalStateException - will be thrown if the tasks in the queue have not completed before the awaitTermination message times out
    • setExecutor

      public void setExecutor(ExecutorService executor)
    • getTerminationTimeoutSeconds

      public long getTerminationTimeoutSeconds()
    • setTerminationTimeoutSeconds

      public void setTerminationTimeoutSeconds(long terminationTimeoutSeconds)
    • getRootBackupDir

      public String getRootBackupDir()
    • setRootBackupDir

      public void setRootBackupDir(String dir)
      Sets the root file system backup directory. The directory will be created when it is needed. Do not validate the existence of the directory until then.
      Parameters:
      dir - absolute path for the root file system backup directory.
    • getSubDirLevels

      public int getSubDirLevels()
    • setSubDirLevels

      public void setSubDirLevels(int levels)
      Sets the number of subdirectory levels to create. Two characters from each metacard ID will be used to name each subdirectory level.
      Parameters:
      levels - number of subdirectory levels to create