Tabnine Logo
OSCategoryIn.apply
Code IndexAdd Tabnine to your IDE (free)

How to use
apply
method
in
org.jclouds.cloudstack.predicates.OSCategoryIn

Best Java code snippets using org.jclouds.cloudstack.predicates.OSCategoryIn.apply (Showing top 6 results out of 315)

origin: jclouds/legacy-jclouds

  @Test
  public void testTemplateNotInAcceptableCategory() {
   assertFalse(new OSCategoryIn(client).apply(acceptableCategories).apply(
     Template.builder().id("2").OSTypeId("30").build()
   ));
   verify(client, guestOSClient);
  }
}
origin: jclouds/legacy-jclouds

@Test
public void testTemplateInAcceptableCategory() {
 assertTrue(new OSCategoryIn(client).apply(acceptableCategories).apply(
   Template.builder().id("1").OSTypeId("10").build()
 ));
 verify(client, guestOSClient);
}
origin: apache/jclouds

@Test
public void testTemplateInAcceptableCategory() {
 assertTrue(new OSCategoryIn(client).apply(acceptableCategories).apply(
   Template.builder().id("1").OSTypeId("10").build()
 ));
 verify(client, guestOSClient);
}
origin: apache/jclouds

  @Test
  public void testTemplateNotInAcceptableCategory() {
   assertFalse(new OSCategoryIn(client).apply(acceptableCategories).apply(
     Template.builder().id("2").OSTypeId("30").build()
   ));
   verify(client, guestOSClient);
  }
}
origin: jclouds/legacy-jclouds

public static String getTemplateForZone(CloudStackClient client, String zoneId) {
 // TODO enum, as this is way too easy to mess up.
 Set<String> acceptableCategories = ImmutableSet.of("Ubuntu", "CentOS");
 final Predicate<Template> hypervisorPredicate = new CorrectHypervisorForZone(client).apply(zoneId);
 final Predicate<Template> osTypePredicate = new OSCategoryIn(client).apply(acceptableCategories);
 @SuppressWarnings("unchecked")
 Predicate<Template> templatePredicate = Predicates.<Template> and(TemplatePredicates.isReady(),
    hypervisorPredicate, osTypePredicate);
 Iterable<Template> templates = filter(
    client.getTemplateClient().listTemplates(ListTemplatesOptions.Builder.zoneId(zoneId)), templatePredicate);
 if (Iterables.any(templates, TemplatePredicates.isPasswordEnabled())) {
   templates = filter(templates, TemplatePredicates.isPasswordEnabled());
 }
 if (Iterables.size(templates) == 0) {
   throw new NoSuchElementException(templatePredicate.toString());
 }
 String templateId = get(templates, 0).getId();
 return templateId;
}
origin: apache/jclouds

public static String getTemplateForZone(CloudStackApi client, String zoneId) {
 // TODO enum, as this is way too easy to mess up.
 Set<String> acceptableCategories = ImmutableSet.of("Ubuntu", "CentOS");
 final Predicate<Template> hypervisorPredicate = new CorrectHypervisorForZone(client).apply(zoneId);
 final Predicate<Template> osTypePredicate = new OSCategoryIn(client).apply(acceptableCategories);
 @SuppressWarnings("unchecked")
 Predicate<Template> templatePredicate = Predicates.<Template> and(TemplatePredicates.isReady(),
    hypervisorPredicate, osTypePredicate);
 Iterable<Template> templates = filter(
    client.getTemplateApi().listTemplates(ListTemplatesOptions.Builder.zoneId(zoneId)), templatePredicate);
 if (Iterables.any(templates, TemplatePredicates.isPasswordEnabled())) {
   templates = filter(templates, TemplatePredicates.isPasswordEnabled());
 }
 if (Iterables.size(templates) == 0) {
   throw new NoSuchElementException(templatePredicate.toString());
 }
 String templateId = get(templates, 0).getId();
 return templateId;
}
org.jclouds.cloudstack.predicatesOSCategoryInapply

Popular methods of OSCategoryIn

  • <init>

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now