|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IVerinecRepository
Interface for access to XML repository.
This abstraction allows to use any back end to store the XML data created and used in VeriNec (i.e. File System, CVS, XML-Database).
The repository must ensure that all xml saved or loaded is valid with the schemas. To allow validation checks, the nodes must be saved before the network is saved, because otherwise some of the interfaces referenced from networks might not be defined.
Implementations support more than one project, that is, completely
independent set of configuration files. The projects are distinguished by
project names.
The creation of repositories is not coverd by this interface.
Use the RepositoryFactory to instantiate repositories.
| Method Summary | |
|---|---|
void |
drop()
Drop this repository, that is remove all data associated with it. |
Element |
getGlobals()
Get the nodes tag with only the global variables and eventual metadata from other namespaces, but no <node> children. |
Element |
getNode(String name)
Get a network node of that project. |
String[] |
getNodeNames()
Get the names of all existing nodes in this project. |
Element |
getNodes()
Get the complete tree starting with the <nodes> element. |
List |
getNodesWithInterfaceIp(String ip)
A method to search for nodes having a certain interface. |
Element |
getPhysicalNetworks()
Get the networks data of this project. |
String |
getProjectName()
Query for the project name of the currently opened project. |
String[] |
getProjectNames()
Get the names of all existing projects that can be opened with openProject(). |
void |
removeNode(String name)
Remove an existing node from the configuration. |
void |
setGlobals(Element globals)
Set the global elements without touching the nodes. |
void |
setNode(Element node)
Set a network Node. |
void |
setNodes(Element nodes)
Replace node and global data by the ones under the <nodes> element. |
void |
setPhysicalNetworks(Element networks)
Set the networks of this project. |
| Method Detail |
|---|
String[] getProjectNames()
throws VerinecException
All implementations should also contain a similar method sgetProjectNames which is static, for use in the factory. (As Java does not allow static methods to be declared in an Interface, this feature can not be enforced.)
VerinecException - if some error occurs while trying to collect the project names.
String getProjectName()
throws VerinecException
VerinecException - if the project name is not valid.
void drop()
throws VerinecException
VerinecException - If the project could not be deleted.
String[] getNodeNames()
throws VerinecException
VerinecException - if an error occurs during retreiving the node names.
Element getNode(String name)
throws VerinecException
name - Name of network node to retreived.
VerinecException - If no node with that name exists in this project.
List getNodesWithInterfaceIp(String ip)
throws VerinecException
ip - The IP the interface of the nodes must have.
VerinecException - If anything goes wrong.
void setNode(Element node)
throws VerinecException
Be aware that this limits us to not allowing two nodes with the same name within one project - a situation that could occur as soon as you design two subnets.
node - The Jdom Element of the node, which must not have a parent.
VerinecException - if the node is not valid or can not be stored.
void removeNode(String name)
throws VerinecException
name - The name of the node.
VerinecException - if the node is not existing.
Element getNodes()
throws VerinecException
VerinecException - if retreiving the nodes fails.
void setNodes(Element nodes)
throws VerinecException
Note that this overrides all existing nodes in the project, you have to pass a nodes element containing the complete node collection and all global data.
The individual nodes will be cloned before attaching to the JDOM tree, the parameter remains unchanged.Note that you can alter individual nodes using setNode(Element) and
removeNode(String), the globals using setGlobals(Element).
nodes - The element containing the new node and global data.
VerinecException - if the nodes can not be saved.
void setGlobals(Element globals)
throws VerinecException
globals - A nodes tag with all global elements as children.
VerinecException - if globals is not a valid nodes element or the data can not be stored.
Element getGlobals()
throws VerinecException
VerinecException - if invalid database prevents returning the globals of project this repository is set to.
Element getPhysicalNetworks()
throws VerinecException
VerinecException - if the networks can not be retreived.
void setPhysicalNetworks(Element networks)
throws VerinecException
networks - The network definition for this project.
VerinecException - if the networks can not be stored.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||