@Test public void returnsARemoteReplicaGivenStringURIOnConfigWithRemoteReplicaWithSameURI() throws Exception { HttpClusterConfig clusterConfig = new HttpClusterConfig(replica, otherReplica); assertThat(clusterConfig.getReplica("http: }
@Override public Replica getReplica(String info) { try { URI uri = new URI(info); if (local.match(uri)) return local; return StreamSupport.stream(remote().spliterator(), false).filter(match(uri)).findFirst().get(); } catch (URISyntaxException e) { throw new RaftHttpException(info + " is not a valid URI, cannot find a corresponding replica", e); } }
HttpClusterConfig implements ClusterConfig { @Override public Replica getReplica(String info) { try { URI uri = new URI(info); if (local.match(uri)) return local; return StreamSupport.stream(remote().spliterator(), false).filter(match(uri)).findFirst().get(); } catch (URISyntaxException e) { throw new RaftHttpException(info + " is not a valid URI, cannot find a corresponding replica", e); } } }
HttpClusterConfig implements ClusterConfig { @Override public Replica getReplica(String info) { try { URI uri = new URI(info); if (local.match(uri)) return local; return StreamSupport.stream(remote().spliterator(), false).filter(match(uri)).findFirst().get(); } catch (URISyntaxException e) { throw new RaftHttpException(info + " is not a valid URI, cannot find a corresponding replica", e); } } HttpClusterConfig(HttpReplica local, HttpReplica... remotes); }
HttpClusterConfig implements ClusterConfig { @Override public Replica getReplica(String info) { try { URI uri = new URI(info); if (local.match(uri)) return local; return StreamSupport.stream(remote().spliterator(), false).filter(match(uri)).findFirst().get(); } catch (URISyntaxException e) { throw new RaftHttpException(info + " is not a valid URI, cannot find a corresponding replica", e); } } HttpClusterConfig(HttpReplica local, HttpReplica... remotes); List<HttpReplica> getCluster(); static @Nonnull ClusterConfig from(@Nonnull HttpReplica local, HttpReplica... remotes); @Override Replica local(); @Override Iterable<Replica> remote(); @Override Replica getReplica(String info); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
HttpClusterConfig implements ClusterConfig { @Override public Replica getReplica(String info) { try { URI uri = new URI(info); if (local.match(uri)) return local; return StreamSupport.stream(remote().spliterator(), false).filter(match(uri)).findFirst().get(); } catch (URISyntaxException e) { throw new RaftHttpException(info + " is not a valid URI, cannot find a corresponding replica", e); } } HttpClusterConfig(HttpReplica local, HttpReplica... remotes); List<HttpReplica> getCluster(); static @Nonnull ClusterConfig from(@Nonnull HttpReplica local, HttpReplica... remotes); @Override Replica local(); @Override Iterable<Replica> remote(); @Override Replica getReplica(String info); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }