Package com.atlan.cache
Class GroupCache
Lazily-loaded cache for translating Atlan-internal groups into their various IDs.
-
Field Summary
Fields inherited from class com.atlan.cache.AbstractMassCache
bulkRefresh, lock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcache(String id, String name, AtlanGroup object) Add an entry to the cache.voidcacheByAlias(String alias) Wraps a single object lookup for the cache with necessary concurrency controls.getIdForAlias(String alias) Translate the provided human-readable group name to its GUID.getIdForAlias(String alias, boolean allowRefresh) Translate the provided human-readable group name to its GUID.getNameForAlias(String alias) Translate the provided human-readable group name to the internal group name.getNameForAlias(String alias, boolean allowRefresh) Translate the provided human-readable group name to the internal group name.protected voidlookupByAlias(String alias) Logic to look up a single object for the cache.protected voidlookupById(String id) Logic to look up a single object for the cache.protected voidlookupByName(String name) Logic to look up a single object for the cache.protected voidLogic to refresh a specific cache en-masse (must be implemented).Methods inherited from class com.atlan.cache.AbstractMassCache
cacheById, cacheByName, entrySet, getBulkRefresh, getById, getById, getByName, getByName, getIdForName, getIdForName, getIdFromName, getNameForId, getNameForId, getNameFromId, getObjectById, isEmpty, isIdKnown, isNameKnown, refresh
-
Constructor Details
-
GroupCache
-
-
Method Details
-
refreshCache
Logic to refresh a specific cache en-masse (must be implemented).- Specified by:
refreshCachein classAbstractMassCache<AtlanGroup>- Throws:
AtlanException- on any error communicating with Atlan to refresh the cache of objects
-
cache
Add an entry to the cache. This should only be called by the lookup methods, which themselves should never directly be invoked.- Overrides:
cachein classAbstractMassCache<AtlanGroup>- Parameters:
id- Atlan-internal IDname- human-readable nameobject- the object to cache (if any)
-
getIdForAlias
Translate the provided human-readable group name to its GUID.- Parameters:
alias- name of the group as it appears in the UI- Returns:
- unique identifier (GUID) of the group
- Throws:
AtlanException- on any API communication problem if the cache needs to be refreshedNotFoundException- if the group cannot be found (does not exist) in AtlanInvalidRequestException- if no name was provided for the group to retrieve
-
getIdForAlias
Translate the provided human-readable group name to its GUID.- Parameters:
alias- name of the group as it appears in the UIallowRefresh- whether to allow a refresh of the cache (true) or not (false)- Returns:
- unique identifier (GUID) of the group
- Throws:
AtlanException- on any API communication problem if the cache needs to be refreshedNotFoundException- if the group cannot be found (does not exist) in AtlanInvalidRequestException- if no name was provided for the group to retrieve
-
getNameForAlias
Translate the provided human-readable group name to the internal group name.- Parameters:
alias- name of the group as it appears in the UI- Returns:
- internal name of the group
- Throws:
AtlanException- on any API communication problem if the cache needs to be refreshedNotFoundException- if the group cannot be found (does not exist) in AtlanInvalidRequestException- if no name was provided for the group to retrieve
-
getNameForAlias
Translate the provided human-readable group name to the internal group name.- Parameters:
alias- name of the group as it appears in the UIallowRefresh- whether to allow a refresh of the cache (true) or not (false)- Returns:
- internal name of the group
- Throws:
AtlanException- on any API communication problem if the cache needs to be refreshedNotFoundException- if the group cannot be found (does not exist) in AtlanInvalidRequestException- if no name was provided for the group to retrieve
-
lookupByName
Logic to look up a single object for the cache.- Specified by:
lookupByNamein classAbstractMassCache<AtlanGroup>- Parameters:
name- unique name for the object- Throws:
AtlanException- on any error communicating with Atlan
-
lookupById
Logic to look up a single object for the cache.- Specified by:
lookupByIdin classAbstractMassCache<AtlanGroup>- Parameters:
id- unique internal identifier for the object- Throws:
AtlanException- on any error communicating with Atlan
-
cacheByAlias
Wraps a single object lookup for the cache with necessary concurrency controls.- Parameters:
alias- name of the group as it appears in the UI- Throws:
AtlanException- on any error communicating with Atlan
-
lookupByAlias
Logic to look up a single object for the cache.- Parameters:
alias- name of the group as it appears in the UI- Throws:
AtlanException- on any error communicating with Atlan
-