Create a @SocketStoreClientFactory from the given configPops

@param bootstrapURLs
@param configProps
@return
180087
private SocketStoreClientFactory getFatClientFactory(String[] bootstrapURLs,
                                                         Properties configProps) {

        ClientConfig fatClientConfig = new ClientConfig(configProps);
        logger.info("Using config: " + fatClientConfig);
        fatClientConfig.setBootstrapUrls(bootstrapURLs)
                       .setEnableCompressionLayer(false)
                       .setEnableSerializationLayer(false)
                       .enableDefaultClient(true)
                       .setEnableLazy(false);

        return new SocketStoreClientFactory(fatClientConfig);
    }
505228
public void bootStrap(String customClusterXml, String customStoresXml) {
        AbstractStoreClientFactory factory = (AbstractStoreClientFactory) this.storeFactory;
        this.store = factory.getRawStore(storeName, null, customStoresXml, customClusterXml, null);
    }
1048654
@SuppressWarnings("unchecked")
    public void raConfigure(ConfigProperties properties) {
        String httpClientFactoryClassName = (String) properties.getProperty(CFG_PROPERTY_HTTP_CLIENT_FACTORY)
                .getValue();
        if (httpClientFactoryClassName.isEmpty()) {
            maxTotal = (Integer) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_TOTAL).getValue();

            maxForRoutes = new HashMap<HttpRoute, Integer>();

            defaultMaxForRoute = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_MAX_FOR_ROUTE).getValue();

            String maxForRoutesString = (String) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_FOR_ROUTES)
                    .getValue();

            String[] maxForRoutesStrings = maxForRoutesString.split(",");

            for (String maxForRoute : maxForRoutesStrings) {
                if (maxForRoute.isEmpty()) {
                    continue;
                }
                String[] maxForRouteParts = maxForRoute.split(":");

                String scheme = maxForRouteParts[HTTP_SCHEME_INDEX];
                if (scheme == null || scheme.equals("")) {
                    scheme = HttpHost.DEFAULT_SCHEME_NAME;
                }

                String host = maxForRouteParts[HTTP_HOST_INDEX];

                String portStr = maxForRouteParts[HTTP_PORT_INDEX];
                if (portStr == null || portStr.equals("")) {
                    portStr = "80";
                }

                int port = Integer.parseInt(portStr);

                String maxForRoutePartsStr = maxForRouteParts[HTTP_MAXFORROUTE_INDEX];
                Integer max = Integer.valueOf(maxForRoutePartsStr);

                HttpRoute httpRoute = new HttpRoute(new HttpHost(host, port, scheme));

                maxForRoutes.put(httpRoute, max);
            }
        } else {
            try {
                httpClientFactory = ((Class<? extends HttpClientFactory>) Class.forName(httpClientFactoryClassName))
                        .newInstance();
            } catch (Exception e) {
                tracer.severe("failed to load http client factory class", e);
            }
        }
    }
1336504
public static LocationCollectionClient install(@NonNull Context context, long defaultInterval) {
    Context applicationContext;
    if (context.getApplicationContext() == null) {
      // In shared processes content providers getApplicationContext() can return null.
      applicationContext = context;
    } else {
      applicationContext = context.getApplicationContext();
    }

    synchronized (lock) {
      if (locationCollectionClient == null) {
        locationCollectionClient = new LocationCollectionClient(new LocationEngineControllerImpl(applicationContext,
          LocationEngineProvider.getBestLocationEngine(applicationContext), new LocationUpdatesBroadcastReceiver()),
          new HandlerThread("LocationSettingsChangeThread"),
          new SessionIdentifier(defaultInterval),
          applicationContext.getSharedPreferences(MAPBOX_SHARED_PREFERENCES, Context.MODE_PRIVATE),
          // Provide empty token as it is not available yet
          new MapboxTelemetry(applicationContext, "",
            String.format("%s/%s", LOCATION_COLLECTOR_USER_AGENT, BuildConfig.VERSION_NAME)));
      }
    }
    return locationCollectionClient;
  }
