private static boolean isSSL(URI uri) { try { CompositeData compositeData = URISupport.parseComposite(uri); if ("ssl".equals(compositeData.getScheme())) { return true; } for(URI component : compositeData.getComponents()){ if ("ssl".equals(component.getScheme())) { return true; } } } catch (URISyntaxException e) { throw new IllegalArgumentException("Attempting to initiate JMS with invalid composite URI [" + uri + "]", e); } return false; }
/** * sets the LDAP server URI * * @param uri * LDAP server URI */ public void setUri(URI uri) throws Exception { CompositeData data = URISupport.parseComposite(uri); if (data.getScheme().equals("failover")) { availableURIs = data.getComponents(); failover = true; } else { availableURIs = new URI[] { uri }; } }
private static boolean isSSL(URI uri) { try { CompositeData compositeData = URISupport.parseComposite(uri); if ("ssl".equals(compositeData.getScheme())) { return true; } for(URI component : compositeData.getComponents()){ if ("ssl".equals(component.getScheme())) { return true; } } } catch (URISyntaxException e) { throw new IllegalArgumentException("Attempting to initiate JMS with invalid composite URI [" + uri + "]", e); } return false; }
@Override public void validate(StartupForm target, List<String> errors, ConfigSource configSource) { if (isNullOrEmpty(target.getQueueUrl())) { if (!configSource.isFile()) { errors.add(String.format(ERROR_REQUIRED, QUEUE_URL)); } return; } try { String value = target.getQueueUrl().replace("localhost", "127.0.0.1"); URI brokerURL = new URI(value); if (isCompositeURI(brokerURL)) { URISupport.CompositeData data = parseComposite(brokerURL); String scheme = data.getScheme(); if (scheme != null && ("failover".equals(scheme) || "fanout".equals(scheme) || "vm".equals(scheme))) { for (URI uri : data.getComponents()) { validateUriContainSpecificScheme(target, errors, uri); } } else { errors.add(String.format(ERROR_INVALID, QUEUE_URL)); } } else { isValidUri(target, errors, value); } } catch (URISyntaxException e) { errors.add(String.format(ERROR_INVALID, QUEUE_URL)); } }
/** * sets the LDAP server URI * * @param uri * LDAP server URI */ public void setUri(URI uri) throws Exception { CompositeData data = URISupport.parseComposite(uri); if (data.getScheme().equals("failover")) { availableURIs = data.getComponents(); failover = true; } else { availableURIs = new URI[] { uri }; } }
/** * sets the LDAP server URI * * @param uri * LDAP server URI */ public void setUri(URI uri) throws Exception { CompositeData data = URISupport.parseComposite(uri); if (data.getScheme().equals("failover")) { availableURIs = data.getComponents(); failover = true; } else { availableURIs = new URI[] { uri }; } }
/** * sets the LDAP server URI * * @param _uri LDAP server URI */ public void setUri(URI _uri) throws Exception { CompositeData data = URISupport.parseComposite(_uri); if(data.getScheme().equals("failover")) { availableURIs = data.getComponents(); failover = true; } else { availableURIs = new URI[]{ _uri }; } }
/** * sets the LDAP server URI * * @param uri * LDAP server URI */ public void setUri(URI uri) throws Exception { CompositeData data = URISupport.parseComposite(uri); if (data.getScheme().equals("failover")) { availableURIs = data.getComponents(); failover = true; } else { availableURIs = new URI[] { uri }; } }