Class GroupCache


public class GroupCache extends AbstractMassCache<AtlanGroup>
Lazily-loaded cache for translating Atlan-internal groups into their various IDs.
  • Constructor Details

  • Method Details

    • refreshCache

      protected void refreshCache() throws AtlanException
      Logic to refresh a specific cache en-masse (must be implemented).
      Specified by:
      refreshCache in class AbstractMassCache<AtlanGroup>
      Throws:
      AtlanException - on any error communicating with Atlan to refresh the cache of objects
    • cache

      protected void cache(String id, String name, AtlanGroup object)
      Add an entry to the cache. This should only be called by the lookup methods, which themselves should never directly be invoked.
      Overrides:
      cache in class AbstractMassCache<AtlanGroup>
      Parameters:
      id - Atlan-internal ID
      name - human-readable name
      object - the object to cache (if any)
    • getIdForAlias

      public String getIdForAlias(String alias) throws AtlanException
      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 refreshed
      NotFoundException - if the group cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the group to retrieve
    • getIdForAlias

      public String getIdForAlias(String alias, boolean allowRefresh) throws AtlanException
      Translate the provided human-readable group name to its GUID.
      Parameters:
      alias - name of the group as it appears in the UI
      allowRefresh - 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 refreshed
      NotFoundException - if the group cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the group to retrieve
    • getNameForAlias

      public String getNameForAlias(String alias) throws AtlanException
      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 refreshed
      NotFoundException - if the group cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the group to retrieve
    • getNameForAlias

      public String getNameForAlias(String alias, boolean allowRefresh) throws AtlanException
      Translate the provided human-readable group name to the internal group name.
      Parameters:
      alias - name of the group as it appears in the UI
      allowRefresh - 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 refreshed
      NotFoundException - if the group cannot be found (does not exist) in Atlan
      InvalidRequestException - if no name was provided for the group to retrieve
    • lookupByName

      protected void lookupByName(String name) throws AtlanException
      Logic to look up a single object for the cache.
      Specified by:
      lookupByName in class AbstractMassCache<AtlanGroup>
      Parameters:
      name - unique name for the object
      Throws:
      AtlanException - on any error communicating with Atlan
    • lookupById

      protected void lookupById(String id) throws AtlanException
      Logic to look up a single object for the cache.
      Specified by:
      lookupById in class AbstractMassCache<AtlanGroup>
      Parameters:
      id - unique internal identifier for the object
      Throws:
      AtlanException - on any error communicating with Atlan
    • cacheByAlias

      public void cacheByAlias(String alias) throws AtlanException
      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

      protected void lookupByAlias(String alias) throws AtlanException
      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