|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.importer.parser.ethernet.ImportEthernet
public class ImportEthernet
Import the interface configuration files of a RedHat system.
The class reads a local or remote /etc/sysconfig/network-scripts directory
containing the interface configuration files (ifcfg-ifname files).
Imports the configuration data of the network interface cards,
and creates a the VeriNeC <hardware> XML element.
This class can be the level to import the configurations of different interfaces,
e.g. Ethernet cards, serial bindings or wlan.
At the moment only the import of Ethernet cards is implemented.
(Optionally including the virtual loopback device.)
Other realisations could be connected with VeriNeC here.
The ethernet import is flawed:
It relies on the file names, only interfaces beginning with "eth" are imported.
But Redhat uses the nickname of an interface for the filename, which can be anything.
Additionally, the alias or virtual interfaces must be in the form eth0:0 to be
correctly treated.
| Nested Class Summary | |
|---|---|
class |
ImportEthernet.EthernetConfig
Configuration dialog and container for ethernet import. |
| Field Summary | |
|---|---|
(package private) String |
aliassep
Value of the separator in alias interface filenames. |
(package private) File |
configFilesDir
The directroy containing the ifcfg-ifname configuratin files. |
(package private) ImportEthernet.EthernetConfig |
configPanel
Configuration for ethernet import. |
Element |
hardware
The <hardware> element |
private Logger |
log
|
private String |
rawconfig
Store information from the file in case it is needed. |
| Constructor Summary | |
|---|---|
ImportEthernet()
|
|
| Method Summary | |
|---|---|
private String |
doImport(ImporterEnvironment environment)
Import configuration from a local directory. |
JPanel |
getConfigPanel()
Get the configuration panel to configure import of ethernet config. |
String |
getRawConfiguration()
Get the raw configuration, that is the configuratio ninformation of the implementation of service. |
(package private) String |
lastToken(String filename,
String divisor)
Devide the String filname in tokens seperated by the String divisor. |
void |
notifyMode(ImporterDialog.SettingsPanelBase mode)
Notify about mode change. |
private String |
remoteImport(ImporterEnvironment environment)
Make a local copy of the remote system's "/etc/sysconfig/network-scripts" directory. |
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 |
|---|
private Logger log
ImportEthernet.EthernetConfig configPanel
public Element hardware
File configFilesDir
private String rawconfig
String aliassep
| Constructor Detail |
|---|
public ImportEthernet()
| Method Detail |
|---|
public void notifyMode(ImporterDialog.SettingsPanelBase mode)
notifyMode in interface IServiceParsermode - configuration panel indicating remote, local or test.
public void runImport(ImporterEnvironment environment)
throws VerinecImporterException
runImport in interface IServiceParserenvironment - Object to store log messages and common information
VerinecImporterExceptionpublic String getRawConfiguration()
IServiceParser
getRawConfiguration in interface IServiceParser
private String remoteImport(ImporterEnvironment environment)
throws VerinecImporterException
environment - Object to store log messages and common information
VerinecImporterException - If import fails
private String doImport(ImporterEnvironment environment)
throws VerinecImporterException
environment - Object to store log messages and common information
VerinecImporterException
String lastToken(String filename,
String divisor)
filename - the String to tokenizedivisor - the signal to devide
public void updateNode(PCNode node)
updateNode in interface IServiceParsernode - The node object to updatepublic JPanel getConfigPanel()
getConfigPanel in interface IServiceParser
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||