@Test public void testResolveBaseUrlHttpPort() { assertSingleUri("http: }
public static Set<String> parseClusterUrls(final String clusterUrlStr) { final Set<String> urls = new LinkedHashSet<>(); if (clusterUrlStr != null && clusterUrlStr.length() > 0) { Arrays.stream(clusterUrlStr.split(",")) .map(s -> s.trim()) .filter(s -> s.length() > 0) .forEach(s -> { validateUriString(s); urls.add(resolveBaseUrl(s).intern()); }); } if (urls.size() == 0) { throw new IllegalArgumentException("Cluster URL was not specified."); } final Predicate<String> isHttps = url -> url.toLowerCase().startsWith("https:"); if (urls.stream().anyMatch(isHttps) && urls.stream().anyMatch(isHttps.negate())) { throw new IllegalArgumentException("Different protocols are used in the cluster URLs " + clusterUrlStr); } return Collections.unmodifiableSet(urls); }
SiteToSiteRestApiClient implements Closeable { public static Set<String> parseClusterUrls(final String clusterUrlStr) { final Set<String> urls = new LinkedHashSet<>(); if (clusterUrlStr != null && clusterUrlStr.length() > 0) { Arrays.stream(clusterUrlStr.split(",")) .map(s -> s.trim()) .filter(s -> s.length() > 0) .forEach(s -> { validateUriString(s); urls.add(resolveBaseUrl(s).intern()); }); } if (urls.size() == 0) { throw new IllegalArgumentException("Cluster URL was not specified."); } final Predicate<String> isHttps = url -> url.toLowerCase().startsWith("https:"); if (urls.stream().anyMatch(isHttps) && urls.stream().anyMatch(isHttps.negate())) { throw new IllegalArgumentException("Different protocols are used in the cluster URLs " + clusterUrlStr); } return Collections.unmodifiableSet(urls); } }
SiteToSiteRestApiClient implements Closeable { public static Set<String> parseClusterUrls(final String clusterUrlStr) { final Set<String> urls = new LinkedHashSet<>(); if (clusterUrlStr != null && clusterUrlStr.length() > 0) { Arrays.stream(clusterUrlStr.split(",")) .map(s -> s.trim()) .filter(s -> s.length() > 0) .forEach(s -> { validateUriString(s); urls.add(resolveBaseUrl(s).intern()); }); } if (urls.size() == 0) { throw new IllegalArgumentException("Cluster URL was not specified."); } final Predicate<String> isHttps = url -> url.toLowerCase().startsWith("https:"); if (urls.stream().anyMatch(isHttps) && urls.stream().anyMatch(isHttps.negate())) { throw new IllegalArgumentException("Different protocols are used in the cluster URLs " + clusterUrlStr); } return Collections.unmodifiableSet(urls); } SiteToSiteRestApiClient(final SSLContext sslContext, final HttpProxy proxy, final EventReporter eventReporter); }
SiteToSiteRestApiClient implements Closeable { public static Set<String> parseClusterUrls(final String clusterUrlStr) { final Set<String> urls = new LinkedHashSet<>(); if (clusterUrlStr != null && clusterUrlStr.length() > 0) { Arrays.stream(clusterUrlStr.split(",")) .map(s -> s.trim()) .filter(s -> s.length() > 0) .forEach(s -> { validateUriString(s); urls.add(resolveBaseUrl(s).intern()); }); } if (urls.size() == 0) { throw new IllegalArgumentException("Cluster URL was not specified."); } final Predicate<String> isHttps = url -> url.toLowerCase().startsWith("https:"); if (urls.stream().anyMatch(isHttps) && urls.stream().anyMatch(isHttps.negate())) { throw new IllegalArgumentException("Different protocols are used in the cluster URLs " + clusterUrlStr); } return Collections.unmodifiableSet(urls); } SiteToSiteRestApiClient(final SSLContext sslContext, final HttpProxy proxy, final EventReporter eventReporter); @Override void close(); ControllerDTO getController(final String clusterUrls); ControllerDTO getController(final Set<String> clusterUrls); Collection<PeerDTO> getPeers(); String initiateTransaction(final TransferDirection direction, final String portId); boolean openConnectionForReceive(final String transactionUrl, final Peer peer); void openConnectionForSend(final String transactionUrl, final Peer peer); void finishTransferFlowFiles(final CommunicationsSession commSession); TransactionResultEntity extendTransaction(final String transactionUrl); String getBaseUrl(); void setBaseUrl(final String baseUrl); void setConnectTimeoutMillis(final int connectTimeoutMillis); void setReadTimeoutMillis(final int readTimeoutMillis); static String getFirstUrl(final String clusterUrlStr); static Set<String> parseClusterUrls(final String clusterUrlStr); void setBaseUrl(final String scheme, final String host, final int port); void setCompress(final boolean compress); void setLocalAddress(final InetAddress localAddress); void setRequestExpirationMillis(final long requestExpirationMillis); void setBatchCount(final int batchCount); void setBatchSize(final long batchSize); void setBatchDurationMillis(final long batchDurationMillis); Integer getTransactionProtocolVersion(); String getTrustedPeerDn(); TransactionResultEntity commitReceivingFlowFiles(final String transactionUrl, final ResponseCode clientResponse, final String checksum); TransactionResultEntity commitTransferFlowFiles(final String transactionUrl, final ResponseCode clientResponse); }
SiteToSiteRestApiClient implements Closeable { public static Set<String> parseClusterUrls(final String clusterUrlStr) { final Set<String> urls = new LinkedHashSet<>(); if (clusterUrlStr != null && clusterUrlStr.length() > 0) { Arrays.stream(clusterUrlStr.split(",")) .map(s -> s.trim()) .filter(s -> s.length() > 0) .forEach(s -> { validateUriString(s); urls.add(resolveBaseUrl(s).intern()); }); } if (urls.size() == 0) { throw new IllegalArgumentException("Cluster URL was not specified."); } final Predicate<String> isHttps = url -> url.toLowerCase().startsWith("https:"); if (urls.stream().anyMatch(isHttps) && urls.stream().anyMatch(isHttps.negate())) { throw new IllegalArgumentException("Different protocols are used in the cluster URLs " + clusterUrlStr); } return Collections.unmodifiableSet(urls); } SiteToSiteRestApiClient(final SSLContext sslContext, final HttpProxy proxy, final EventReporter eventReporter); @Override void close(); ControllerDTO getController(final String clusterUrls); ControllerDTO getController(final Set<String> clusterUrls); Collection<PeerDTO> getPeers(); String initiateTransaction(final TransferDirection direction, final String portId); boolean openConnectionForReceive(final String transactionUrl, final Peer peer); void openConnectionForSend(final String transactionUrl, final Peer peer); void finishTransferFlowFiles(final CommunicationsSession commSession); TransactionResultEntity extendTransaction(final String transactionUrl); String getBaseUrl(); void setBaseUrl(final String baseUrl); void setConnectTimeoutMillis(final int connectTimeoutMillis); void setReadTimeoutMillis(final int readTimeoutMillis); static String getFirstUrl(final String clusterUrlStr); static Set<String> parseClusterUrls(final String clusterUrlStr); void setBaseUrl(final String scheme, final String host, final int port); void setCompress(final boolean compress); void setLocalAddress(final InetAddress localAddress); void setRequestExpirationMillis(final long requestExpirationMillis); void setBatchCount(final int batchCount); void setBatchSize(final long batchSize); void setBatchDurationMillis(final long batchDurationMillis); Integer getTransactionProtocolVersion(); String getTrustedPeerDn(); TransactionResultEntity commitReceivingFlowFiles(final String transactionUrl, final ResponseCode clientResponse, final String checksum); TransactionResultEntity commitTransferFlowFiles(final String transactionUrl, final ResponseCode clientResponse);  }