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, lock
-
Constructor Summary
-
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 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
lookupBySid
(String alias) 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, getIdForName, getIdForSid, getIdForSid, getIdFromName, getIdFromSid, getNameForId, getNameForId, getNameForSid, getNameForSid, getNameFromId, getNameFromId, getNameFromSid, getObjectById, getSidForName, getSidForName, getSidFromId, getSidFromName, isEmpty, isIdKnown, isNameKnown, refresh
-
Constructor Details
-
GroupCache
-
-
Method Details
-
refreshCache
Logic to refresh a specific cache en-masse (must be implemented).- Specified by:
refreshCache
in 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:
lookupByName
in 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:
lookupById
in 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:
lookupBySid
in classAbstractMassCache<AtlanGroup>
- Parameters:
alias
- unique secondary internal identifier for the object- Throws:
AtlanException
- on any error communicating with AtlanInvalidRequestException
- if not overridden with logic to update cache by secondary ID lookups
-