Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.OsFamilyVersion64Bit


         } else {
            matcher = Pattern.compile(".*(20[01][0-9]).*").matcher(input);
            if (matcher.find())
               version = matcher.group(1);
         }
         return new OsFamilyVersion64Bit(OsFamily.WINDOWS, osVersionMap.get(OsFamily.WINDOWS).get(version), is64Bit);
      } else {
         Matcher matcher = PATTERN.matcher(input);
         if (matcher.find()) {
            OsFamily fam = OsFamily.fromValue(matcher.group(1).toLowerCase());
            if (fam == OsFamily.UNRECOGNIZED)
               return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, null, is64Bit);
            return new OsFamilyVersion64Bit(fam, ComputeServiceUtils.parseVersionOrReturnEmptyString(fam, matcher
                     .group(2), osVersionMap), is64Bit);
         } else {
            return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, null, is64Bit);
         }
      }
   }
View Full Code Here


   public Image apply(DriveInfo drive) {
      if (drive.getName() == null)
         return null;
      String description = drive.getDescription() != null ? drive.getDescription() : drive.getName();
      Builder builder = OperatingSystem.builder();
      OsFamilyVersion64Bit parsed = imageParser.apply(drive.getName());
      builder.name(drive.getName()).description(description)
            .is64Bit(drive.getBits() != null ? drive.getBits() == 64 : parsed.is64Bit).version(parsed.version)
            .family(parsed.family);
      return new ImageBuilder().ids(drive.getUuid())
            .userMetadata(ImmutableMap.<String, String> of("size", drive.getSize() / 1024 / 1024 / 1024 + ""))
View Full Code Here

   }

   @Override
   public Image apply(OSTemplate template) {
      checkNotNull(template, "template");
      OsFamilyVersion64Bit parsed = osParser.apply(template.getName());
      Builder builder = OperatingSystem.builder();
      builder.name(template.getName()).description(template.getName()).is64Bit(parsed.is64Bit).version(parsed.version)
               .family(parsed.family);
      return new ImageBuilder().ids(template.getName()).name(template.getName()).description(template.getName())
            .operatingSystem(builder.build()).status(Status.AVAILABLE).build();
View Full Code Here

         } else {
            matcher = Pattern.compile(".*(20[01][0-9]).*").matcher(input);
            if (matcher.find())
               version = matcher.group(1);
         }
         return new OsFamilyVersion64Bit(OsFamily.WINDOWS, osVersionMap.get(OsFamily.WINDOWS).get(version), is64Bit);
      }
      Matcher osFamilyVersionMatcher = OSFAMILY_VERSION.matcher(input);
      if (osFamilyVersionMatcher.find()) {
         OsFamily fam = OsFamily.fromValue(osFamilyVersionMatcher.group(1).toLowerCase());
         if (fam == OsFamily.UNRECOGNIZED ) {
            return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, version, is64Bit);
         }
         return new OsFamilyVersion64Bit(fam, ComputeServiceUtils.parseVersionOrReturnEmptyString(fam,
               osFamilyVersionMatcher.group(2), osVersionMap), is64Bit);
      } else {
         Matcher osFamilyMatcher = OSFAMILY.matcher(input);
         OsFamily fam = OsFamily.UNRECOGNIZED;
         if (osFamilyMatcher.find()) {
            fam = OsFamily.fromValue(osFamilyMatcher.group(1).toLowerCase());
         }
         return new OsFamilyVersion64Bit(fam, version, is64Bit);
      }

   }
View Full Code Here

            .getInstance(Json.class));

      Set<OsFamilyVersion64Bit> supportedOperatingSystems = Sets.newHashSet();
      for (Entry<OsFamily, Map<String, String>> osVersions : map.entrySet()) {
         for (String version : Sets.newHashSet(osVersions.getValue().values())) {
            supportedOperatingSystems.add(new OsFamilyVersion64Bit(osVersions.getKey(), version, false));
            supportedOperatingSystems.add(new OsFamilyVersion64Bit(osVersions.getKey(), version, true));
         }
      }
      return supportedOperatingSystems;
   }
