Class GrouperExternalSystemUsageFinder

java.lang.Object
edu.internet2.middleware.grouper.app.externalSystem.GrouperExternalSystemUsageFinder

public class GrouperExternalSystemUsageFinder extends Object
Finds everywhere in Grouper that a given external system is referenced (used).

There are two reference channels, unioned by this finder:

  • Config editor references stored in the grouper_config table. These are discovered generically: any config attribute that points at an external system declares the external-system class in its config metadata via optionValuesFromClass. We query grouper_config for rows whose value equals the external system config id, then keep only the rows whose metadata declares this external system's class. This is resolved by metadata class, not by key-name patterns, because the same class is referenced under many differently named keys (for example the bearer token external system is used by several app provisioners, each with its own key suffix).
  • Attribute-value references stored in grouper_attribute_assign_value. Group/attribute loaders and report configs are stored as attribute values, not in grouper_config, and do not carry the optionValuesFromClass metadata, so a small fixed set of attribute def names is scanned -- only the ones whose external-system class matches the viewed system.

Config references only (not runtime data such as grouper_sync rows). Disabled configs are included; blank/defaulted values are not matched (only explicit stored values), so the built-in "grouper" DB connection does not list every loader/report that omitted the field.

  • Field Details

    • DEFAULT_MAX_PER_TYPE

      public static final int DEFAULT_MAX_PER_TYPE
      default max references to show per type before truncating
      See Also:
  • Constructor Details

    • GrouperExternalSystemUsageFinder

      public GrouperExternalSystemUsageFinder()
  • Method Details

    • assignExternalSystemClassName

      public GrouperExternalSystemUsageFinder assignExternalSystemClassName(String externalSystemClassName1)
      Parameters:
      externalSystemClassName1 - fully qualified class name of the external system
      Returns:
      this for chaining
    • assignConfigId

      public GrouperExternalSystemUsageFinder assignConfigId(String configId1)
      Parameters:
      configId1 - config id of the external system
      Returns:
      this for chaining
    • assignMaxPerType

      public GrouperExternalSystemUsageFinder assignMaxPerType(int maxPerType1)
      Parameters:
      maxPerType1 - max references to keep per type
      Returns:
      this for chaining
    • isTruncated

      public boolean isTruncated()
      Returns:
      true if any type was truncated (had more than maxPerType references). Only meaningful after findUsages() is called.
    • findUsages

      public List<GrouperExternalSystemUsage> findUsages()
      find the references, grouped by type and capped at maxPerType per type.
      Returns:
      the list of usages (references) ordered by type