|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.internet2.middleware.grouper.misc.GrouperCheckConfig
public class GrouperCheckConfig
check the configuration of grouper to make sure things are configured right, and to give descriptive errors of the problems
Nested Class Summary | |
---|---|
static class |
GrouperCheckConfig.CheckGroupResult
result from check group |
Field Summary | |
---|---|
static String |
GROUPER_PROPERTIES_NAME
|
static Pattern |
grouperLoaderConsumerPattern
match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCron |
static Pattern |
grouperLoaderOtherJobPattern
match something like this: otherJob.duo.class, otherJob.duo.quartzCron, otherJob.duo.priority |
static boolean |
inCheckConfig
if in check config |
static Pattern |
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 |
static Pattern |
messagingListenerConsumerPattern
match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCron |
static Pattern |
typeSecurityPattern
match type security match: security.typeName.wheelOnly match: security.typeName.allowOnlyGroup |
Constructor Summary | |
---|---|
GrouperCheckConfig()
|
Method Summary | |
---|---|
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 |
static String |
attributeLoaderStemName()
return the stem name where the attribute loader attributes go, without colon on end |
static String |
attributeRootStemName()
root stem where attributes live |
static AttributeDefName |
checkAttribute(Stem stem,
AttributeDef attributeDef,
String extension,
String displayExtension,
String description,
boolean logAutocreate)
make sure an attribute is there or add it if not |
static void |
checkAttributes()
make sure configured attributes are there |
static void |
checkConfig()
check the grouper config safely, log errors |
static void |
checkConfigProperties(String resourceName,
String resourceExampleName)
compare a properties file with an example file, compare all the properties |
static boolean |
checkDatabase(String driverClassName,
String connectionUrl,
String dbUser,
String dbPassword,
String databaseDescription)
test a database connection |
static GrouperCheckConfig.CheckGroupResult |
checkGroup(GrouperSession grouperSession,
String groupName,
boolean logError,
Boolean autoCreate,
boolean logAutocreate,
String displayExtension,
String groupDescription,
String propertyDescription,
Group[] groupResult)
verify that a group exists by name (dont throw exceptions) |
static void |
checkGrouperDb()
make sure the grouper.hibernate.properties db settings are correct |
static void |
checkGrouperLoaderConfigDbs()
check the grouper loader db configs |
static void |
checkGrouperLoaderConsumers()
check the grouper loader consumer configs |
static void |
checkGrouperLoaderOtherJobs()
check the grouper loader other jobs configs |
static void |
checkGroups()
make sure configured groups are there |
static void |
checkJar(String name,
long size,
String sampleClassName,
String manifestVersion)
check a jar |
static void |
checkJar(String name,
Set<Long> sizes,
String sampleClassName,
String manifestVersion)
check a jar |
static boolean |
checkResource(String resourcePath)
make sure a resource is on the resource path |
static boolean |
checkResource(String resourcePath,
boolean required)
make sure a resource is on the resource path |
static boolean |
configCheckDisabled()
if the config check is disabled |
static String |
jarVersion(Class sampleClass)
get the version from the manifest of a jar |
static Stem |
legacyAttributeBaseStem(GrouperSession grouperSession)
get or create the legacy attribute base stem |
static void |
main(String[] args)
generate the jars to find |
static String |
manifestProperty(Class sampleClass,
String[] propertyNames)
get the version from the manifest of a jar |
static Map<String,String> |
memberSortSearchSecuritySettings()
|
static boolean |
nonStandardProperty(String resourceName,
String propertyName,
boolean missingPropertyInFile)
return true if this is an exception case, dont worry about it |
static Map<String,String> |
typeSecuritySettings()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String GROUPER_PROPERTIES_NAME
public static boolean inCheckConfig
public static Pattern grouperLoaderConsumerPattern
public static Pattern messagingListenerConsumerPattern
public static Pattern grouperLoaderOtherJobPattern
public static final Pattern typeSecurityPattern
match type security match: security.typeName.wheelOnly match: security.typeName.allowOnlyGroup
public static final Pattern 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 Detail |
---|
public GrouperCheckConfig()
Method Detail |
---|
public static GrouperCheckConfig.CheckGroupResult checkGroup(GrouperSession grouperSession, String groupName, boolean logError, Boolean autoCreate, boolean logAutocreate, String displayExtension, String groupDescription, String propertyDescription, Group[] groupResult)
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
public static void checkJar(String name, long size, String sampleClassName, String manifestVersion)
name
- name of the jar from groupersize
- that the jar should besampleClassName
- inside the jarmanifestVersion
- in the manifest file, which version we are expectingpublic static void checkJar(String name, Set<Long> sizes, String sampleClassName, String manifestVersion)
name
- name of the jar from groupersizes
- that the jar should besampleClassName
- inside the jarmanifestVersion
- in the manifest file, which version we are expectingpublic static boolean checkResource(String resourcePath)
resourcePath
-
public static boolean checkResource(String resourcePath, boolean required)
resourcePath
- required
-
public static boolean configCheckDisabled()
public static void checkConfig()
public static void checkGroups()
public static Map<String,String> typeSecuritySettings()
public static Map<String,String> memberSortSearchSecuritySettings()
public static void checkGrouperDb()
public static boolean checkDatabase(String driverClassName, String connectionUrl, String dbUser, String dbPassword, String databaseDescription)
driverClassName
- connectionUrl
- dbUser
- dbPassword
- databaseDescription
- friendly error description when there is a problem
public static void checkGrouperLoaderConfigDbs()
public static void checkGrouperLoaderOtherJobs()
public static void checkGrouperLoaderConsumers()
public static boolean assertAndRemove(String resourceName, Map<String,String> set, String[] propertiesNames)
resourceName
- set
- of properties that match this patternpropertiesNames
-
public static void main(String[] args) throws Exception
args
-
Exception
public static String jarVersion(Class sampleClass) throws Exception
sampleClass
-
Exception
public static String manifestProperty(Class sampleClass, String[] propertyNames) throws Exception
sampleClass
- propertyNames
- that we are looking for (usually just one)
Exception
public static boolean nonStandardProperty(String resourceName, String propertyName, boolean missingPropertyInFile)
resourceName
- propertyName
- missingPropertyInFile
- true if missing property in file, false if
extra property in file
public static void checkConfigProperties(String resourceName, String resourceExampleName)
resourceName
- resourceExampleName
- public static AttributeDefName checkAttribute(Stem stem, AttributeDef attributeDef, String extension, String displayExtension, String description, boolean logAutocreate)
stem
- attributeDef
- extension
- description
- displayExtension
- logAutocreate
-
public static String attributeLoaderStemName()
public static String attributeRootStemName()
public static void checkAttributes()
public static Stem legacyAttributeBaseStem(GrouperSession grouperSession)
grouperSession
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |