extensions.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. .. _backup_restore_extensions:
  2. Backup and Restore Extension for the management of ImageMosaic indexers
  3. =======================================================================
  4. Introduction
  5. ------------
  6. *ImageMosaics CoverageStores* make use of several ``.properties`` files instructing the reader on how to create the mosaic index.
  7. What we want to achieve is to allow the GeoServer Backup & Restore module to *inject* environment properties on indexers allowing the ImageMosaic to be automatically ported among different environments.
  8. Technical Details
  9. -----------------
  10. The GeoServer Backup & Restore module actually provides an extension point on reading / writing allowing GeoServer to handle additional resources related to a particular ``ResourceInfo``.
  11. The interfaces ::
  12. public interface CatalogAdditionalResourcesWriter<T> {
  13. public boolean canHandle(Object item);
  14. public void writeAdditionalResources(Backup backupFacade, Resource base, T item)
  15. throws IOException;
  16. }
  17. ::
  18. public interface CatalogAdditionalResourcesReader<T> {
  19. public boolean canHandle(Object item);
  20. public void readAdditionalResources(Backup backupFacade, Resource base, T item)
  21. throws IOException;
  22. }
  23. Is invoked by the ``CatalogFileWriter`` (when doing a Backup) and the ``CatalogItemWriter`` (when doing a Restore) after a successful write of the resource configuration on the, respectively, target backup folder and in-memory catalog.
  24. The idea is the following one *allowing the CatalogItemWriter to*:
  25. #. Restore the ImageMosaic Indexer Properties injecting environment properties
  26. #. Check if the Mosaic index physically exist and if not create an empty one
  27. In order to do that we envisage the following technical approach
  28. On a **BACKUP** operation
  29. #. The Additional Resource Writer checks if the ``ResourceInfo`` is an ImageMosaic Coverage Store.
  30. #. The Additional Resource Writer looks for ``*.template`` files on the ImageMosaic index directory. It must store them into the zip archive by reading the path from the Coverage Store.
  31. #. The Additional Resource Writer stores the ``*.template`` along with the ``*.properties`` files on the target backup folder. Same as above.
  32. On a **RESTORE** operation
  33. #. The Additional Resource Reader checks if the ``ResourceInfo`` is an ImageMosaic Coverage Store.
  34. #. The Additional Resource Reader looks for ``*.template`` files on the ImageMosaic index directory. It will try to restore them by using the path read from the Coverage Store configuration.
  35. #. The Additional Resource Reader overwrites the ``*.properties`` files by resolving all the environment properties declared on the templates.
  36. #. The Additional Resource Reader checks if the empty mosaic must be created or not.