public static List < ConnectionParams > manyFromConfig ( ConfigParams config , boolean configAsDefault ) { List < ConnectionParams > result = new ArrayList < ConnectionParams > ( ) ; // Try to get multiple connections first ConfigParams connections = config . getSection ( "connections" ) ; if ( connections . size ( ) > 0 ) { List < String > connectionSections = connections . getSectionNames ( ) ; for ( String section : connectionSections ) { ConfigParams connection = connections . getSection ( section ) ; result . add ( new ConnectionParams ( connection ) ) ; } } // Then try to get a single connection else { ConfigParams connection = config . getSection ( "connection" ) ; if ( connection . size ( ) > 0 ) result . add ( new ConnectionParams ( connection ) ) ; // Apply default if possible else if ( configAsDefault ) result . add ( new ConnectionParams ( config ) ) ; } return result ; }
Retrieves all ConnectionParams from configuration parameters from connections section . If connection section is present instead than it returns a list with only one ConnectionParams .