@Test public void theBuilderLegacy() throws NoMachinesAvailableException { provisioner2 = new FixedListMachineProvisioningLocation.Builder(mgmt.getLocationManager()). user("u1"). addAddress("192.168.0.1"). addAddress("u2@192.168.0.2"). addAddress("192.168.0.{3,4}"). addAddresses("192.168.0.{6-8}"). addAddressMultipleTimes("192.168.0.{8,7}", 2). addAddress("u3@192.168.0.{11-20}"). build(); assertUserAndHost(provisioner2.obtain(), "u1", "192.168.0.1"); assertUserAndHost(provisioner2.obtain(), "u2", "192.168.0.2"); for (int i=3; i<=4; i++) assertUserAndHost(provisioner2.obtain(), "u1", "192.168.0."+i); for (int i=6; i<=8; i++) assertUserAndHost(provisioner2.obtain(), "u1", "192.168.0."+i); for (int j=0; j<2; j++) for (int i=8; i>=7; i--) assertUserAndHost(provisioner2.obtain(), "u1", "192.168.0."+i); for (int i=11; i<=20; i++) assertUserAndHost(provisioner2.obtain(), "u3", "192.168.0."+i); try { provisioner2.obtain(); fail("Should not have obtained"); } catch (Exception e) { } }
public T obtain() throws NoMachinesAvailableException { return obtain(Maps.<String,Object>newLinkedHashMap()); }
FixedListMachineProvisioningLocation extends AbstractLocation implements MachineProvisioningLocation<T>, Closeable { public T obtain() throws NoMachinesAvailableException { return obtain(Maps.<String,Object>newLinkedHashMap()); } }
FixedListMachineProvisioningLocation extends AbstractLocation implements MachineProvisioningLocation<T>, Closeable { public T obtain() throws NoMachinesAvailableException { return obtain(Maps.<String,Object>newLinkedHashMap()); } FixedListMachineProvisioningLocation();  FixedListMachineProvisioningLocation(Map properties); }
FixedListMachineProvisioningLocation extends AbstractLocation implements MachineProvisioningLocation<T>, Closeable { public T obtain() throws NoMachinesAvailableException { return obtain(Maps.<String,Object>newLinkedHashMap()); } FixedListMachineProvisioningLocation();  FixedListMachineProvisioningLocation(Map properties); @Override void init(); @Override String toVerboseString(); @Override AbstractLocation configure(Map<?,?> properties); @SuppressWarnings("unchecked") FixedListMachineProvisioningLocation<T> newSubLocation(Map<?,?> newFlags); @Override void close(); void addMachine(T machine); void removeMachine(T machine); Set<T> getAvailable(); Set<T> getInUse(); Set<T> getAllMachines(); @Override void addChild(Location child); @Override boolean removeChild(Location child); T obtain(); @Override T obtain(Map<?,?> flags); @Override void release(T machine); @Override Map<String,Object> getProvisioningFlags(Collection<String> tags); }
FixedListMachineProvisioningLocation extends AbstractLocation implements MachineProvisioningLocation<T>, Closeable { public T obtain() throws NoMachinesAvailableException { return obtain(Maps.<String,Object>newLinkedHashMap()); } FixedListMachineProvisioningLocation();  FixedListMachineProvisioningLocation(Map properties); @Override void init(); @Override String toVerboseString(); @Override AbstractLocation configure(Map<?,?> properties); @SuppressWarnings("unchecked") FixedListMachineProvisioningLocation<T> newSubLocation(Map<?,?> newFlags); @Override void close(); void addMachine(T machine); void removeMachine(T machine); Set<T> getAvailable(); Set<T> getInUse(); Set<T> getAllMachines(); @Override void addChild(Location child); @Override boolean removeChild(Location child); T obtain(); @Override T obtain(Map<?,?> flags); @Override void release(T machine); @Override Map<String,Object> getProvisioningFlags(Collection<String> tags); static final ConfigKey<Function<Iterable<? extends MachineLocation>, MachineLocation>> MACHINE_CHOOSER; static final ConfigKey<Collection<MachineLocationCustomizer>> MACHINE_LOCATION_CUSTOMIZERS; }