261711
public static <T> ProviderBootstrap<T> from(ProviderConfig<T> providerConfig) {
        String bootstrap = providerConfig.getBootstrap();
        if (StringUtils.isEmpty(bootstrap)) {
            // Use default provider bootstrap
            bootstrap = RpcConfigs.getStringValue(RpcOptions.DEFAULT_PROVIDER_BOOTSTRAP);
            providerConfig.setBootstrap(bootstrap);
        }
        ProviderBootstrap providerBootstrap = ExtensionLoaderFactory.getExtensionLoader(ProviderBootstrap.class)
            .getExtension(bootstrap, new Class[] { ProviderConfig.class }, new Object[] { providerConfig });
        return (ProviderBootstrap<T>) providerBootstrap;
    }
1300391
@Override
    public ORB createServerORB(Map<String, Object> config, Map<String, Object> extraConfig, List<IIOPEndpoint> endpoints, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
        ORB orb = createORB(translateToTargetArgs(config, subsystemFactories), translateToTargetProps(config, extraConfig, endpoints, subsystemFactories));
        return orb;
    }
1145514
public static List<Properties> loadGenericJobConfigs(Properties sysProps)
      throws ConfigurationException, IOException {
    Path rootPath = new Path(sysProps.getProperty(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY));
    PullFileLoader loader = new PullFileLoader(rootPath, rootPath.getFileSystem(new Configuration()),
        getJobConfigurationFileExtensions(sysProps), PullFileLoader.DEFAULT_HOCON_PULL_FILE_EXTENSIONS);
    Config sysConfig = ConfigUtils.propertiesToConfig(sysProps);
    Collection<Config> configs =
        loader.loadPullFilesRecursively(rootPath, sysConfig, true);

    List<Properties> jobConfigs = Lists.newArrayList();
    for (Config config : configs) {
      try {
        jobConfigs.add(resolveTemplate(ConfigUtils.configToProperties(config)));
      } catch (IOException ioe) {
        LOGGER.error("Could not parse job config at " + ConfigUtils.getString(config,
            ConfigurationKeys.JOB_CONFIG_FILE_PATH_KEY, "Unknown path"), ioe);
      }
    }

    return jobConfigs;
  }
609711
public static void configureFactory( ConnectionFactory factory, Map<String,String> configuration )
	throws IOException {

		final Logger logger = Logger.getLogger( RabbitMqUtils.class.getName());
		logger.fine( "Configuring a connection factory for RabbitMQ." );

		String messageServerIp = configuration.get( RABBITMQ_SERVER_IP );
		if( messageServerIp != null ) {
			Map.Entry<String,Integer> entry = Utils.findUrlAndPort( messageServerIp );
			factory.setHost( entry.getKey());
			if( entry.getValue() > 0 )
				factory.setPort( entry.getValue());
		}

		factory.setUsername( configuration.get( RABBITMQ_SERVER_USERNAME ));
		factory.setPassword( configuration.get( RABBITMQ_SERVER_PASSWORD ));

		// Timeout for connection establishment: 5s
		factory.setConnectionTimeout( 5000 );

		// Configure automatic reconnection
		factory.setAutomaticRecoveryEnabled( true );

		// Recovery interval: 10s
		factory.setNetworkRecoveryInterval( 10000 );

		// Exchanges and so on should be redeclared if necessary
		factory.setTopologyRecoveryEnabled( true );

		// SSL
		if( Boolean.parseBoolean( configuration.get( RABBITMQ_USE_SSL ))) {
			logger.fine( "Connection factory for RabbitMQ: SSL is used." );

			InputStream clientIS = null;
			InputStream storeIS = null;
			try {
				clientIS = new FileInputStream( configuration.get( RABBITMQ_SSL_KEY_STORE_PATH ));
				storeIS = new FileInputStream( configuration.get( RABBITMQ_SSL_TRUST_STORE_PATH ));

				char[] keyStorePassphrase = configuration.get( RABBITMQ_SSL_KEY_STORE_PASSPHRASE ).toCharArray();
				KeyStore ks = KeyStore.getInstance( getValue( configuration, RABBITMQ_SSL_KEY_STORE_TYPE, DEFAULT_SSL_KEY_STORE_TYPE ));
				ks.load( clientIS, keyStorePassphrase );

				String value = getValue( configuration, RABBITMQ_SSL_KEY_MNGR_FACTORY, DEFAULT_SSL_MNGR_FACTORY );
				KeyManagerFactory kmf = KeyManagerFactory.getInstance( value );
				kmf.init( ks, keyStorePassphrase );

				char[] trustStorePassphrase = configuration.get( RABBITMQ_SSL_TRUST_STORE_PASSPHRASE ).toCharArray();
				KeyStore tks = KeyStore.getInstance( getValue( configuration, RABBITMQ_SSL_TRUST_STORE_TYPE, DEFAULT_SSL_TRUST_STORE_TYPE ));
				tks.load( storeIS, trustStorePassphrase );

				value = getValue( configuration, RABBITMQ_SSL_TRUST_MNGR_FACTORY, DEFAULT_SSL_MNGR_FACTORY );
				TrustManagerFactory tmf = TrustManagerFactory.getInstance( value );
				tmf.init( tks );

				SSLContext c = SSLContext.getInstance( getValue( configuration, RABBITMQ_SSL_PROTOCOL, DEFAULT_SSL_PROTOCOL ));
				c.init( kmf.getKeyManagers(), tmf.getTrustManagers(), null );
				factory.useSslProtocol( c );

			} catch( GeneralSecurityException e ) {
				throw new IOException( "SSL configuration for the RabbitMQ factory failed.", e );

			} finally {
				Utils.closeQuietly( storeIS );
				Utils.closeQuietly( clientIS );
			}
		}
	}
