Codota Logo
OSCategoryIn
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using org.jclouds.cloudstack.predicates.OSCategoryIn (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

Most used methods

  • <init>
  • apply

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • runOnUiThread (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
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