private boolean currentLocationWiderThan(Location location) { return this.location == null || (location != null && this.location.getScope().compareTo(location.getScope()) < 0); }
public boolean isNodeInsideZones(NodeMetadata metadata) { Location location = metadata.getLocation(); while (location != null) { String id = location.getId(); if (location.getScope().equals(LocationScope.ZONE)) { if (id != null && !zonesSet.isEmpty() && !zonesSet.contains(id)) { return false; } } location = location.getParent(); } return true; }
private Location copyLocation(Set<String> ids, org.jclouds.domain.Location l){ if(l==null) return null; if(ids.contains(l.getId())) return null; ids.add(l.getId()); LocationScope scope = l.getScope()==null?null:LocationScope.valueOf(l.getScope().name()); Location parent = copyLocation(ids, l.getParent()); return new LocationImpl(scope, l.getId(), l.getDescription(), parent, l.getIso3166Codes(), l.getMetadata()); } }
@Override public Location apply(@Nullable org.jclouds.domain.Location input) { if (input == null) { return null; } return Location.builder().id(input.getId()).scope(input.getScope().name()) .parentId(input.getParent() != null ? input.getParent().getId() : null) .description(input.getDescription()) .iso3166Codes(input.getIso3166Codes()).build(); } }
private boolean currentLocationWiderThan(Location location) { return this.location == null || (location != null && this.location.getScope().compareTo(location.getScope()) < 0); }
public boolean isNodeInsideRegions(NodeMetadata metadata) { Location location = metadata.getLocation(); while (location != null) { String id = location.getId(); if (location.getScope().equals(LocationScope.REGION)) { if (id != null && !regionsSet.isEmpty() && !regionsSet.contains(id)) { return false; } } location = location.getParent(); } return true; }
private boolean currentLocationWiderThan(Location location) { return this.location == null || (location != null && this.location.getScope().compareTo(location.getScope()) < 0); }
private void fetchMemberMetaData(NodeMetadata metadata) { Location location = metadata.getLocation(); while (location != null) { String id = location.getId(); if (location.getScope().equals(LocationScope.ZONE)) { if (id != null) { memberMetaData.put(PARTITION_GROUP_ZONE, id); } } location = location.getParent(); } memberMetaData.put(PARTITION_GROUP_HOST, metadata.getHostname()); }
private boolean currentLocationWiderThan(Location location) { return this.location == null || (location != null && this.location.getScope().compareTo(location.getScope()) < 0); }
static void assertEqualsTemplate(Template actual, Template expected){ assertEquals(actual.getImage(), expected.getImage()); assertEquals(actual.getHardware(), expected.getHardware()); assertEquals(actual.getOptions(), expected.getOptions()); assertTrue(actual.getLocation().getScope().compareTo(expected.getLocation().getScope()) <= 0); }