Package com.subgraph.orchid.circuits.path

Examples of com.subgraph.orchid.circuits.path.RouterFilter


 
  @Test
  public void testMaskFilter() {
    final Router r1 = createRouterMockWithAddress("1.2.3.4");
    final Router r2 = createRouterMockWithAddress("1.7.3.4");
    final RouterFilter f = ConfigNodeFilter.createFilterFor("1.2.3.0/16");
    assertTrue(f.filter(r1));
    assertFalse(f.filter(r2));
    verify(r1, r2);
  }
View Full Code Here


    }
    return count;
  }
 
  private Router chooseNewGuard(final Set<Router> excluded) {
    return nodeChooser.chooseRandomNode(WeightRule.WEIGHT_FOR_GUARD, new RouterFilter() {
      public boolean filter(Router router) {
        return router.isValid() && router.isPossibleGuard() && router.isRunning() && !excluded.contains(router);
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.circuits.path.RouterFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.