Package com.atlan.cache
Class AbstractAssetCache
java.lang.Object
com.atlan.cache.AbstractAssetCache
- Direct Known Subclasses:
ConnectionCache
,SourceTagCache
Base class for reusable components that are common to all caches, where
a cache is populated entry-by-entry.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Add an entry to the cache.Retrieve an asset from the cache by its UUID, looking it up and adding it to the cache if it is not found there.Retrieve an asset from the cache by its UUID.getByName
(ObjectName name) Retrieve an asset from the cache by its uniquely-identifiable name, looking it up and adding it to the cache if it is not found there.getByName
(ObjectName name, boolean allowRefresh) Retrieve an asset from the cache by its uniquely-identifiable name.getByQualifiedName
(String qualifiedName) Retrieve an asset from the cache by its unique Atlan-internal name, looking it up and adding it to the cache if it is not found there.getByQualifiedName
(String qualifiedName, boolean allowRefresh) Retrieve an asset from the cache by its unique Atlan-internal name.abstract ObjectName
Logic to construct a unique identity for the asset.boolean
isGuidKnown
(String guid) Checks whether the provided Atlan-internal UUID is known.boolean
isNameKnown
(ObjectName name) Checks whether the provided human-readable name is known.boolean
isQualifiedNameKnown
(String qualifiedName) Checks whether the provided Atlan-internal ID string is known.abstract void
lookupByGuid
(String guid) Logic to refresh the cache for a single object from Atlan.abstract void
lookupByName
(ObjectName name) Logic to refresh the cache for a single object from Atlan.abstract void
lookupByQualifiedName
(String qualifiedName) Logic to refresh the cache for a single object from Atlan.
-
Field Details
-
client
-
-
Constructor Details
-
AbstractAssetCache
-
-
Method Details
-
lookupByGuid
Logic to refresh the cache for a single object from Atlan.- 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.- Parameters:
qualifiedName
- 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.- Parameters:
name
- the name of a single item to lookup- Throws:
AtlanException
- on any error communicating with Atlan to lookup the object
-
getName
Logic to construct a unique identity for the asset.- Parameters:
asset
- for which to construct the unique identity- Returns:
- a unique identity for the asset, or null if there is no asset
-
cache
Add an entry to the cache.- Parameters:
asset
- to be cached- Returns:
- the guid of the asset that was cached, or null if none was provided
-
isGuidKnown
Checks whether the provided Atlan-internal UUID is known. (Note: will not refresh the cache itself to determine this.)- Parameters:
guid
- Atlan-internal UUID of the object- Returns:
- true if the object is known, false otherwise
-
isQualifiedNameKnown
Checks whether the provided Atlan-internal ID string is known. (Note: will not refresh the cache itself to determine this.)- Parameters:
qualifiedName
- Atlan-internal ID string of the object- Returns:
- true if the object is known, false otherwise
-
isNameKnown
Checks whether the provided human-readable name is known. (Note: will not refresh the cache itself to determine this.)- Parameters:
name
- human-constructable name of the object- Returns:
- true if the object is known, false otherwise
-
getByGuid
Retrieve an asset from the cache by its UUID, looking it up and adding it to the cache if it is not found there.- Parameters:
guid
- UUID of the asset in Atlan- Returns:
- the asset (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 UUID was provided for the object to retrieve
-
getByGuid
Retrieve an asset from the cache by its UUID.- Parameters:
guid
- UUID of the asset in AtlanallowRefresh
- whether to allow a refresh of the cache (true) or not (false)- Returns:
- the asset (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 UUID was provided for the object to retrieve
-
getByQualifiedName
Retrieve an asset from the cache by its unique Atlan-internal name, looking it up and adding it to the cache if it is not found there.- Parameters:
qualifiedName
- unique Atlan-internal name of the asset- Returns:
- the asset (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 qualifiedName was provided for the object to retrieve
-
getByQualifiedName
Retrieve an asset from the cache by its unique Atlan-internal name.- Parameters:
qualifiedName
- unique Atlan-internal name of the assetallowRefresh
- whether to allow a refresh of the cache (true) or not (false)- Returns:
- the asset (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 qualifiedName was provided for the object to retrieve
-
getByName
Retrieve an asset from the cache by its uniquely-identifiable name, looking it up and adding it to the cache if it is not found there.- Parameters:
name
- uniquely-identifiable name of the asset in Atlan- Returns:
- the asset (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 name was provided for the object to retrieve
-
getByName
Retrieve an asset from the cache by its uniquely-identifiable name.- Parameters:
name
- uniquely-identifiable name of the asset in AtlanallowRefresh
- whether to allow a refresh of the cache (true) or not (false)- Returns:
- the asset (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 name was provided for the object to retrieve
-