605032
public static ClientConfiguration createClient(final List<Endpoint> endpoints, final List<DataProvider> providers) {
        return createClient(null, null, endpoints, providers);
    }
150892
public static void enableJava2SecurityIfSet(BootstrapConfig bootProps, List<URL> urlList) {
        if (bootProps.get(BootstrapConstants.JAVA_2_SECURITY_PROPERTY) != null) {

            NameBasedLocalBundleRepository repo = new NameBasedLocalBundleRepository(bootProps.getInstallRoot());
            urlList.add(getJarFileFromBundleName(repo, "com.ibm.ws.org.eclipse.equinox.region", "[1.0,1.0.100)"));
            // the following three jar files are for serialfilter which are loaded by URLClassloader by bootstrap agent.
            urlList.add(getJarFileFromBundleName(repo, "com.ibm.ws.kernel.instrument.serialfilter", "[1.0,1.0.100)"));
            addJarFileIfExist(urlList, bootProps.getInstallRoot() + "/bin/tools/ws-javaagent.jar");
            addJarFileIfExist(urlList, bootProps.getInstallRoot() + "/lib/bootstrap-agent.jar");
            Policy wlpPolicy = new WLPDynamicPolicy(Policy.getPolicy(), urlList);
            Policy.setPolicy(wlpPolicy);
        }

    }
895741
public static DefaultConnectionFactory newConnectionFactory(final AbstractLdapProperties l) {
        final ConnectionConfig cc = newConnectionConfig(l);
        final DefaultConnectionFactory bindCf = new DefaultConnectionFactory(cc);
        if (l.getProviderClass() != null) {
            try {
                final Constructor<? extends Provider> constructor = CommonHelper.getConstructor(l.getProviderClass());
                bindCf.setProvider(constructor.newInstance());
            } catch (final Exception e) {
                LOGGER.error(e.getMessage(), e);
            }
        }
        return bindCf;
    }
476540
public static Properties buildKafkaConsumerProps(String bootstrapServers,
            String consumerGroupId, boolean consumeFromBeginning, boolean autoCommitOffsets) {
        return buildKafkaConsumerProps(bootstrapServers, consumerGroupId, consumeFromBeginning,
                autoCommitOffsets, null);
    }
1270358
public static Properties buildKafkaProducerProps(ProducerType type, String bootstrapServers) {
        return buildKafkaProducerProps(type, bootstrapServers, null);
    }
