Tabnine Logo
SecurityGroupPredicates.portInRangeForCidr
Code IndexAdd Tabnine to your IDE (free)

How to use
portInRangeForCidr
method
in
org.jclouds.cloudstack.predicates.SecurityGroupPredicates

Best Java code snippets using org.jclouds.cloudstack.predicates.SecurityGroupPredicates.portInRangeForCidr (Showing top 2 results out of 315)

origin: apache/jclouds

@Test
public void testPortInRangeForCidr() {
 assertTrue(portInRangeForCidr(11, "1.1.1.1/24").apply(group()));
 assertTrue(portInRangeForCidr(45, "1.1.1.1/24").apply(group()));
 assertFalse(portInRangeForCidr(45, "2.2.2.2/16").apply(group()));
 assertFalse(portInRangeForCidr(11, "2.2.2.2/16").apply(group()));
 assertFalse(portInRangeForCidr(11, "3.3.3.3/25").apply(group()));
}
origin: apache/jclouds

  private void authorizeGroupToItselfAndToTCPPortAndCidr(CloudStackApi client,
                             SecurityGroup securityGroup,
                             int port,
                             Set<String> cidrs) {
   for (String cidr : cidrs) {
     logger.debug(">> authorizing securityGroup(%s) permission to %s on port %d", securityGroup, cidr, port);
     if (!portInRangeForCidr(port, cidr).apply(securityGroup)) {
      jobComplete.apply(client.getSecurityGroupApi().authorizeIngressPortsToCIDRs(securityGroup.getId(),
                                              "TCP",
                                              port,
                                              port,
                                              ImmutableSet.of(cidr)));
      logger.debug("<< authorized securityGroup(%s) permission to %s on port %d", securityGroup, cidr, port);
     }
   }
  }
}
org.jclouds.cloudstack.predicatesSecurityGroupPredicatesportInRangeForCidr

Popular methods of SecurityGroupPredicates

  • ruleCidrMatches
    matches IngressRules with the given protocol, start and end port, and any of the given CIDRs.
  • ruleGroupMatches
    matches IngressRules with the given protocol, start and end port, and any of the given account/secur
  • hasCidr
  • nameEquals
    matches name of the given security group
  • nameMatches
    matches name of the given security group
  • portInRange

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JFileChooser (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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