private void setPropsFromMap(Map<ForceConnectionProperty, String> propMap, String propSource) { String errorMessage = "Could not load valid ForceConnectorConfig properties from " + propSource + "."; String endpointValue = propMap.get(ForceConnectionProperty.ENDPOINT); ForceConnectionProperty.ENDPOINT.validateValue(endpointValue, errorMessage); setAuthEndpoint(endpointValue); String userValue = propMap.get(ForceConnectionProperty.USER); ForceConnectionProperty.USER.validateValue(userValue, errorMessage); setUsername(userValue); String passwordValue = propMap.get(ForceConnectionProperty.PASSWORD); ForceConnectionProperty.PASSWORD.validateValue(passwordValue, errorMessage); setPassword(passwordValue); String clientIdValue; if ((clientIdValue = propMap.get(ForceConnectionProperty.CLIENTID)) != null) { ForceConnectionProperty.CLIENTID.validateValue(clientIdValue, errorMessage); setClientId(clientIdValue); } String timeoutValue; if ((timeoutValue = propMap.get(ForceConnectionProperty.TIMEOUT)) != null) { ForceConnectionProperty.TIMEOUT.validateValue(timeoutValue, errorMessage); int timeout = Integer.valueOf(timeoutValue); if (timeout > 0) setReadTimeout(timeout); } }
private void setPropsFromMap(Map<ForceConnectionProperty, String> propMap, String propSource) { String errorMessage = "Could not load valid ForceConnectorConfig properties from " + propSource + "."; String endpointValue = propMap.get(ForceConnectionProperty.ENDPOINT); ForceConnectionProperty.ENDPOINT.validateValue(endpointValue, errorMessage); setAuthEndpoint(endpointValue); String userValue = propMap.get(ForceConnectionProperty.USER); ForceConnectionProperty.USER.validateValue(userValue, errorMessage); setUsername(userValue); String passwordValue = propMap.get(ForceConnectionProperty.PASSWORD); ForceConnectionProperty.PASSWORD.validateValue(passwordValue, errorMessage); setPassword(passwordValue); String clientIdValue; if ((clientIdValue = propMap.get(ForceConnectionProperty.CLIENTID)) != null) { ForceConnectionProperty.CLIENTID.validateValue(clientIdValue, errorMessage); setClientId(clientIdValue); } String timeoutValue; if ((timeoutValue = propMap.get(ForceConnectionProperty.TIMEOUT)) != null) { ForceConnectionProperty.TIMEOUT.validateValue(timeoutValue, errorMessage); int timeout = Integer.valueOf(timeoutValue); if (timeout > 0) setReadTimeout(timeout); } }
private void initConfig() { if (config.getSessionRenewer() == null) { config.setSessionRenewer(this); } // Add proxy information to config if (DEFAULT_PROXY != null && (config.getProxy() != Proxy.NO_PROXY || config.getProxy().type() == Type.DIRECT)) { config.setProxy(DEFAULT_PROXY); } // Transfer any extra state we have to config if (this.timeout > 0) config.setReadTimeout(this.timeout); }
private void initConfig() { if (config.getSessionRenewer() == null) { config.setSessionRenewer(this); } // Add proxy information to config if (DEFAULT_PROXY != null && (config.getProxy() != Proxy.NO_PROXY || config.getProxy().type() == Type.DIRECT)) { config.setProxy(DEFAULT_PROXY); } // Transfer any extra state we have to config if (this.timeout > 0) config.setReadTimeout(this.timeout); }