@Override public Set<OperatingSystem> listImages() { Set<OperatingSystem> result = Sets.newHashSet(); // add allObjects filtered by the available OS Set<SoftwareDescription> allObjects = api.getSoftwareDescriptionApi().getAllObjects(); for (OperatingSystem os : createObjectOptionsSupplier.get().getVirtualGuestOperatingSystems()) { result.addAll(FluentIterable.from(allObjects) .filter(new IsOperatingSystem()) .filter(new HasSameOsReferenceCode(os.getOperatingSystemReferenceCode())) .transform(new SoftwareDescriptionToOperatingSystem(os.getId())) .toSet()); } return result; }
@Override public Set<OperatingSystem> listImages() { Set<OperatingSystem> result = Sets.newHashSet(); // add allObjects filtered by the available OS Set<SoftwareDescription> allObjects = api.getSoftwareDescriptionApi().getAllObjects(); for (OperatingSystem os : createObjectOptionsSupplier.get().getVirtualGuestOperatingSystems()) { result.addAll(FluentIterable.from(allObjects) .filter(new IsOperatingSystem()) .filter(new HasSameOsReferenceCode(os.getOperatingSystemReferenceCode())) .transform(new SoftwareDescriptionToOperatingSystem(os.getId())) .toSet()); } return result; }
@Override public Set<OperatingSystem> listImages() { Set<OperatingSystem> result = Sets.newHashSet(); // add allObjects filtered by the available OS Set<SoftwareDescription> allObjects = api.getSoftwareDescriptionApi().getAllObjects(); for (OperatingSystem os : createObjectOptionsSupplier.get().getVirtualGuestOperatingSystems()) { result.addAll(FluentIterable.from(allObjects) .filter(new IsOperatingSystem()) .filter(new HasSameOsReferenceCode(os.getOperatingSystemReferenceCode())) .transform(new SoftwareDescriptionToOperatingSystem(os.getId())) .toSet()); } return result; }
private Optional<OperatingSystem> tryExtractOperatingSystemFrom(VirtualGuestBlockDeviceTemplateGroup image) { if (image.getGlobalIdentifier() == null) return Optional.absent(); return FluentIterable.from(image.getChildren()) .transformAndConcat(new BlockDeviceTemplateGroupToBlockDeviceTemplateIterable()) .filter(new IsBootableDevice()) .transformAndConcat(new BlockDeviceTemplateToDiskImageSoftware()) .transform(new DiskImageSoftwareToSoftwareDescription()) .filter(new IsOperatingSystem()) .transform(new SoftwareDescriptionToOperatingSystem(image.getGlobalIdentifier())) .first(); }
private Optional<OperatingSystem> tryExtractOperatingSystemFrom(VirtualGuestBlockDeviceTemplateGroup image) { if (image.getGlobalIdentifier() == null) return Optional.absent(); return FluentIterable.from(image.getChildren()) .transformAndConcat(new BlockDeviceTemplateGroupToBlockDeviceTemplateIterable()) .filter(new IsBootableDevice()) .transformAndConcat(new BlockDeviceTemplateToDiskImageSoftware()) .transform(new DiskImageSoftwareToSoftwareDescription()) .filter(new IsOperatingSystem()) .transform(new SoftwareDescriptionToOperatingSystem(image.getGlobalIdentifier())) .first(); }
private Optional<OperatingSystem> tryExtractOperatingSystemFrom(VirtualGuestBlockDeviceTemplateGroup image) { if (image.getGlobalIdentifier() == null) return Optional.absent(); return FluentIterable.from(image.getChildren()) .transformAndConcat(new BlockDeviceTemplateGroupToBlockDeviceTemplateIterable()) .filter(new IsBootableDevice()) .transformAndConcat(new BlockDeviceTemplateToDiskImageSoftware()) .transform(new DiskImageSoftwareToSoftwareDescription()) .filter(new IsOperatingSystem()) .transform(new SoftwareDescriptionToOperatingSystem(image.getGlobalIdentifier())) .first(); }