verinec.importer.parser.iptables
Class ImportIptables

java.lang.Object
  extended by verinec.importer.parser.iptables.ImportIptables
All Implemented Interfaces:
IServiceParser

public class ImportIptables
extends Object
implements IServiceParser

Imports the configuration data of iptables

Author:
geraldine.antener at unifr.ch

Nested Class Summary
 class ImportIptables.IptablesConfig
          Dialog to choose whether iptables import is on or not and how information is retreived.
 
Field Summary
private  ImportIptables.IptablesConfig configPanel
          Configuration for ethernet import.
private  String iptablesOutput
          The output of iptables, in case we need it later.
private  Logger log
          Debugging.
private  Element packet_filters
          The <packet-filters> element
 
Constructor Summary
ImportIptables()
           
 
Method Summary
 JPanel getConfigPanel()
          Get config panel
 String getRawConfiguration()
          Get the raw configuration, that is the configuratio ninformation of the implementation of service.
private  String localImport(ImporterEnvironment environment)
           
 void notifyMode(ImporterDialog.SettingsPanelBase mode)
          Change mode
private  void parseIptablesOutput(ImporterEnvironment config, String outputString)
          Create the packt-filters elements based on iptables output
private  String remoteImport(ImporterEnvironment environment)
           
 void runImport(ImporterEnvironment environment)
          Perform import if activated.
 void updateNode(PCNode node)
          Update the PCNode with new information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private Logger log
Debugging.


packet_filters

private Element packet_filters
The <packet-filters> element


iptablesOutput

private String iptablesOutput
The output of iptables, in case we need it later.


configPanel

private ImportIptables.IptablesConfig configPanel
Configuration for ethernet import.

Constructor Detail

ImportIptables

public ImportIptables()
Method Detail

runImport

public void runImport(ImporterEnvironment environment)
               throws VerinecImporterException
Perform import if activated. Analyse the ethernet configuration settings and depending on the settings: The Ethernet specific import configuration is found in the dialog returned by getConfigPanel.

Specified by:
runImport in interface IServiceParser
Parameters:
environment - The env for logging
Throws:
VerinecImporterException

getRawConfiguration

public String getRawConfiguration()
Description copied from interface: IServiceParser
Get the raw configuration, that is the configuratio ninformation of the implementation of service.

Specified by:
getRawConfiguration in interface IServiceParser
Returns:
The iptables output

remoteImport

private String remoteImport(ImporterEnvironment environment)
                     throws VerinecImporterException
Throws:
VerinecImporterException

localImport

private String localImport(ImporterEnvironment environment)
                    throws VerinecImporterException
Parameters:
environment -
Returns:
Output of the iptables command
Throws:
VerinecImporterException

parseIptablesOutput

private void parseIptablesOutput(ImporterEnvironment config,
                                 String outputString)
                          throws VerinecImporterException
Create the packt-filters elements based on iptables output

Parameters:
config - The configuration to log to
outputString - Output of iptables command.
Throws:
VerinecImporterException

updateNode

public void updateNode(PCNode node)
Update the PCNode with new information.

Specified by:
updateNode in interface IServiceParser
Parameters:
node - The node object to update

notifyMode

public void notifyMode(ImporterDialog.SettingsPanelBase mode)
Change mode

Specified by:
notifyMode in interface IServiceParser
Parameters:
mode - One of remote, local or test

getConfigPanel

public JPanel getConfigPanel()
Get config panel

Specified by:
getConfigPanel in interface IServiceParser
Returns:
the config panel for iptables

Copyright © 2005 Verinec, DIUF