Class SourceTagCache


public class SourceTagCache extends AbstractAssetCache
Lazily-loaded cache for translating between source-synced tags and the qualifiedName of such tags. - id = qualifiedName of the source tag (with epoch), for example: default/snowflake/1234567890/DB/SCHEMA/TAG_NAME - name = simple name of the form {{connectorType}}/{{connectorName}}@@DB/SCHEMA/TAG_NAME, for example: snowflake/development@@DB/SCHEMA/TAG_NAME
  • Constructor Details

    • SourceTagCache

      public SourceTagCache(AtlanClient client)
  • Method Details

    • cache

      protected String cache(Asset asset)
      Add an entry to the cache.
      Overrides:
      cache in class AbstractAssetCache
      Parameters:
      asset - to be cached
      Returns:
      the guid of the asset that was cached, or null if none was provided
    • lookupByGuid

      public void lookupByGuid(String guid) throws AtlanException
      Logic to refresh the cache for a single object from Atlan.
      Specified by:
      lookupByGuid in class AbstractAssetCache
      Parameters:
      guid - the unique UUID of a single item to lookup
      Throws:
      AtlanException - on any error communicating with Atlan to lookup the object
    • lookupByQualifiedName

      public void lookupByQualifiedName(String sourceTagQN) throws AtlanException
      Logic to refresh the cache for a single object from Atlan.
      Specified by:
      lookupByQualifiedName in class AbstractAssetCache
      Parameters:
      sourceTagQN - the identity of a single item to lookup
      Throws:
      AtlanException - on any error communicating with Atlan to lookup the object
    • lookupByName

      public void lookupByName(ObjectName name) throws AtlanException
      Logic to refresh the cache for a single object from Atlan.
      Specified by:
      lookupByName in class AbstractAssetCache
      Parameters:
      name - the name of a single item to lookup
      Throws:
      AtlanException - on any error communicating with Atlan to lookup the object
    • lookupByMappedAtlanTag

      public void lookupByMappedAtlanTag(String internalAtlanTagId) throws AtlanException
      Logic to refresh the cache for a single object from Atlan.
      Parameters:
      internalAtlanTagId - internal hashed-string ID for the mapped Atlan tag
      Throws:
      AtlanException - on any underlying API issues
    • getByMappedAtlanTag

      public List<ITag> getByMappedAtlanTag(String internalAtlanTagId) throws AtlanException
      Retrieve tags from the cache by their mapped Atlan tag, looking it up and adding it to the cache if it is not found there.
      Parameters:
      internalAtlanTagId - internal hashed-string ID for the mapped Atlan tag
      Returns:
      all mapped tags (if found)
      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 internal hashed-string Atlan ID was provided
    • getByMappedAtlanTag

      public List<ITag> getByMappedAtlanTag(String internalAtlanTagId, boolean allowRefresh) throws AtlanException
      Retrieve tags from the cache by their mapped Atlan tag.
      Parameters:
      internalAtlanTagId - internal hashed-string ID for the mapped Atlan tag
      allowRefresh - whether to allow a refresh of the cache (true) or not (false)
      Returns:
      all mapped tags (if found)
      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 internal hashed-string Atlan ID was provided
    • getName

      public ObjectName getName(Asset asset)
      Logic to construct a unique identity for the asset.
      Specified by:
      getName in class AbstractAssetCache
      Parameters:
      asset - for which to construct the unique identity
      Returns:
      a unique identity for the asset, or null if there is no asset