Package com.atlan.cache
Class SourceTagCache
java.lang.Object
com.atlan.cache.AbstractAssetCache
com.atlan.cache.SourceTagCache
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Unique identity for a source tag, in the form: {{connectorType}}/{{connectorName}}@@DB/SCHEMA/TAG_NAME For example: snowflake/development@@DB/SCHEMA/TAG_NAME -
Field Summary
Fields inherited from class com.atlan.cache.AbstractAssetCache
client
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Add an entry to the cache.getByMappedAtlanTag
(String internalAtlanTagId) 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.getByMappedAtlanTag
(String internalAtlanTagId, boolean allowRefresh) Retrieve tags from the cache by their mapped Atlan tag.Logic to construct a unique identity for the asset.void
lookupByGuid
(String guid) Logic to refresh the cache for a single object from Atlan.void
lookupByMappedAtlanTag
(String internalAtlanTagId) Logic to refresh the cache for a single object from Atlan.void
lookupByName
(ObjectName name) Logic to refresh the cache for a single object from Atlan.void
lookupByQualifiedName
(String sourceTagQN) Logic to refresh the cache for a single object from Atlan.Methods inherited from class com.atlan.cache.AbstractAssetCache
getByGuid, getByGuid, getByName, getByName, getByQualifiedName, getByQualifiedName, isGuidKnown, isNameKnown, isQualifiedNameKnown
-
Constructor Details
-
SourceTagCache
-
-
Method Details
-
cache
Add an entry to the cache.- Overrides:
cache
in classAbstractAssetCache
- Parameters:
asset
- to be cached- Returns:
- the guid of the asset that was cached, or null if none was provided
-
lookupByGuid
Logic to refresh the cache for a single object from Atlan.- Specified by:
lookupByGuid
in classAbstractAssetCache
- Parameters:
guid
- the unique UUID of a single item to lookup- Throws:
AtlanException
- on any error communicating with Atlan to lookup the object
-
lookupByQualifiedName
Logic to refresh the cache for a single object from Atlan.- Specified by:
lookupByQualifiedName
in classAbstractAssetCache
- Parameters:
sourceTagQN
- the identity of a single item to lookup- Throws:
AtlanException
- on any error communicating with Atlan to lookup the object
-
lookupByName
Logic to refresh the cache for a single object from Atlan.- Specified by:
lookupByName
in classAbstractAssetCache
- Parameters:
name
- the name of a single item to lookup- Throws:
AtlanException
- on any error communicating with Atlan to lookup the object
-
lookupByMappedAtlanTag
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
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 refreshedNotFoundException
- if the object cannot be found (does not exist) in AtlanInvalidRequestException
- 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 tagallowRefresh
- 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 refreshedNotFoundException
- if the object cannot be found (does not exist) in AtlanInvalidRequestException
- if no internal hashed-string Atlan ID was provided
-
getName
Logic to construct a unique identity for the asset.- Specified by:
getName
in classAbstractAssetCache
- Parameters:
asset
- for which to construct the unique identity- Returns:
- a unique identity for the asset, or null if there is no asset
-