edu.ucsb.nceas.metacat.spatial

## Class SpatialHarvester

- java.lang.Object
- - edu.ucsb.nceas.metacat.spatial.SpatialHarvester

-     public class SpatialHarvester
      extends java.lang.Object

  Harvests spatial data from metacat database and saves to persistent cache

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpatialHarvester()` constructor to initialize db connection

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addToDeleteQue(java.lang.String docid)` Delete a given document from spatial cache.
    `void` | `addToUpdateQue(java.lang.String docid)` Currently just a wrapper around the harvestDocument method.
    `void` | `deleteDocument(java.lang.String docid)` Given a docid, will attempt to delete it from spatial cache
    `void` | `destroy()` Closes the database connection.
    `void` | `harvestDocument(java.lang.String docid)` Given a new or updated docid, will update the spatial cache accordingly.
    `protected java.util.Vector<java.lang.String>` | `queryAllDocids()` Returns a Vector of all the current versions of public docids
    `void` | `regenerate()` Completely regenerates the spatial cache.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SpatialHarvester

          public SpatialHarvester()

      constructor to initialize db connection

  - ### Method Detail

    - #### destroy

          public void destroy()

      Closes the database connection. Should be called after you're done with the SpatialHarvester

    - #### queryAllDocids

          protected java.util.Vector<java.lang.String> queryAllDocids()

      Returns a Vector of all the current versions of public docids

    - #### addToUpdateQue

          public void addToUpdateQue(java.lang.String docid)

      Currently just a wrapper around the harvestDocument method. Eventually we can use this method as a timed que like the indexing process.
      Parameters:
        `docid` - The docid to be added to the spatial cache.

    - #### addToDeleteQue

          public void addToDeleteQue(java.lang.String docid)

      Delete a given document from spatial cache. Just a wrapper around deleteDocument method for now.
      Parameters:
        `docid` - The docid to be deleted from the spatial cache.

    - #### deleteDocument

          public void deleteDocument(java.lang.String docid)

      Given a docid, will attempt to delete it from spatial cache
      Parameters:
        `docid` - The docid to be deleted from the spatial cache.

    - #### harvestDocument

          public void harvestDocument(java.lang.String docid)

      Given a new or updated docid, will update the spatial cache accordingly.
      Parameters:
        `docid` - The docid to be updated or inserted into the spatial cache.

    - #### regenerate

          public void regenerate()
                          throws java.io.IOException

      Completely regenerates the spatial cache. This can take a long time, especially with lots of documents.
      Throws:
        `java.io.IOException`

Copyright © 2020 Regents of the University of California. All Rights Reserved.