/** * Extracts and return the protocol, host, port elements from the URL. * * @param url String of URL that needs to be processed. * @return Array which has elements - protocol, host, and port in the given order. */ public static String[] getProtocolHostPort(String url) throws DataEndpointConfigurationException { String[] keyElements = url.split(DataEndpointConstants.SEPARATOR); String[] urlElements = keyElements[0].split(":"); if (urlElements.length != 3) { throw new DataEndpointConfigurationException("Invalid URL is provided :" + url + ". Receiver URL property should take the format : " + "protocol://host:port"); } return new String[]{urlElements[0], urlElements[1].replace("//", ""), urlElements[2]}; }
log.error(e.getMessage()); } catch (DataEndpointConfigurationException e) { log.error(e.getMessage()); } catch (DataEndpointAuthenticationException e) { log.error(e.getMessage());
} catch (DataEndpointConfigurationException e) { log.error("Error in initializing binary data-publisher to send requests to global throttling engine " + e.getMessage(), e); } catch (DataEndpointAuthenticationException e) { log.error("Error in initializing binary data-publisher to send requests to global throttling engine " +
/** * Extracts and return the protocol, host, port elements from the URL. * * @param url String of URL that needs to be processed. * @return Array which has elements - protocol, host, and port in the given order. */ public static String[] getProtocolHostPort(String url) throws DataEndpointConfigurationException { String[] keyElements = url.split(DataEndpointConstants.SEPARATOR); String[] urlElements = keyElements[0].split(":"); if (urlElements.length != 3) { throw new DataEndpointConfigurationException("Invalid URL is provided :" + url + ". Receiver URL property should take the format : " + "protocol://host:port"); } return new String[]{urlElements[0], urlElements[1].replace("//", ""), urlElements[2]}; }
throw new DataEndpointConfigurationException("Invalid data endpoints URL set provided : " + aURLGroup + ", a URL group can be configured as failover OR load balancing endpoints."); } else if (isLBURL) {
throw new DataEndpointConfigurationException("Invalid data endpoints URL set provided : " + aURLGroup + ", a URL group can be configured as failover OR load balancing endpoints."); } else if (isLBURL) {
boolean isAuthFailOver = (Boolean) ((Object[]) receiverGroups.get(i))[0]; if (isFailOver != isAuthFailOver) { throw new DataEndpointConfigurationException("Receiver and authentication URL group set " + "doesn't match. Receiver URL group: " + getURLSet(receiverGroup) + " is configured as failOver : " + isFailOver + ", but Authentication URL group: " throw new DataEndpointConfigurationException("Receiver and authentication URL group set " + "doesn't match. Receiver URL group: " + getURLSet(receiverGroup) + ", " + "but Authentication URL group: " + getURLSet(authGroup)); throw new DataEndpointConfigurationException("Receiver and authentication URL set doesn't match. " + "Receiver URL groups: " + receiverGroups.size() + ", but Authentication URL groups: " + authGroups.size());
boolean isAuthFailOver = (Boolean) ((Object[]) receiverGroups.get(i))[0]; if (isFailOver != isAuthFailOver) { throw new DataEndpointConfigurationException("Receiver and authentication URL group set " + "doesn't match. Receiver URL group: " + getURLSet(receiverGroup) + " is configured as failOver : " + isFailOver + ", but Authentication URL group: " throw new DataEndpointConfigurationException("Receiver and authentication URL group set doesn't match. " + "Receiver URL group: " + getURLSet(receiverGroup) + ", but Authentication URL group: " + getURLSet(authGroup)); throw new DataEndpointConfigurationException("Receiver and authentication URL set doesn't match. " + "Receiver URL groups: " + receiverGroups.size() + ", but Authentication URL groups: " + authGroups.size());