@Override public String toString() { return value(); }
private OsFamily parseOsFamily(String text, OsType fallbackValue) { if (text != null) try { // Attempt parsing OsFamily by scanning name and description // @see ProfitBricksComputeServiceAdapter#L190 OsFamily[] families = OsFamily.values(); for (OsFamily family : families) if (text.contains(family.value())) return family; } catch (Exception ex) { // do nothing } return mapOsFamily(fallbackValue); }
private OsFamily parseOsFamily(String text, OsType fallbackValue) { if (text != null) try { // Attempt parsing OsFamily by scanning name and description // @see ProfitBricksComputeServiceAdapter#L190 OsFamily[] families = OsFamily.values(); for (OsFamily family : families) if (text.contains(family.value())) return family; } catch (Exception ex) { // do nothing } return mapOsFamily(fallbackValue); }
@Override public String toString() { return value(); }
@Override public String toString() { return value(); }
@Override public String toString() { return value(); }
@Override public boolean apply(OsFamily input) { return label.contains(input.value()); } });
@Override public boolean apply(OsFamily input) { return label.contains(input.value()); } });
@Override public boolean apply(OsFamily input) { return label.contains(input.value()); } });
static OperatingSystem mapOsType(OsType osType) { if (osType != null) switch (osType) { case WINDOWS: return OperatingSystem.builder() .description(OsFamily.WINDOWS.value()) .family(OsFamily.WINDOWS) .build(); case LINUX: return OperatingSystem.builder() .description(OsFamily.LINUX.value()) .family(OsFamily.LINUX) .build(); } return OperatingSystem.builder() .description(OsFamily.UNRECOGNIZED.value()) .family(OsFamily.UNRECOGNIZED) .build(); }
static OperatingSystem mapOsType(OsType osType) { if (osType != null) switch (osType) { case WINDOWS: return OperatingSystem.builder() .description(OsFamily.WINDOWS.value()) .family(OsFamily.WINDOWS) .build(); case LINUX: return OperatingSystem.builder() .description(OsFamily.LINUX.value()) .family(OsFamily.LINUX) .build(); } return OperatingSystem.builder() .description(OsFamily.UNRECOGNIZED.value()) .family(OsFamily.UNRECOGNIZED) .build(); }
/** * Returns a String that displays the {@link org.jclouds.compute.domain.OperatingSystem} details. * * @param node * @return */ protected String getOperatingSystemDetails(NodeMetadata node) { if (node != null) { OperatingSystem os = node.getOperatingSystem(); if (os != null) { return node.getOperatingSystem().getFamily().value() + " " + node.getOperatingSystem().getArch() + " " + node.getOperatingSystem().getVersion(); } } return ""; }
@Override public Image apply(org.jclouds.profitbricks.domain.Image from) { String desc = from.name(); OsFamily osFamily = parseOsFamily(desc, from.osType()); Location location = find(locations.get(), idEquals(from.location().getId())); OperatingSystem os = OperatingSystem.builder() .description(osFamily.value()) .family(osFamily) .version(parseVersion(desc)) .is64Bit(is64Bit(desc, from.type())) .build(); return addTypeMetadata(new ImageBuilder() .ids(from.id()) .name(desc) .location(location) .status(Image.Status.AVAILABLE) .operatingSystem(os)) .build(); }
@Override public Image apply(org.jclouds.profitbricks.domain.Image from) { String desc = from.name(); OsFamily osFamily = parseOsFamily(desc, from.osType()); Location location = find(locations.get(), idEquals(from.location().getId())); OperatingSystem os = OperatingSystem.builder() .description(osFamily.value()) .family(osFamily) .version(parseVersion(desc)) .is64Bit(is64Bit(desc, from.type())) .build(); return addTypeMetadata(new ImageBuilder() .ids(from.id()) .name(desc) .location(location) .status(Image.Status.AVAILABLE) .operatingSystem(os)) .build(); }
os = OsFamily.UBUNTU; imageName = Optional.of(Strings.toLowerCase(os.value())); builder.put("imageName", "clockercentral/" + imageName.get());
@Override public Image apply(Snapshot from) { String textToParse = from.name() + from.description(); OsFamily osFamily = parseOsFamily(textToParse, from.osType()); Location location = find(locations.get(), idEquals(from.location().getId())); OperatingSystem os = OperatingSystem.builder() .description(osFamily.value()) .family(osFamily) .is64Bit(true) .version("00.00") .build(); return addTypeMetadata(new ImageBuilder() .ids(from.id()) .name(from.name()) .description(from.description()) .location(location) .status(mapStatus(from.state())) .operatingSystem(os)) .build(); }
@Override public Image apply(Snapshot from) { String textToParse = from.name() + from.description(); OsFamily osFamily = parseOsFamily(textToParse, from.osType()); Location location = find(locations.get(), idEquals(from.location().getId())); OperatingSystem os = OperatingSystem.builder() .description(osFamily.value()) .family(osFamily) .is64Bit(true) .version("00.00") .build(); return addTypeMetadata(new ImageBuilder() .ids(from.id()) .name(from.name()) .description(from.description()) .location(location) .status(mapStatus(from.state())) .operatingSystem(os)) .build(); }
.build()) .operatingSystem(new OperatingSystem.Builder() .description(OsFamily.LINUX.value()) .family(OsFamily.LINUX) .build())