1150191
public static Collection<GobblinInstancePluginFactory> instantiatePluginsFromSysConfig(Config config)
      throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    String pluginsStr = config.getString(PLUGINS_KEY);
    List<GobblinInstancePluginFactory> plugins = Lists.newArrayList();
    for (String pluginName : Splitter.on(",").split(pluginsStr)) {
      plugins.add(instantiatePluginByAlias(pluginName));
    }
    return plugins;
  }
1272961
public static Properties replaceDeprecatedProducerKeys(Properties configProps) {
		// Replace deprecated key
		if (configProps.containsKey(ProducerConfigConstants.COLLECTION_MAX_COUNT)) {
			configProps.setProperty(COLLECTION_MAX_COUNT,
					configProps.getProperty(ProducerConfigConstants.COLLECTION_MAX_COUNT));
			configProps.remove(ProducerConfigConstants.COLLECTION_MAX_COUNT);
		}
		// Replace deprecated key
		if (configProps.containsKey(ProducerConfigConstants.AGGREGATION_MAX_COUNT)) {
			configProps.setProperty(AGGREGATION_MAX_COUNT,
					configProps.getProperty(ProducerConfigConstants.AGGREGATION_MAX_COUNT));
			configProps.remove(ProducerConfigConstants.AGGREGATION_MAX_COUNT);
		}
		return configProps;
	}
51781
public static StatsTraceContext newClientContext(
      final CallOptions callOptions, final Attributes transportAttrs, Metadata headers) {
    List<ClientStreamTracer.Factory> factories = callOptions.getStreamTracerFactories();
    if (factories.isEmpty()) {
      return NOOP;
    }
    ClientStreamTracer.StreamInfo info =
        ClientStreamTracer.StreamInfo.newBuilder()
            .setTransportAttrs(transportAttrs).setCallOptions(callOptions).build();
    // This array will be iterated multiple times per RPC. Use primitive array instead of Collection
    // so that for-each doesn't create an Iterator every time.
    StreamTracer[] tracers = new StreamTracer[factories.size()];
    for (int i = 0; i < tracers.length; i++) {
      tracers[i] = factories.get(i).newClientStreamTracer(info, headers);
    }
    return new StatsTraceContext(tracers);
  }
