Class AtlanTagCache

All Implemented Interfaces:
Closeable, AutoCloseable

public class AtlanTagCache extends AbstractMassTrackingCache<AtlanTagDef>
Lazily-loaded cache for translating between Atlan-internal ID strings and human-readable names for Atlan tags.
  • Constructor Details

    • AtlanTagCache

      public AtlanTagCache(AtlanClient client)
  • Method Details

    • refreshCache

      protected void refreshCache() throws AtlanException
      Logic to refresh a specific cache en-masse (must be implemented).
      Overrides:
      refreshCache in class AbstractMassTrackingCache<AtlanTagDef>
      Throws:
      AtlanException - on any error communicating with Atlan to refresh the cache of objects
    • lookupByName

      protected void lookupByName(String name)
      Logic to look up a single object for the cache.
      Specified by:
      lookupByName in class AbstractMassCache<AtlanTagDef>
      Parameters:
      name - unique name for the object
    • lookupById

      protected void lookupById(String id)
      Logic to look up a single object for the cache.
      Specified by:
      lookupById in class AbstractMassCache<AtlanTagDef>
      Parameters:
      id - unique internal identifier for the object
    • getSourceTagsAttrId

      public String getSourceTagsAttrId(String id) throws AtlanException
      Translate the provided Atlan-internal Atlan tag ID string to the Atlan-internal name of the attribute that captures tag attachment details (for source-synced tags).
      Parameters:
      id - Atlan-internal ID string of the Atlan tag
      Returns:
      Atlan-internal ID string of the attribute containing source-synced tag attachment details
      Throws:
      AtlanException - on any API communication problem if the cache needs to be refreshed
      NotFoundException - if the Atlan tag cannot be found (does not exist) in Atlan
      InvalidRequestException - if no ID was provided for the Atlan tag
    • getSourceTagsAttrId

      public String getSourceTagsAttrId(String id, boolean allowRefresh) throws AtlanException
      Translate the provided Atlan-internal Atlan tag ID string to the Atlan-internal name of the attribute that captures tag attachment details (for source-synced tags).
      Parameters:
      id - Atlan-internal ID string of the Atlan tag
      allowRefresh - whether to allow a refresh of the cache (true) or not (false)
      Returns:
      Atlan-internal ID string of the attribute containing source-synced tag attachment details
      Throws:
      AtlanException - on any API communication problem if the cache needs to be refreshed
      NotFoundException - if the Atlan tag cannot be found (does not exist) in Atlan
      InvalidRequestException - if no ID was provided for the Atlan tag
    • getSourceTagsAttrId

      public String getSourceTagsAttrId(String id, long minimumTime) throws AtlanException
      Translate the provided Atlan-internal Atlan tag ID string to the Atlan-internal name of the attribute that captures tag attachment details (for source-synced tags).
      Parameters:
      id - Atlan-internal ID string of the Atlan tag
      minimumTime - epoch-based time (in milliseconds) to compare against the time the cache was last refreshed
      Returns:
      Atlan-internal ID string of the attribute containing source-synced tag attachment details
      Throws:
      AtlanException - on any API communication problem if the cache needs to be refreshed
      NotFoundException - if the Atlan tag cannot be found (does not exist) in Atlan
      InvalidRequestException - if no ID was provided for the Atlan tag