verinec.importer.parser
Class ImporterEnvironment

java.lang.Object
  extended by verinec.importer.parser.ImporterEnvironment

public class ImporterEnvironment
extends Object

This class holds all the settings made by the user in the Editor. It also store the settings of the node to import. It has a method to save the settings to a XML-File todo: logging of user feedback should be done in the different import modules, not here. It is currently very badly implemented.

Author:
geraldine.antener at unifr.ch

Nested Class Summary
 class ImporterEnvironment.ImportLogRecord
          warning record Can be of different text types like INFO, WARNING, ... todo: full list?
 
Field Summary
private  ArrayList ethernetWarnings
          Warnings for ethernet import.
 Hashtable interfacesTable
          a table mapping interface names to the identifier used in ImportHardware table is filled in ImportHardware and used in Iptable keys: interface names values: id value of the interface
private  ArrayList iptablesWarnings
          Warnings for iptables import.
 PCNode node
          The node to attach the imported configuration to.
 Random rand
          Used to create unique id's.
 ImporterDialog.SettingsPanelBase settings
          The currently active panel.
 boolean windows
          Operating system. todo: make this more flexible
 
Constructor Summary
ImporterEnvironment()
          Create an environment without node.
ImporterEnvironment(PCNode node)
          Create an environment with node.
 
Method Summary
 void addInfo(String type, String name, String text)
          Methode to save infos
 void addWarning(String type, String name, String text)
          Methode to save warnings
 String getEthernetWarnings()
          Get the warnigs caused by the importation of ethernet config files.
 String getIptablesWarnings()
          Get the warnigs caused by the importation of iptables settings.
 void setNode(PCNode node)
          Set the node for this import.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

windows

public boolean windows
Operating system. todo: make this more flexible


interfacesTable

public Hashtable interfacesTable
a table mapping interface names to the identifier used in ImportHardware table is filled in ImportHardware and used in Iptable keys: interface names values: id value of the interface


node

public PCNode node
The node to attach the imported configuration to.


settings

public ImporterDialog.SettingsPanelBase settings
The currently active panel. This can be used to determine whether we do remote, local or test import and to retrieve the configuration the user has specified.


ethernetWarnings

private ArrayList ethernetWarnings
Warnings for ethernet import.


iptablesWarnings

private ArrayList iptablesWarnings
Warnings for iptables import.


rand

public Random rand
Used to create unique id's. There may be only one instance used for the whole import, to reduce the chances of hitting the same number twice.

Constructor Detail

ImporterEnvironment

public ImporterEnvironment(PCNode node)
Create an environment with node.

Parameters:
node - The node to attach the created configuration to.

ImporterEnvironment

public ImporterEnvironment()
Create an environment without node. The node must be added later with setNode(verinec.gui.core.PCNode).

Method Detail

setNode

public void setNode(PCNode node)
Set the node for this import.

Parameters:
node - The new node.

addWarning

public void addWarning(String type,
                       String name,
                       String text)
Methode to save warnings

Parameters:
type - The type of the warning "file" for ethernet, "table" for iptables and "parser" for the iptables parser.
name - The name for the warning.
text - The warning message.

addInfo

public void addInfo(String type,
                    String name,
                    String text)
Methode to save infos

Parameters:
type - The type of the information "file" or "table"
name - The name for the info.
text - The info message.

getEthernetWarnings

public String getEthernetWarnings()
Get the warnigs caused by the importation of ethernet config files.

Returns:
A list of newline separated warning messages.

getIptablesWarnings

public String getIptablesWarnings()
Get the warnigs caused by the importation of iptables settings.

Returns:
A list of newline separated warning messages.

Copyright © 2005 Verinec, DIUF