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
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
GrouperConfigurationModuleAttribute> call retrieveAttributes() to get thisextra configs that dont match the regex or prefix -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changeStatus
(boolean enable, StringBuilder message, List<String> errorsToDisplay, Map<String, String> validationErrorsToDisplay) change status of config to disable/enablevoid
clear the attribute cache which also clears the expression language cachevoid
deleteConfig
(boolean fromUi) delete configvoid
editConfig
(boolean fromUi, StringBuilder message, List<String> errorsToDisplay, Map<String, String> validationErrorsToDisplay, List<String> actionsPerformed) save the attribute in an edit.formatIndexes
(String realConfigSuffix, boolean hasIconfigSuffix, String label) format indexes to be the number or a label (take special logic)abstract ConfigFileName
config file name to check for properties and metadataconfig idabstract String
config id regeg eg: ^(provisioner)\\.([^.]+)\\.(.*)$config id that identified this config.abstract String
prefix for the properties eg: provisioner.someConfigId.protected abstract String
for each type of configuration this is the prefix for eg in subsections.get description of the config systemget documentation of the config systemprotected String
property suffix that will be used to identify the config eg classproperty value that identifies the config.get description of the start with systemget documentation of the config systemget subsections for the UIgetTitle()
get title of the grouper daemon configurationvoid
insertConfig
(boolean fromUi, StringBuilder message, List<String> errorsToDisplay, Map<String, String> validationErrorsToDisplay, List<String> actionsPerformed) save the attribute in an insert.boolean
is the config enabled or notboolean
can there be multiple instances of this config.get all configurations configured for this typevoid
populateConfigurationValuesFromUi
(javax.servlet.http.HttpServletRequest request) void
populateValuesLabelsFromOptionValueClass
(Map<String, GrouperConfigurationModuleAttribute> attributesSoFar, GrouperConfigurationModuleAttribute grouperConfigModuleAttribute) 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 configstatic List<GrouperConfigurationModuleBase>
retrieveAllConfigurations
(Set<String> classNames) list of configured systemsstatic List<GrouperConfigurationModuleBase>
retrieveAllConfigurationTypesHelper
(Set<String> classNames) list of systems that can be configuredretrieve attributes based on the instance.retrieve attribute and values from config (lightweight and fast).retrieveAttributeValueFromConfig
(String suffix, boolean required) retrieve value from config (lightweight and fast).get a set of config idsget configuration names configured by prefixexpression language substitute mapretrieveSuffix
(Pattern pattern, String propertyName) retrieve suffix based on the property nameretrieveText
(String suffix) void
setConfigId
(String configId) config idshowAttributeOverride
(String suffix) void
validatePreSave
(boolean isInsert, List<String> errorsToDisplay, Map<String, String> validationErrorsToDisplay) validations to run before saving values into db
-
Field Details
-
extraConfigKeys
extra configs that dont match the regex or prefix -
attributeCache
call retrieveAttributes() to get this
-
-
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
property suffix that will be used to identify the config eg class- Returns:
-
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
config id that identified this config. either suffix and value or getConfigIdThatIdentifiesThisConfig is required, not both. eg: personLdap- Returns:
-
retrieveExtraConfigKeys
-
retrieveAllConfigurationTypesHelper
public static List<GrouperConfigurationModuleBase> retrieveAllConfigurationTypesHelper(Set<String> classNames) list of systems that can be configured- Returns:
-
formatIndexes
format indexes to be the number or a label (take special logic)- Parameters:
grouperConfigModule
-realConfigSuffix
-hasIconfigSuffix
-label
-- Returns:
- the formatted label
-
listAllConfigurationsOfThisType
get all configurations configured for this type- Returns:
-
retrieveAllConfigurations
public static List<GrouperConfigurationModuleBase> retrieveAllConfigurations(Set<String> classNames) list of configured systems- Returns:
-
getConfigId
config id- Returns:
-
setConfigId
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
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
retrieve attribute and values from config (lightweight and fast). Key is the config suffix- Returns:
- key / value pairs
-
retrieveAttributeValueFromConfig
retrieve value from config (lightweight and fast). Key is the config suffix- Parameters:
suffix
- suffix on the config keyrequired
- true if an exception should be thrown if not configured- Returns:
- value or null or empty if not there
-
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
config file name to check for properties and metadata- Returns:
-
getConfigItemPrefix
prefix for the properties eg: provisioner.someConfigId.- Returns:
- the prefix
-
getConfigIdRegex
config id regeg eg: ^(provisioner)\\.([^.]+)\\.(.*)$- Returns:
-
retrieveSuffix
retrieve suffix based on the property name- Parameters:
pattern
-propertyName
-- Returns:
-
getSubSections
get subsections for the UI- Returns:
-
populateValuesLabelsFromOptionValueClass
public void populateValuesLabelsFromOptionValueClass(Map<String, GrouperConfigurationModuleAttribute> attributesSoFar, GrouperConfigurationModuleAttribute grouperConfigModuleAttribute) -
showAttributeOverride
- 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 oneerrorsToDisplay
- 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
get configuration names configured by prefix- Parameters:
prefix
- of config e.g. ldap.personLdap.- Returns:
- the list of configured keys
-
getTitle
get title of the grouper daemon configuration- Returns:
-
getDescription
get description of the config system- Returns:
-
getDocumentation
get documentation of the config system- Returns:
-
getStartWithDescription
get description of the start with system- Returns:
-
getStartWithDocumentation
get documentation of the config system- Returns:
-
retrieveConfigurationConfigIds
get a set of config ids- Returns:
-
getConfigurationTypePrefix
for each type of configuration this is the prefix for eg in subsections. only ui concern in external text config.- Returns:
-
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
-
getCacheEntityAttributePrefix
-
getCacheMembershipAttributePrefix
-
getCacheGroupAttributePrefix
-
retrieveText
-