Class GrouperCheckConfig

java.lang.Object
edu.internet2.middleware.grouper.misc.GrouperCheckConfig

public class GrouperCheckConfig extends Object
check the configuration of grouper to make sure things are configured right, and to give descriptive errors of the problems
  • Field Details

    • GROUPER_PROPERTIES_NAME

      public static final String GROUPER_PROPERTIES_NAME
      See Also:
    • inCheckConfig

      public static boolean inCheckConfig
      if in check config
    • grouperLoaderConsumerPattern

      public static Pattern grouperLoaderConsumerPattern
      match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCron
    • messagingListenerConsumerPattern

      public static Pattern messagingListenerConsumerPattern
      match something like this: changeLog.consumer.ldappc.class, changeLog.consumer.ldappc.quartzCron
    • grouperLoaderOtherJobPattern

      public static Pattern grouperLoaderOtherJobPattern
      match something like this: otherJob.duo.class, otherJob.duo.quartzCron, otherJob.duo.priority
    • typeSecurityPattern

      public static final Pattern typeSecurityPattern
       match type security
       match: security.typeName.wheelOnly
       match: security.typeName.allowOnlyGroup
       
    • memberSortSearchSecurityPattern

      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 Details

    • GrouperCheckConfig

      public GrouperCheckConfig()
  • Method Details

    • isDoneWithExtraconfig

      public static boolean isDoneWithExtraconfig()
      Returns:
      true when done with extra config
    • waitUntilDoneWithExtraConfig

      public static void waitUntilDoneWithExtraConfig()
    • checkJar

      public static void checkJar(String name, long size, String sampleClassName, String manifestVersion)
      check a jar
      Parameters:
      name - name of the jar from grouper
      size - that the jar should be
      sampleClassName - inside the jar
      manifestVersion - 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 grouper
      sizes - that the jar should be
      sampleClassName - inside the jar
      manifestVersion - in the manifest file, which version we are expecting
    • checkResource

      public static boolean checkResource(String resourcePath)
      make sure a resource is on the resource path
      Parameters:
      resourcePath -
      Returns:
      false if problem or if not checking configs
    • checkResource

      public static boolean checkResource(String resourcePath, boolean required)
      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

      public static Map<String,Stem> getStemNameToStem()
      built in stems by name (dont change these)!
      Returns:
    • checkGroups

      public static void checkGroups()
      make sure configured groups are there
    • typeSecuritySettings

      public static Map<String,String> typeSecuritySettings()
      Returns:
      the map of settings from grouper.properties
    • memberSortSearchSecuritySettings

      public static Map<String,String> 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 pattern
      propertiesNames -
      Returns:
      true if found one
    • jarVersion

      public static String jarVersion(Class sampleClass) throws Exception
      get the version from the manifest of a jar
      Parameters:
      sampleClass -
      Returns:
      the version
      Throws:
      Exception
    • manifestProperty

      public static String manifestProperty(Class sampleClass, String[] propertyNames) throws Exception
      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

      public static void checkConfigProperties(String resourceName, String resourceExampleName)
      compare a properties file with an example file, compare all the properties
      Parameters:
      resourceName -
      resourceExampleName -
    • 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

      public static String attributeLoaderStemName()
      return the stem name where the attribute loader attributes go, without colon on end
      Returns:
      stem name
    • attributeRootStemName

      public static String attributeRootStemName()
      root stem where attributes live
      Returns:
      attribute built in stem name
    • loaderMetadataStemName

      public static String 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()