/** * Validates a connection property value. * <p> * Ensures that the connection property value is not {@code null}, has a length * greater than zero and matches the validation regular expression. * * @param propertyValue the connection property value * @throws IllegalArgumentException if the given {@code propertyValue} is {@code null} or zero length or * does not match the validation regular expression */ public void validateValue(String propertyValue) { validateValue(propertyValue, ""); }
/** * Validates a connection property value. * <p> * Ensures that the connection property value is not {@code null}, has a length * greater than zero and matches the validation regular expression. * * @param propertyValue the connection property value * @throws IllegalArgumentException if the given {@code propertyValue} is {@code null} or zero length or * does not match the validation regular expression */ public void validateValue(String propertyValue) { validateValue(propertyValue, ""); }
/** * Ensures that the data represents a valid OAuth connection. */ public void validate() { ForceConnectionProperty.ENDPOINT.validateValue(getEndpoint()); ForceConnectionProperty.OAUTH_KEY.validateValue(getOauthKey()); ForceConnectionProperty.OAUTH_SECRET.validateValue(getOauthSecret()); } }
private void setPropsFromMap(Map<ForceConnectionProperty, String> propMap, String propSource) { String errorMessage = "Could not load valid ForceOAuthConnectionInfo properties from " + propSource + "."; String endpointValue = propMap.get(ForceConnectionProperty.ENDPOINT); ForceConnectionProperty.ENDPOINT.validateValue(endpointValue, errorMessage); setEndpoint(endpointValue); String oauthKeyValue = propMap.get(ForceConnectionProperty.OAUTH_KEY); ForceConnectionProperty.OAUTH_KEY.validateValue(oauthKeyValue, errorMessage); setOauthKey(oauthKeyValue); String oauthSecretValue = propMap.get(ForceConnectionProperty.OAUTH_SECRET); ForceConnectionProperty.OAUTH_SECRET.validateValue(oauthSecretValue, errorMessage); setOauthSecret(oauthSecretValue); }
/** * Ensures that the data represents a valid OAuth connection. */ public void validate() { ForceConnectionProperty.ENDPOINT.validateValue(getEndpoint()); ForceConnectionProperty.OAUTH_KEY.validateValue(getOauthKey()); ForceConnectionProperty.OAUTH_SECRET.validateValue(getOauthSecret()); } }
private void setPropsFromMap(Map<ForceConnectionProperty, String> propMap, String propSource) { String errorMessage = "Could not load valid ForceOAuthConnectionInfo properties from " + propSource + "."; String endpointValue = propMap.get(ForceConnectionProperty.ENDPOINT); ForceConnectionProperty.ENDPOINT.validateValue(endpointValue, errorMessage); setEndpoint(endpointValue); String oauthKeyValue = propMap.get(ForceConnectionProperty.OAUTH_KEY); ForceConnectionProperty.OAUTH_KEY.validateValue(oauthKeyValue, errorMessage); setOauthKey(oauthKeyValue); String oauthSecretValue = propMap.get(ForceConnectionProperty.OAUTH_SECRET); ForceConnectionProperty.OAUTH_SECRET.validateValue(oauthSecretValue, errorMessage); setOauthSecret(oauthSecretValue); }
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); } }
ForceConnectionProperty.ENDPOINT.validateValue(endpoint, "Illegal connection url (" + connectionUrl + ")."); connectorPropMap.put(ForceConnectionProperty.ENDPOINT, endpoint);
ForceConnectionProperty.ENDPOINT.validateValue(endpoint, "Illegal connection url (" + connectionUrl + ")."); connectorPropMap.put(ForceConnectionProperty.ENDPOINT, endpoint);