edu.internet2.middleware.grouper.app.loader
Class GrouperLoaderConfig

java.lang.Object
  extended by edu.internet2.middleware.grouper.app.loader.GrouperLoaderConfig

public class GrouperLoaderConfig
extends java.lang.Object


Field Summary
static java.lang.String DEFAULT_SUBJECT_SOURCE_ID
          name of param: default.subject.source.id if you want queries which do not specify subject source to come from a certain source, specify here (improves performance so it doesnt search through all sources) default is 10
static java.lang.String LOADER_RETAIN_DB_LOGS_DAYS
          name of param: loader.retain.db.logs.days number of days to retain db logs in table grouperloader_log
static java.lang.String LOADER_THREAD_POOL_SIZE
          name of param: loader.thread.pool.size number of threads in the loader threadpool.
static java.util.Map<java.lang.String,java.lang.String> testConfig
          set some test config overrides
 
Method Summary
static boolean getPropertyBoolean(java.lang.String property, boolean defaultValue)
          Get a Grouper configuration parameter as boolean (must be true|t|false|f case-insensitive)
static int getPropertyInt(java.lang.String property, int defaultValue)
          Get a Grouper configuration parameter an integer
static java.lang.String getPropertyString(java.lang.String property)
          Get a Grouper configuration parameter.
static java.lang.String getPropertyString(java.lang.String property, boolean required)
          Get a Grouper configuration parameter.
static java.lang.String getPropertyString(java.lang.String property, java.lang.String defaultValue)
          Get a Grouper configuration parameter.
static java.util.Properties properties()
          get all properties including test properties
static GrouperLoaderDb retrieveDbProfile(java.lang.String name)
          get a profile by name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOADER_RETAIN_DB_LOGS_DAYS

public static final java.lang.String LOADER_RETAIN_DB_LOGS_DAYS
name of param: loader.retain.db.logs.days number of days to retain db logs in table grouperloader_log. -1 is forever. default is 7

See Also:
Constant Field Values

LOADER_THREAD_POOL_SIZE

public static final java.lang.String LOADER_THREAD_POOL_SIZE
name of param: loader.thread.pool.size number of threads in the loader threadpool. Only this number of jobs can run at once jobs which are on deck will block, or will fail if the blocking timeout occurs a job is running if it is loading (not just scheduled). default is 10

See Also:
Constant Field Values

DEFAULT_SUBJECT_SOURCE_ID

public static final java.lang.String DEFAULT_SUBJECT_SOURCE_ID
name of param: default.subject.source.id if you want queries which do not specify subject source to come from a certain source, specify here (improves performance so it doesnt search through all sources) default is 10

See Also:
Constant Field Values

testConfig

public static final java.util.Map<java.lang.String,java.lang.String> testConfig
set some test config overrides

Method Detail

getPropertyBoolean

public static boolean getPropertyBoolean(java.lang.String property,
                                         boolean defaultValue)
                                  throws java.lang.NumberFormatException
Get a Grouper configuration parameter as boolean (must be true|t|false|f case-insensitive)

Parameters:
property - to lookup
defaultValue - if the property is not there
Returns:
Value of configuration parameter or null if parameter isnt specified. Exception is thrown if not formatted correcly
Throws:
java.lang.NumberFormatException - if cannot convert the value to an Integer

getPropertyInt

public static int getPropertyInt(java.lang.String property,
                                 int defaultValue)
                          throws java.lang.NumberFormatException
Get a Grouper configuration parameter an integer

Parameters:
property - to lookup
defaultValue - of the int if not there
Returns:
Value of configuration parameter or null if parameter isnt specified. Exception is thrown if not formatted correcly
Throws:
java.lang.NumberFormatException - if cannot convert the value to an Integer

getPropertyString

public static java.lang.String getPropertyString(java.lang.String property)
Get a Grouper configuration parameter.
 String wheel = GrouperLoaderConfig.getProperty("groups.wheel.group");
 

Parameters:
property - to lookup
Returns:
Value of configuration parameter or an empty string if parameter is invalid.

getPropertyString

public static java.lang.String getPropertyString(java.lang.String property,
                                                 boolean required)
Get a Grouper configuration parameter.
 String wheel = GrouperLoaderConfig.getProperty("groups.wheel.group");
 

Parameters:
property - to lookup
required - if property is required. if so, exception if not found. if not, null if not found. note if value is not filled in, but name is there, then still exception if required
Returns:
Value of configuration parameter or null if parameter is not there

properties

public static java.util.Properties properties()
get all properties including test properties

Returns:
properties

getPropertyString

public static java.lang.String getPropertyString(java.lang.String property,
                                                 java.lang.String defaultValue)
Get a Grouper configuration parameter.
 String wheel = GrouperLoaderConfig.getProperty("groups.wheel.group");
 

Parameters:
property - to lookup
defaultValue - is the value if the property isnt found
Returns:
Value of configuration parameter or the default value (will trim the value)

retrieveDbProfile

public static GrouperLoaderDb retrieveDbProfile(java.lang.String name)
get a profile by name. if "grouper" then get the hibernate db connection specify the db connection with user, pass, url, and driver class the string after "db." is the name of the connection, and it should not have spaces or other special chars in it db.warehouse.user = mylogin db.warehouse.pass = secret db.warehouse.url = jdbc:mysql://localhost:3306/grouper db.warehouse.driver = com.mysql.jdbc.Driver

Parameters:
name -
Returns:
the db