Package ddf.catalog.backup
Class CatalogBackupPlugin
java.lang.Object
ddf.catalog.backup.CatalogBackupPlugin
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongddf.catalog.operation.CreateResponseprocess(ddf.catalog.operation.CreateResponse input) Backs up created metacards to the file system backup.ddf.catalog.operation.DeleteResponseprocess(ddf.catalog.operation.DeleteResponse input) Removes deleted metacards from the file system backup.ddf.catalog.operation.UpdateResponseprocess(ddf.catalog.operation.UpdateResponse input) Backs up updated metacards to the file system backup.voidsetExecutor(ExecutorService executor) voidsetRootBackupDir(String dir) Sets the root file system backup directory.voidsetSubDirLevels(int levels) Sets the number of subdirectory levels to create.voidsetTerminationTimeoutSeconds(long terminationTimeoutSeconds) voidshutdown()
-
Field Details
-
CREATE
- See Also:
-
DELETE
- See Also:
-
-
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:
processin interfaceddf.catalog.plugin.PostIngestPlugin- Parameters:
input- theCreateResponseto 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:
processin interfaceddf.catalog.plugin.PostIngestPlugin- Parameters:
input- theUpdateResponseto 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:
processin interfaceddf.catalog.plugin.PostIngestPlugin- Parameters:
input- theDeleteResponseto 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
-
getTerminationTimeoutSeconds
public long getTerminationTimeoutSeconds() -
setTerminationTimeoutSeconds
public void setTerminationTimeoutSeconds(long terminationTimeoutSeconds) -
getRootBackupDir
-
setRootBackupDir
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
-