Package bcds.phison.io

Classes in this package deal with reading or writing files (topologies in different formats, demand type defintions, zone maps, etc.).

See:
          Description

Interface Summary
GraphFormatter<V,E> A GraphFormatter is an auxiliary object that assists when exporting a graph to another format.
GraphIONode Nodes that are read with GraphReader, or written through GraphWriter need to implement this interface.
 

Class Summary
DemandTypesReader Demand types file (.dtypes) reader.
DotExporter<V extends GraphIONode,E> Exports a SimGraph to a .dot file, either in clustered mode or in "plain" mode.
GraphFormatterBare<V,E> Implements a "bare" graph formatter, where the node description (and its id) is simply what toString() produces for it.
GraphMLReader<V extends GraphIONode,E> A basic GraphML file reader.
GraphMLWriter<V extends GraphIONode,E> Writes a SimGraph to a GraphML file.
GraphReader<V extends GraphIONode,E> Base class for all topology file readers; it defines both an interface and useful methods and data for derived classes.
GraphWriter<V,E> Base class for all topology file writers; it defines both an interface and useful methods and data for derived classes.
IEPReader<V> Ingress/Egress Pairs (IEP) Reader.
NetGraphReader<V extends GraphIONode,E> Reads a topology file in .net format.
NetGraphWriter<V extends GraphIONode,E> Writes a topology in .net format.
NullOutputStream An output stream that discards everything (as if operating on /dev/null).
PropertyBasedFormatter<V extends GraphIONode,E> Implements a simple "formatter" of node and link attributes.
SgfGraphReader<V extends GraphIONode,E> Reads a topology file in .sgf format.
SgfGraphWriter<V extends GraphIONode,E> Writes a topology in .sgf format.
TrafficReader Reads a "traffic" file (usually, .trf), that is, the file that lists the events (connection requests, connection release, time marks, and other failure events).
ZoneInfo<V,E> Holds data about one zone or "cluster".
ZoneMap<V,E> Reads and writes a zone map (.zmap) file.
 

Exception Summary
BadFormatException A generic exception used when an input does not adhere to the expected format or there is a semantic error (for example, an alphabetic value is found where a number is expected).
 

Package bcds.phison.io Description

Classes in this package deal with reading or writing files (topologies in different formats, demand type defintions, zone maps, etc.).

The reading of files is generally performed through an instance of DataFileReader. By virtue of this, GZIP-compressed files can be read transparently (decompression is performed on the fly). Also, a file named "-" is asssumed to mean stdin (System.in).

One aspect that must be remembered is that SimGraph operates on generics-based nodes and links. Therefore, serializing and deserializing these elements is not straightforward. Link attributes are generally stored as "maps", where the key-value pairs are grouped (for example under a "section" in the SGF format), and any number of such attributes may exist.

Reading and writing "nodes" is more complicated because it is usually simpler to have all node attributes together (in a single line in the file, for example), but such attributes are arbitrary (in number and in data type). Our approach in this package is to require that all nodes to be written or read implement the GraphIONode interface. Through this interface, attributes can be retrived by the writing classes (the same do the attribute formatters, see below).

Though hhis solution works, a simpler and more general approach is desireable. With regards to the formatting of attributes (node color, link thickness, labels, etc.), there is a general mechanism based on GraphFormatter). This is used in exporting to DOT format, for example. However, it might be desireable to have a unified mechanism for element serialization and formatting.