Class GrouperCheckConfig
java.lang.Object
edu.internet2.middleware.grouper.misc.GrouperCheckConfig
check the configuration of grouper to make sure things are configured right, and
to give descriptive errors of the problems
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
result from check group -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static Pattern
match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCronstatic Pattern
match something like this: otherJob.duo.class, otherJob.duo.quartzCron, otherJob.duo.prioritystatic boolean
if in check configstatic final Pattern
match security for search and sort strings match: security.member.sort.string[0-4].allowOnlyGroup match: security.member.sort.string[0-4].wheelOnly match: security.member.search.string[0-4].allowOnlyGroup match: security.member.search.string[0-4].wheelOnlystatic Pattern
match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCronstatic final Pattern
match type security match: security.typeName.wheelOnly match: security.typeName.allowOnlyGroup -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
if one there, then they all must be there, and remove, return true if found onestatic String
return the stem name where the attribute loader attributes go, without colon on endstatic String
root stem where attributes livestatic AttributeDefName
checkAttribute
(Stem stem, AttributeDef attributeDef, String extension, String displayExtension, String description, boolean logAutocreate) Deprecated.use: AttributeDefName attributeDefName = new AttributeDefNameSave(attributeDef).assignName(stem.getName() + ":extension").assignCreateParentStemsIfNotExist(true).assignDisplayExtension(displayExtension).assignDescription("description").save();static AttributeDefNameSave
checkAttribute
(Stem stem, AttributeDef attributeDef, String extension, String displayExtension, String description, List<AttributeDefNameSave> attributeDefNameSaves) make sure an attribute is there or add it if notstatic void
static void
static void
check the grouper config safely, log errorsstatic void
checkConfigProperties
(String resourceName, String resourceExampleName) compare a properties file with an example file, compare all the propertiesstatic boolean
checkDatabase
(String driverClassName, String connectionUrl, String dbUser, String dbPassword, String databaseDescription) test a database connectionstatic void
checkGroup
(GrouperSession grouperSession, String groupName, boolean logError, Boolean autoCreate, boolean logAutocreate, String displayExtension, String groupDescription, String propertyDescription, Group[] groupResult) Deprecated.use: Group group = new GroupSave().assignName("name").assignDisplayExtension("displayExtension").assignDescription("description").assignCreateParentStemsIfNotExist(true).save();static void
make sure the grouper.hibernate.properties db settings are correctstatic void
check the grouper loader db configsstatic void
check the grouper loader consumer configsstatic void
check the grouper loader other jobs configsstatic void
make sure configured groups are therestatic void
check a jarstatic void
check a jarstatic void
call this to init data in grouperstatic boolean
checkResource
(String resourcePath) make sure a resource is on the resource pathstatic boolean
checkResource
(String resourcePath, boolean required) make sure a resource is on the resource pathstatic void
static boolean
if the config check is disabledbuilt in stems by name (dont change these)!static boolean
static boolean
return if in check configstatic String
jarVersion
(Class sampleClass) get the version from the manifest of a jarstatic String
static String
manifestProperty
(Class sampleClass, String[] propertyNames) get the version from the manifest of a jarstatic boolean
nonStandardProperty
(String resourceName, String propertyName, boolean missingPropertyInFile) return true if this is an exception case, dont worry about itstatic void
static void
-
Field Details
-
GROUPER_PROPERTIES_NAME
- See Also:
-
inCheckConfig
public static boolean inCheckConfigif in check config -
grouperLoaderConsumerPattern
match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCron -
messagingListenerConsumerPattern
match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCron -
grouperLoaderOtherJobPattern
match something like this: otherJob.duo.class, otherJob.duo.quartzCron, otherJob.duo.priority -
typeSecurityPattern
match type security match: security.typeName.wheelOnly match: security.typeName.allowOnlyGroup
-
memberSortSearchSecurityPattern
match security for search and sort strings match: security.member.sort.string[0-4].allowOnlyGroup match: security.member.sort.string[0-4].wheelOnly match: security.member.search.string[0-4].allowOnlyGroup match: security.member.search.string[0-4].wheelOnly
-
-
Constructor Details
-
GrouperCheckConfig
public GrouperCheckConfig()
-
-
Method Details
-
isDoneWithExtraconfig
public static boolean isDoneWithExtraconfig()- Returns:
- true when done with extra config
-
waitUntilDoneWithExtraConfig
public static void waitUntilDoneWithExtraConfig() -
checkGroup
@Deprecated public static GrouperCheckConfig.CheckGroupResult checkGroup(GrouperSession grouperSession, String groupName, boolean logError, Boolean autoCreate, boolean logAutocreate, String displayExtension, String groupDescription, String propertyDescription, Group[] groupResult) Deprecated.use: Group group = new GroupSave().assignName("name").assignDisplayExtension("displayExtension").assignDescription("description").assignCreateParentStemsIfNotExist(true).save();verify that a group exists by name (dont throw exceptions)- Parameters:
grouperSession
- (probably should be root session)groupName
-logError
-autoCreate
- if auto create, or null, for grouper.properties settinglogAutocreate
-displayExtension
- optional, dislpay extension if creatinggroupDescription
- group description if auto createpropertyDescription
- for logging explaning to the user how to fix the problemgroupResult
- put in an array of size one to get the group back- Returns:
- if group exists or not or was created
-
checkJar
check a jar- Parameters:
name
- name of the jar from groupersize
- that the jar should besampleClassName
- inside the jarmanifestVersion
- in the manifest file, which version we are expecting
-
checkJar
public static void checkJar(String name, Set<Long> sizes, String sampleClassName, String manifestVersion) check a jar- Parameters:
name
- name of the jar from groupersizes
- that the jar should besampleClassName
- inside the jarmanifestVersion
- in the manifest file, which version we are expecting
-
checkResource
make sure a resource is on the resource path- Parameters:
resourcePath
-- Returns:
- false if problem or if not checking configs
-
checkResource
make sure a resource is on the resource path- Parameters:
resourcePath
-required
-- Returns:
- false if problem or if not checking configs
-
configCheckDisabled
public static boolean configCheckDisabled()if the config check is disabled- Returns:
- if the config check is disabled
-
checkConfig
public static void checkConfig()check the grouper config safely, log errors -
postSteps
public static void postSteps() -
checkFields
public static void checkFields() -
checkStems
public static void checkStems() -
getStemNameToStem
built in stems by name (dont change these)!- Returns:
-
checkGroups
public static void checkGroups()make sure configured groups are there -
typeSecuritySettings
- Returns:
- the map of settings from grouper.properties
-
memberSortSearchSecuritySettings
- Returns:
- the map of settings from grouper.properties
-
checkGrouperDb
public static void checkGrouperDb()make sure the grouper.hibernate.properties db settings are correct -
checkDatabase
public static boolean checkDatabase(String driverClassName, String connectionUrl, String dbUser, String dbPassword, String databaseDescription) test a database connection- Parameters:
driverClassName
-connectionUrl
-dbUser
-dbPassword
-databaseDescription
- friendly error description when there is a problem- Returns:
- true if it is ok, false if there is a problem
-
checkGrouperLoaderConfigDbs
public static void checkGrouperLoaderConfigDbs()check the grouper loader db configs -
checkGrouperLoaderOtherJobs
public static void checkGrouperLoaderOtherJobs()check the grouper loader other jobs configs -
checkGrouperLoaderConsumers
public static void checkGrouperLoaderConsumers()check the grouper loader consumer configs -
assertAndRemove
public static boolean assertAndRemove(String resourceName, Map<String, String> set, String[] propertiesNames) if one there, then they all must be there, and remove, return true if found one- Parameters:
resourceName
-set
- of properties that match this patternpropertiesNames
-- Returns:
- true if found one
-
jarVersion
get the version from the manifest of a jar- Parameters:
sampleClass
-- Returns:
- the version
- Throws:
Exception
-
manifestProperty
get the version from the manifest of a jar- Parameters:
sampleClass
-propertyNames
- that we are looking for (usually just one)- Returns:
- the version
- Throws:
Exception
-
nonStandardProperty
public static boolean nonStandardProperty(String resourceName, String propertyName, boolean missingPropertyInFile) return true if this is an exception case, dont worry about it- Parameters:
resourceName
-propertyName
-missingPropertyInFile
- true if missing property in file, false if extra property in file- Returns:
- true if exception case
-
isInCheckConfig
public static boolean isInCheckConfig()return if in check config- Returns:
- if in check config
-
checkConfigProperties
compare a properties file with an example file, compare all the properties- Parameters:
resourceName
-resourceExampleName
-
-
checkAttribute
@Deprecated public static AttributeDefName checkAttribute(Stem stem, AttributeDef attributeDef, String extension, String displayExtension, String description, boolean logAutocreate) Deprecated.use: AttributeDefName attributeDefName = new AttributeDefNameSave(attributeDef).assignName(stem.getName() + ":extension").assignCreateParentStemsIfNotExist(true).assignDisplayExtension(displayExtension).assignDescription("description").save();make sure an attribute is there or add it if not- Parameters:
stem
-attributeDef
-extension
-displayExtension
-description
-logAutocreate
-- Returns:
- the attribute def name
-
checkAttribute
public static AttributeDefNameSave checkAttribute(Stem stem, AttributeDef attributeDef, String extension, String displayExtension, String description, List<AttributeDefNameSave> attributeDefNameSaves) make sure an attribute is there or add it if not- Parameters:
stem
-attributeDef
-extension
-displayExtension
-description
-logAutocreate
-- Returns:
- the attribute def name
-
attributeLoaderStemName
return the stem name where the attribute loader attributes go, without colon on end- Returns:
- stem name
-
attributeRootStemName
root stem where attributes live- Returns:
- attribute built in stem name
-
loaderMetadataStemName
- Returns:
- the stem name
-
checkObjects
public static void checkObjects()call this to init data in grouper -
checkAttributeDefs
public static void checkAttributeDefs() -
checkAttributeDefNames
public static void checkAttributeDefNames()
-