Class GroupCache

All Implemented Interfaces:
Closeable, AutoCloseable

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
    • 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
    • lookupBySid

      protected void lookupBySid(String alias) throws AtlanException
      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 class AbstractMassCache<AtlanGroup>
      Parameters:
      alias - unique secondary internal identifier for the object
      Throws:
      AtlanException - on any error communicating with Atlan
      InvalidRequestException - if not overridden with logic to update cache by secondary ID lookups