Tabnine Logo
IptablesCommands.addFirewalldRule
Code IndexAdd Tabnine to your IDE (free)

How to use
addFirewalldRule
method
in
org.apache.brooklyn.util.ssh.IptablesCommands

Best Java code snippets using org.apache.brooklyn.util.ssh.IptablesCommands.addFirewalldRule (Showing top 3 results out of 315)

origin: org.apache.brooklyn/brooklyn-utils-common

/**
 * Returns the command that adds firewalld direct rule.
 *
 * @return Returns the command that adds firewalld direct rule.
 */
public static String addFirewalldRule(Chain chain, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy) {
  return addFirewalldRule(chain, Optional.<String>absent(), protocol, port, policy);
}

origin: org.apache.brooklyn/brooklyn-utils-common

@Test
public void testAddFirewalldRule() {
  Assert.assertEquals(IptablesCommands.addFirewalldRule(Chain.INPUT,
      Protocol.TCP, 3306, Policy.ACCEPT), addFirewalldRule);
}
origin: org.apache.brooklyn/brooklyn-software-base

protected void openIptablesImpl(Iterable<Integer> inboundPorts, SshMachineLocation machine) {
  if (inboundPorts == null || Iterables.isEmpty(inboundPorts)) {
    log.info("No ports to open in iptables (no inbound ports) for {} at {}", machine, this);
  } else {
    log.info("Opening ports in iptables for {} at {}", entity(), machine);
    List<String> iptablesRules = Lists.newArrayList();
    String iptablesInstallCommands = null;
    Task<Integer> checkFirewall = checkLocationFirewall(machine);
    if (checkFirewall.getUnchecked() == 0) {
      for (Integer port : inboundPorts) {
        iptablesRules.add(IptablesCommands.addFirewalldRule(Chain.INPUT, Protocol.TCP, port, Policy.ACCEPT));
       }
    } else {
      iptablesRules = createIptablesRulesForNetworkInterface(inboundPorts);
      iptablesInstallCommands = IptablesCommands.saveIptablesRules();
    }
    insertIptablesRules(iptablesRules, iptablesInstallCommands, machine);
    listIptablesRules(machine);
  }
}
org.apache.brooklyn.util.sshIptablesCommandsaddFirewalldRule

Javadoc

Returns the command that adds firewalld direct rule.

Popular methods of IptablesCommands

  • insertIptablesRule
  • appendIptablesRule
  • firewalldService
  • firewalldServiceIsActive
  • firewalldServiceStatus
  • firewalldServiceStop
  • saveIptablesRules
    Returns the command that saves iptables rules on file.
  • addIptablesRule
  • cleanUpIptablesRules
    Returns the command that cleans up iptables rules.
  • firewalldServiceRestart
  • firewalldServiceStart
  • iptablesService
  • firewalldServiceStart,
  • iptablesService,
  • iptablesServiceStatus,
  • iptablesServiceStop,
  • listIptablesRule

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JButton (javax.swing)
  • JFrame (javax.swing)
  • Top 12 Jupyter Notebook extensions
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