private void createAllOrganizations ( Map < String , JsonObject > foundCertificateAuthorities ) throws NetworkConfigurationException { // Sanity check if ( organizations != null ) { throw new NetworkConfigurationException ( "INTERNAL ERROR: organizations has already been initialized!" ) ; } organizations = new HashMap <> ( ) ; // organizations is a JSON object containing a nested object for each Org JsonObject jsonOrganizations = getJsonObject ( jsonConfig , "organizations" ) ; if ( jsonOrganizations != null ) { for ( Entry < String , JsonValue > entry : jsonOrganizations . entrySet ( ) ) { String orgName = entry . getKey ( ) ; JsonObject jsonOrg = getJsonValueAsObject ( entry . getValue ( ) ) ; if ( jsonOrg == null ) { throw new NetworkConfigurationException ( format ( "Error loading config. Invalid Organization entry: %s" , orgName ) ) ; } OrgInfo org = createOrg ( orgName , jsonOrg , foundCertificateAuthorities ) ; organizations . put ( orgName , org ) ; } } }
Creates JsonObjects representing all the Organizations defined in the config file