Package com.atlan.cache
Class GroupCache
- All Implemented Interfaces:
Closeable,AutoCloseable
Lazily-loaded cache for translating Atlan-internal groups into their various IDs.
-
Field Summary
Fields inherited from class com.atlan.cache.AbstractMassCache
bulkRefresh, client, lastRefresh, lock, needsRefresh, refreshLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIdForAlias(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 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 voidlookupBySid(String alias) 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
cache, cache, cacheById, cacheByName, cacheBySid, close, entrySet, forceRefresh, getBulkRefresh, getById, getById, getByName, getByName, getBySid, getBySid, getIdForName, getIdForName, getIdForSid, getIdForSid, getIdFromName, getIdFromSid, getNameForId, getNameForId, getNameForSid, getNameForSid, getNameFromId, getNameFromId, getNameFromSid, getObjectById, getSidForName, getSidForName, getSidFromId, getSidFromName, isEmpty, isIdKnown, isNameKnown, refreshIfNeeded
-
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
-
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
-
lookupBySid
Logic to look up a single object for the cache. Note: by default this is not implemented (and will immediately error), so override it if you intend the cache to be populated by secondary ID lookups.- Overrides:
lookupBySidin classAbstractMassCache<AtlanGroup>- Parameters:
alias- unique secondary internal identifier for the object- Throws:
AtlanException- on any error communicating with Atlan
-