@Test public void testGatherIpHostnameMapping() { TestApplication app = TestApplication.Factory.newManagedInstanceForTests(); List<Entity> entities = Lists.newArrayList( entityWithHostnameAndAddress(app, "a.example.com", "1.2.3.4"), entityWithHostnameAndAddress(app, "b.example.com", "1.2.4.3"), entityWithHostnameAndAddress(app, "c.example.com", "1.4.2.3")); Map<String, String> expected = ImmutableMap.of( "1.2.3.4", "a.example.com", "1.2.4.3", "b.example.com", "1.4.2.3", "c.example.com"); assertEquals(EtcHostsManager.gatherIpHostnameMapping(entities, Attributes.ADDRESS), expected); }
public static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities) { return gatherIpHostnameMapping(entities, Attributes.SUBNET_ADDRESS); }
EtcHostsManager { public static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities) { return gatherIpHostnameMapping(entities, Attributes.SUBNET_ADDRESS); } }
EtcHostsManager { public static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities) { return gatherIpHostnameMapping(entities, Attributes.SUBNET_ADDRESS); } private  EtcHostsManager(); }
EtcHostsManager { public static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities) { return gatherIpHostnameMapping(entities, Attributes.SUBNET_ADDRESS); } private  EtcHostsManager(); static void setHostsOnMachines(Iterable<? extends Entity> machines); static void setHostsOnMachines(Iterable<? extends Entity> machines, AttributeSensor<String> addressSensor); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities, AttributeSensor<String> addressSensor); }
EtcHostsManager { public static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities) { return gatherIpHostnameMapping(entities, Attributes.SUBNET_ADDRESS); } private  EtcHostsManager(); static void setHostsOnMachines(Iterable<? extends Entity> machines); static void setHostsOnMachines(Iterable<? extends Entity> machines, AttributeSensor<String> addressSensor); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities); static Map<String, String> gatherIpHostnameMapping(Iterable<? extends Entity> entities, AttributeSensor<String> addressSensor);  }