Package com.atlan.cache
Class AtlanTagCache
- All Implemented Interfaces:
Closeable
,AutoCloseable
Lazily-loaded cache for translating between Atlan-internal ID strings and human-readable names for
Atlan tags.
-
Field Summary
Fields inherited from class com.atlan.cache.AbstractMassCache
bulkRefresh, client, lock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetIdForName
(String name, boolean allowRefresh) Translate the provided human-readable name to its Atlan-internal ID string.getNameForId
(String id, boolean allowRefresh) Translate the provided Atlan-internal ID string to the human-readable name for the object.getNameForSid
(String id, boolean allowRefresh) Translate the provided Atlan-internal secondary ID string to the human-readable name for the object.getSidForName
(String name, boolean allowRefresh) Translate the provided human-readable name to its Atlan-internal secondary ID string.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).getSourceTagsAttrId
(String id, boolean allowRefresh) 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).protected void
lookupById
(String id) Logic to look up a single object for the cache.protected void
lookupByName
(String name) Logic to look up a single object for the cache.protected void
Logic to refresh a specific cache en-masse (must be implemented).Methods inherited from class com.atlan.cache.AbstractMassCache
cache, cache, cacheById, cacheByName, cacheBySid, close, entrySet, getBulkRefresh, getById, getById, getByName, getByName, getBySid, getBySid, getIdForName, getIdForSid, getIdForSid, getIdFromName, getIdFromSid, getNameForId, getNameForSid, getNameFromId, getNameFromId, getNameFromSid, getObjectById, getSidForName, getSidFromId, getSidFromName, isEmpty, isIdKnown, isNameKnown, lookupBySid, refresh
-
Constructor Details
-
AtlanTagCache
-
-
Method Details
-
refreshCache
Logic to refresh a specific cache en-masse (must be implemented).- Specified by:
refreshCache
in classAbstractMassCache<AtlanTagDef>
- Throws:
AtlanException
- on any error communicating with Atlan to refresh the cache of objects
-
lookupByName
Logic to look up a single object for the cache.- Specified by:
lookupByName
in classAbstractMassCache<AtlanTagDef>
- Parameters:
name
- unique name for the object
-
lookupById
Logic to look up a single object for the cache.- Specified by:
lookupById
in classAbstractMassCache<AtlanTagDef>
- Parameters:
id
- unique internal identifier for the object
-
getIdForName
Translate the provided human-readable name to its Atlan-internal ID string.- Overrides:
getIdForName
in classAbstractMassCache<AtlanTagDef>
- Parameters:
name
- human-readable name of the objectallowRefresh
- 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 refreshedNotFoundException
- if the object cannot be found (does not exist) in AtlanInvalidRequestException
- if no name was provided for the object to retrieve
-
getNameForId
Translate the provided Atlan-internal ID string to the human-readable name for the object.- Overrides:
getNameForId
in classAbstractMassCache<AtlanTagDef>
- Parameters:
id
- Atlan-internal ID stringallowRefresh
- 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 refreshedNotFoundException
- if the object cannot be found (does not exist) in AtlanInvalidRequestException
- if no name was provided for the object to retrieve
-
getSidForName
Translate the provided human-readable name to its Atlan-internal secondary ID string.- Overrides:
getSidForName
in classAbstractMassCache<AtlanTagDef>
- Parameters:
name
- human-readable name of the objectallowRefresh
- 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 refreshedNotFoundException
- if the object cannot be found (does not exist) in AtlanInvalidRequestException
- if no name was provided for the object to retrieve
-
getNameForSid
Translate the provided Atlan-internal secondary ID string to the human-readable name for the object.- Overrides:
getNameForSid
in classAbstractMassCache<AtlanTagDef>
- Parameters:
id
- Atlan-internal secondary ID stringallowRefresh
- 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 refreshedNotFoundException
- if the object cannot be found (does not exist) in AtlanInvalidRequestException
- if no name was provided for the object to retrieve
-
getSourceTagsAttrId
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 refreshedNotFoundException
- if the Atlan tag cannot be found (does not exist) in AtlanInvalidRequestException
- if no ID was provided for the Atlan tag
-
getSourceTagsAttrId
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 tagallowRefresh
- 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 refreshedNotFoundException
- if the Atlan tag cannot be found (does not exist) in AtlanInvalidRequestException
- if no ID was provided for the Atlan tag
-