Class GrouperConfigurationModuleBase

java.lang.Object
edu.internet2.middleware.grouper.app.config.GrouperConfigurationModuleBase
Direct Known Subclasses:
CustomUiConfiguration, GlobalAttributeResolverConfiguration, GrouperDaemonConfiguration, GrouperDataFieldConfiguration, GrouperDataProviderChangeLogQueryConfiguration, GrouperDataProviderConfiguration, GrouperDataProviderQueryConfiguration, GrouperDataRowConfiguration, GrouperExternalSystem, GrouperPrivacyRealmConfiguration, GshTemplateConfiguration, OidcConfiguration, ProvisionerStartWithBase, ProvisioningConfiguration, SqlSyncConfiguration, SubjectSourceConfiguration, WsTrustedJwtConfiguration

public abstract class GrouperConfigurationModuleBase extends Object
  • Field Details

  • Constructor Details

    • GrouperConfigurationModuleBase

      public GrouperConfigurationModuleBase()
  • Method Details

    • changeStatus

      public void changeStatus(boolean enable, StringBuilder message, List<String> errorsToDisplay, Map<String,String> validationErrorsToDisplay)
      change status of config to disable/enable
      Parameters:
      enable -
      message -
      errorsToDisplay -
      validationErrorsToDisplay -
    • isEnabled

      public boolean isEnabled()
      is the config enabled or not
      Returns:
      if enabled
    • getPropertySuffixThatIdentifiesThisConfig

      public String getPropertySuffixThatIdentifiesThisConfig()
      property suffix that will be used to identify the config eg class
      Returns:
    • getPropertyValueThatIdentifiesThisConfig

      public String getPropertyValueThatIdentifiesThisConfig()
      property value that identifies the config. Suffix is required for this property to be useful. eg: edu.internet2.middleware.grouper.app.ldapProvisioning.LdapSync
      Returns:
    • getConfigIdThatIdentifiesThisConfig

      public String getConfigIdThatIdentifiesThisConfig()
      config id that identified this config. either suffix and value or getConfigIdThatIdentifiesThisConfig is required, not both. eg: personLdap
      Returns:
    • retrieveExtraConfigKeys

      public Set<String> retrieveExtraConfigKeys()
    • retrieveAllConfigurationTypesHelper

      public static List<GrouperConfigurationModuleBase> retrieveAllConfigurationTypesHelper(Set<String> classNames)
      list of systems that can be configured
      Returns:
    • formatIndexes

      public String formatIndexes(String realConfigSuffix, boolean hasIconfigSuffix, String label)
      format indexes to be the number or a label (take special logic)
      Parameters:
      grouperConfigModule -
      realConfigSuffix -
      hasIconfigSuffix -
      label -
      Returns:
      the formatted label
    • listAllConfigurationsOfThisType

      public List<GrouperConfigurationModuleBase> listAllConfigurationsOfThisType()
      get all configurations configured for this type
      Returns:
    • retrieveAllConfigurations

      public static List<GrouperConfigurationModuleBase> retrieveAllConfigurations(Set<String> classNames)
      list of configured systems
      Returns:
    • getConfigId

      public String getConfigId()
      config id
      Returns:
    • setConfigId

      public void setConfigId(String configId)
      config id
      Parameters:
      configId -
    • validatePreSave

      public void validatePreSave(boolean isInsert, List<String> errorsToDisplay, Map<String,String> validationErrorsToDisplay)
      validations to run before saving values into db
      Parameters:
      isInsert -
      errorsToDisplay -
      validationErrorsToDisplay -
    • retrieveObjectValueSubstituteMap

      public Map<String,Object> retrieveObjectValueSubstituteMap()
      expression language substitute map
      Returns:
    • populateConfigurationValuesFromUi

      public void populateConfigurationValuesFromUi(javax.servlet.http.HttpServletRequest request)
    • clearAttributeCache

      public void clearAttributeCache()
      clear the attribute cache which also clears the expression language cache
    • retrieveAttributesFromConfig

      public Map<String,String> retrieveAttributesFromConfig()
      retrieve attribute and values from config (lightweight and fast). Key is the config suffix
      Returns:
      key / value pairs
    • retrieveAttributeValueFromConfig

      public String retrieveAttributeValueFromConfig(String suffix, boolean required)
      retrieve value from config (lightweight and fast). Key is the config suffix
      Parameters:
      suffix - suffix on the config key
      required - true if an exception should be thrown if not configured
      Returns:
      value or null or empty if not there
    • retrieveAttributes

      public Map<String,GrouperConfigurationModuleAttribute> retrieveAttributes()
      retrieve attributes based on the instance. Key is the config suffix. This is a heavyweight method that takes a while and should only be used on edit screens or submitting from edit screens Normally just retrieve config or you can call retrieveAttributesFromConfig
      Returns:
      the map
    • getConfigFileName

      public abstract ConfigFileName getConfigFileName()
      config file name to check for properties and metadata
      Returns:
    • getConfigItemPrefix

      public abstract String getConfigItemPrefix()
      prefix for the properties eg: provisioner.someConfigId.
      Returns:
      the prefix
    • getConfigIdRegex

      public abstract String getConfigIdRegex()
      config id regeg eg: ^(provisioner)\\.([^.]+)\\.(.*)$
      Returns:
    • retrieveSuffix

      public String retrieveSuffix(Pattern pattern, String propertyName)
      retrieve suffix based on the property name
      Parameters:
      pattern -
      propertyName -
      Returns:
    • getSubSections

      public List<GrouperConfigurationModuleSubSection> getSubSections()
      get subsections for the UI
      Returns:
    • populateValuesLabelsFromOptionValueClass

      public void populateValuesLabelsFromOptionValueClass(Map<String,GrouperConfigurationModuleAttribute> attributesSoFar, GrouperConfigurationModuleAttribute grouperConfigModuleAttribute)
    • showAttributeOverride

      public Boolean showAttributeOverride(String suffix)
      Parameters:
      suffix -
      Returns:
    • insertConfig

      public void insertConfig(boolean fromUi, StringBuilder message, List<String> errorsToDisplay, Map<String,String> validationErrorsToDisplay, List<String> actionsPerformed)
      save the attribute in an insert. Note, if theres a failure, you should see if any made it
      Parameters:
      attributesToSave - are the attributes from "retrieveAttributes" with values in there if a value is blank, then dont save that one
      errorsToDisplay - call from ui: guiResponseJs.addAction(GuiScreenAction.newMessage(GuiMessageType.error, message.toString()));
      validationErrorsToDisplay - call from ui: guiResponseJs.addAction(GuiScreenAction.newValidationMessage(GuiMessageType.error, validationKey, validationErrorsToDisplay.get(validationKey)));
    • deleteConfig

      public void deleteConfig(boolean fromUi)
      delete config
      Parameters:
      fromUi -
    • editConfig

      public void editConfig(boolean fromUi, StringBuilder message, List<String> errorsToDisplay, Map<String,String> validationErrorsToDisplay, List<String> actionsPerformed)
      save the attribute in an edit. Note, if theres a failure, you should see if any made it
      Parameters:
      fromUi -
      message -
      attributesFromUser - are the attributes from "retrieveAttributes" with values in there if a value is blank, then dont save that one (delete)
      errorsToDisplay - call from ui: guiResponseJs.addAction(GuiScreenAction.newMessage(GuiMessageType.error, message.toString()));
      validationErrorsToDisplay - call from ui: guiResponseJs.addAction(GuiScreenAction.newValidationMessage(GuiMessageType.error, validationKey, validationErrorsToDisplay.get(validationKey)));
      actionsPerformed - add to screen so user knows what is going on
    • removeNoUnsedConfigs

      public void removeNoUnsedConfigs(Map<String,Set<GrouperConfigHibernate>> keyToConfigHibernate, List<String> actionsPerformed)
      remove extraneous properties that are only in the database but not part of this provisioner config
      Parameters:
      keyToConfigHibernate -
      actionsPerformed -
    • retrieveConfigurationKeysByPrefix

      public Set<String> retrieveConfigurationKeysByPrefix(String prefix)
      get configuration names configured by prefix
      Parameters:
      prefix - of config e.g. ldap.personLdap.
      Returns:
      the list of configured keys
    • getTitle

      public String getTitle()
      get title of the grouper daemon configuration
      Returns:
    • getDescription

      public String getDescription()
      get description of the config system
      Returns:
    • getDocumentation

      public String getDocumentation()
      get documentation of the config system
      Returns:
    • getStartWithDescription

      public String getStartWithDescription()
      get description of the start with system
      Returns:
    • getStartWithDocumentation

      public String getStartWithDocumentation()
      get documentation of the config system
      Returns:
    • retrieveConfigurationConfigIds

      public Set<String> retrieveConfigurationConfigIds()
      get a set of config ids
      Returns:
    • getConfigurationTypePrefix

      protected abstract String getConfigurationTypePrefix()
      for each type of configuration this is the prefix for eg in subsections. only ui concern in external text config.
      Returns:
    • getGenericConfigId

      protected String getGenericConfigId()
    • isMultiple

      public boolean isMultiple()
      can there be multiple instances of this config. for eg: LdapProvisionerConfig is true but for GrouperDaemonChangeLogRulesConfiguration is false
      Returns:
    • getCacheAttributePrefix

      public String getCacheAttributePrefix()
    • getCacheEntityAttributePrefix

      public String getCacheEntityAttributePrefix()
    • getCacheMembershipAttributePrefix

      public String getCacheMembershipAttributePrefix()
    • getCacheGroupAttributePrefix

      public String getCacheGroupAttributePrefix()
    • retrieveText

      public String retrieveText(String suffix)