View Full Code Here

            .getInstance(Json.class));

      Set<OsFamilyVersion64Bit> supportedOperatingSystems = Sets.newHashSet();
      for (Entry<OsFamily, Map<String, String>> osVersions : map.entrySet()) {
         for (String version : Sets.newHashSet(osVersions.getValue().values())) {
            supportedOperatingSystems.add(new OsFamilyVersion64Bit(osVersions.getKey(), version, false));
            supportedOperatingSystems.add(new OsFamilyVersion64Bit(osVersions.getKey(), version, true));
         }
      }
      return supportedOperatingSystems;
   }
View Full Code Here

         } else {
            matcher = Pattern.compile(".*(20[01][0-9]).*").matcher(input);
            if (matcher.find())
               version = matcher.group(1);
         }
         return new OsFamilyVersion64Bit(OsFamily.WINDOWS, osVersionMap.get(OsFamily.WINDOWS).get(version), is64Bit);
      }
      Matcher osFamilyVersionMatcher = OSFAMILY_VERSION.matcher(input);
      if (osFamilyVersionMatcher.find()) {
         OsFamily fam = OsFamily.fromValue(osFamilyVersionMatcher.group(1).toLowerCase());
         if (fam == OsFamily.UNRECOGNIZED ) {
            return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, version, is64Bit);
         }
         return new OsFamilyVersion64Bit(fam, ComputeServiceUtils.parseVersionOrReturnEmptyString(fam,
               osFamilyVersionMatcher.group(2), osVersionMap), is64Bit);
      } else {
         Matcher osFamilyMatcher = OSFAMILY.matcher(input);
         OsFamily fam = OsFamily.UNRECOGNIZED;
         if (osFamilyMatcher.find()) {
            fam = OsFamily.fromValue(osFamilyMatcher.group(1).toLowerCase());
         }
         return new OsFamilyVersion64Bit(fam, version, is64Bit);
      }

   }
View Full Code Here

   }

   @Override
   public Image apply(OSTemplate template) {
      checkNotNull(template, "template");
      OsFamilyVersion64Bit parsed = osParser.apply(template.getName());
      Builder builder = OperatingSystem.builder();
      builder.name(template.getName()).description(template.getName()).is64Bit(parsed.is64Bit).version(parsed.version)
               .family(parsed.family);
      return new ImageBuilder().ids(template.getName()).name(template.getName()).description(template.getName())
            .operatingSystem(builder.build()).status(Status.AVAILABLE).build();
View Full Code Here

         } else {
            matcher = Pattern.compile(".*(20[01][0-9]).*").matcher(input);
            if (matcher.find())
               version = matcher.group(1);
         }
         return new OsFamilyVersion64Bit(OsFamily.WINDOWS, osVersionMap.get(OsFamily.WINDOWS).get(version), is64Bit);
      } else {
         Matcher matcher = PATTERN.matcher(input);
         if (matcher.find()) {
            OsFamily fam = OsFamily.fromValue(matcher.group(1).toLowerCase());
            if (fam == OsFamily.UNRECOGNIZED)
               return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, null, is64Bit);
            return new OsFamilyVersion64Bit(fam, ComputeServiceUtils.parseVersionOrReturnEmptyString(fam, matcher
                     .group(2), osVersionMap), is64Bit);
         } else {
            return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, null, is64Bit);
         }
      }
   }
View Full Code Here

   public Image apply(DriveInfo drive) {
      if (drive.getName() == null)
         return null;
      String description = drive.getDescription() != null ? drive.getDescription() : drive.getName();
      Builder builder = OperatingSystem.builder();
      OsFamilyVersion64Bit parsed = imageParser.apply(drive.getName());
      builder.name(drive.getName()).description(description)
            .is64Bit(drive.getBits() != null ? drive.getBits() == 64 : parsed.is64Bit).version(parsed.version)
            .family(parsed.family);
      return new ImageBuilder().ids(drive.getUuid())
            .userMetadata(ImmutableMap.<String, String> of("size", drive.getSize() / 1024 / 1024 / 1024 + ""))
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.OsFamilyVersion64Bit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.