Codota Logo
OSCategoryIn.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.jclouds.cloudstack.predicates.OSCategoryIn
constructor

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
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.predicatesOSCategoryIn<init>

Popular methods of OSCategoryIn

  • apply

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • JCheckBox (javax.swing)
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now