Class AtlanTagCache

All Implemented Interfaces:
Closeable, AutoCloseable

public class AtlanTagCache extends AbstractMassCache<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).
      Specified by:
      refreshCache in class AbstractMassCache<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
    • getIdForName

      public String getIdForName(String name, boolean allowRefresh) throws AtlanException
      Translate the provided human-readable name to its Atlan-internal ID string.
      Overrides:
      getIdForName in class AbstractMassCache<AtlanTagDef>
      Parameters:
      name - human-readable name of the object
      allowRefresh - whether to allow a refresh of the cache (true) or not (false)
      Returns:
      unique Atlan-internal ID string for the object
      Throws:
      AtlanException - on any API communication problem if the cache needs to be refreshed
      NotFoundException - if the object cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the object to retrieve
    • getNameForId

      public String getNameForId(String id, boolean allowRefresh) throws AtlanException
      Translate the provided Atlan-internal ID string to the human-readable name for the object.
      Overrides:
      getNameForId in class AbstractMassCache<AtlanTagDef>
      Parameters:
      id - Atlan-internal ID string
      allowRefresh - whether to allow a refresh of the cache (true) or not (false)
      Returns:
      human-readable name of the object
      Throws:
      AtlanException - on any API communication problem if the cache needs to be refreshed
      NotFoundException - if the object cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the object to retrieve
    • getSidForName

      public String getSidForName(String name, boolean allowRefresh) throws AtlanException
      Translate the provided human-readable name to its Atlan-internal secondary ID string.
      Overrides:
      getSidForName in class AbstractMassCache<AtlanTagDef>
      Parameters:
      name - human-readable name of the object
      allowRefresh - whether to allow a refresh of the cache (true) or not (false)
      Returns:
      unique Atlan-internal secondary ID string for the object
      Throws:
      AtlanException - on any API communication problem if the cache needs to be refreshed
      NotFoundException - if the object cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the object to retrieve
    • getNameForSid

      public String getNameForSid(String id, boolean allowRefresh) throws AtlanException
      Translate the provided Atlan-internal secondary ID string to the human-readable name for the object.
      Overrides:
      getNameForSid in class AbstractMassCache<AtlanTagDef>
      Parameters:
      id - Atlan-internal secondary ID string
      allowRefresh - whether to allow a refresh of the cache (true) or not (false)
      Returns:
      human-readable name of the object
      Throws:
      AtlanException - on any API communication problem if the cache needs to be refreshed
      NotFoundException - if the object cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the object to retrieve
    • 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