1318314
private ContactBootstrapServiceResponse contactBootstrapService(
                                                                    CredentialType credentialType, ClientAttachProperties cap, ClientConnectionFactory ccf) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "contactBootstrapService", new Object[] { credentialType, cap, ccf });

        ClientConnection cc = null;
        TrmClientBootstrapReply cbr = null;
        int rc = TrmConstantsImpl.RETURN_CODE_NOK;
        List<String> uncontactableBootstrapServers = new ArrayList<String>(); //250165
        List<String> failedBootstrapServers = new ArrayList<String>(); //250165
        Exception firstMirroredFailureException = null;
        Exception firstBootstrapFailureException = null;
        boolean goodReply = false;

        List endpoints = cap.getProviderEPs();
        Iterator i = endpoints.iterator();
        ProviderEndPoint ep = null;
        while (i.hasNext()) {
            ep = (ProviderEndPoint) i.next();
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "Making bootstrap request to " + ep.getEndPointInfo());

            cc = ccf.createClientConnection();

            if (cc != null) {
                ConnectionProperties cp = new ConnectionProperties(ep);
                cp.setClientConnectionPropertyMap(cap.getProperties()); // Pass comms the connection property map       LIDB3743

                ClientBootstrapHandler cbh = new ClientBootstrapHandler(cap, credentialType, ep.getChain());

                try {
                    cc.connect(cp, cbh);

                    TrmFirstContactMessage fcm = cbh.getReply();
                    cbr = fcm.makeInboundTrmClientBootstrapReply();

                    rc = cbr.getReturnCode().intValue();

                    // no point checking other bootstrap service if authentication has failed - break out of while loop
                    if (rc == TrmConstantsImpl.RETURN_CODE_SIAuthenticationException) {
                        firstMirroredFailureException = generateException(rc,
                                                                          nls.getFormattedMessage("LIBERTY_FAILED_AUTHENTICATION_CWSIT0128",
                                                                                                  new Object[] { cap.getBusName(), ep.getEndPointInfo(),
                                                                                                                Utils.getFailureMessage(cbr.getFailureReason()) }, null), null,
                                                                          false);
                        // SIAuthenticationExc is not permitted to have a linked exception, and in basically
                        // all cases the cbh.getException() will be null because it is only set by protocol
                        // exceptions.

                        // d347701 - Make sure we tidy up the connection if we aren't going to use it.
                        cc.close();
                        break;
                    }

                    // no point checking other bootstrap service if not authorised - break out of while loop
                    if (rc == TrmConstantsImpl.RETURN_CODE_SINotAuthorizedException) {
                        firstMirroredFailureException = generateException(rc,
                                                                          nls.getFormattedMessage("LIBERTY_NOT_AUTHORIZED_CWSIT0129",
                                                                                                  new Object[] { cap.getBusName(), ep.getEndPointInfo(),
                                                                                                                Utils.getFailureMessage(cbr.getFailureReason()) }, null), null,
                                                                          false);
                        // NotAuthorizedExc is not permitted to have a linked exception, and in basically
                        // all cases the cbh.getException() will be null because it is only set by protocol
                        // exceptions.

                        // d347701 - Make sure we tidy up the connection if we aren't going to use it.
                        cc.close();
                        break;
                    }

                    if (rc == TrmConstantsImpl.RETURN_CODE_OK) {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(tc, "Made a bootstrap request to "
                                            + ep.getEndPointInfo() + ". Response was "
                                            + (rc == TrmConstantsImpl.RETURN_CODE_OK ? "OK" : "REDIRECT"));

                        goodReply = true;

      
                        break;
                    } else {
                        Object[] objs = new Object[] {
                                                      ep.getEndPointInfo(), cap.getBusName(), rc == TrmConstantsImpl.RETURN_CODE_REDIRECT ? "REDIRECT TWAS" : Utils.getFailureMessage(cbr.getFailureReason()) };
                        //SibTr.warning(tc, Suppressor.ALL_FOR_A_WHILE_SIMILAR_INSERTS, "LIBERTY_MIRRORED_FAILURE_CWSIT0130", objs);
                        Exception exception = generateException(
                                                                rc, nls.getFormattedMessage("LIBERTY_MIRRORED_FAILURE_CWSIT0130", objs, null), cbh.getException(), false);
                        SibTr.exception(tc, exception);
                        // store the first Exception of this kind
                        if (null == firstMirroredFailureException) {
                            firstMirroredFailureException = exception;
                        }
                        failedBootstrapServers.add(ep.getEndPointInfo()); //250165

                        // d273578 - Close the connection if we decide it is inappropriate to use it.
                        cc.close();
                    }
                } catch (Exception e) {
                    // No FFDC code needed
                    Object[] objs = new Object[] { ep.getEndPointInfo(), e.toString() };
                    //SibTr.warning(tc, Suppressor.ALL_FOR_A_WHILE_SIMILAR_INSERTS, "LIBERTY_BOOTSTRAP_FAILED_CWSIT0131", objs); //248969
                    SIResourceException sire = new SIResourceException(nls.getFormattedMessage(
                                                                                               "LIBERTY_BOOTSTRAP_FAILED_CWSIT0131", objs, null), e);
                    SibTr.exception(tc, sire);
                    // store the first Exception of this kind
                    if (null == firstBootstrapFailureException) {
                        firstBootstrapFailureException = sire;
                    }
                    uncontactableBootstrapServers.add(ep.getEndPointInfo()); //250165
                } // try

            } else {
                throw new SIErrorException(nls.getString("NO_CC_CWSIT0005"));
            } // if (cc != null)
        } // while

        // create BootstrapResponse
        ContactBootstrapServiceResponse cbsr = new ContactBootstrapServiceResponse(cc, cbr, rc, uncontactableBootstrapServers, failedBootstrapServers, firstMirroredFailureException, firstBootstrapFailureException, goodReply, ep);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "contactBootstrapService", cbsr);

        return cbsr;
    }