bcds.phison.ra
Class ConnectionInfo<V,E>

java.lang.Object
  extended by bcds.phison.ra.ConnectionInfo<V,E>

public class ConnectionInfo<V,E>
extends java.lang.Object

Holds information about a connection, such as its working and backup path (if any), a reference to the routing algorithm used to allocate capacity, the source and destination, among others.

Typically, instances of this class are kept in the TED object.

This class should be viewed as a "struct" in the sense that its data members are all public and some of them can only be changed through direct access (no setter/getter is available).

Author:
Juan Segovia S.

Field Summary
 boolean bkp_in_use
          Set to true to indicate that this connection is using the backup path (for example, when the working path has failed).
 Path<V,E> bkp_path
          Backup path assigned to this connection (it can be null).
 int cap
          Capacity assigned to this connection (the unit is up to the user).
 int clock
          The connection creation time (in simulated time).
 V dest
          Destination node of the connection.
 int duration
          The connection duration, in units of simulated time.
 int failed_at
          Simulation time at which this connection has failed.
 int id
          The connection id: it can be any number (it is up to the user).
 RoutingAlg<V,E> ra
          A reference to the routing algorithm that was used to find the paths for this connection.
 V src
          Source node of the connection.
 java.lang.String traf_type
          The "traffic type"; the meaning assigned to this field is entirely up to the user.
 Path<V,E> wrk_path
          Working path assigned to this connection.
 
Constructor Summary
ConnectionInfo(ConnectionInfo<V,E> c)
          Copy constructor (Beware: shallow copy).
ConnectionInfo(int id, int cap, Path<V,E> wrk_path, Path<V,E> bkp_path)
          Instanciates a ConnectionInfo, with a given id, capacity and paths.
 
Method Summary
 boolean backupIsActive()
          Returns true when backup path is active.
 void setBackupStatus(boolean bkp_is_active)
          Sets the "backup path is in use" flag.
 java.lang.String toString()
          A partial (string) representation of a ConnectionInfo object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public int id
The connection id: it can be any number (it is up to the user).


traf_type

public java.lang.String traf_type
The "traffic type"; the meaning assigned to this field is entirely up to the user.


src

public V src
Source node of the connection.


dest

public V dest
Destination node of the connection.


cap

public int cap
Capacity assigned to this connection (the unit is up to the user).


wrk_path

public Path<V,E> wrk_path
Working path assigned to this connection. It should not be null, although no check is performed to enforce this. The first and last node should be equal to src and dest respectively, although this is not checked.


bkp_path

public Path<V,E> bkp_path
Backup path assigned to this connection (it can be null). See also comments on wrk_path.


bkp_in_use

public boolean bkp_in_use
Set to true to indicate that this connection is using the backup path (for example, when the working path has failed).


ra

public RoutingAlg<V,E> ra
A reference to the routing algorithm that was used to find the paths for this connection. This information is used by the TED object to orderly release a connection.


clock

public int clock
The connection creation time (in simulated time).


duration

public int duration
The connection duration, in units of simulated time.


failed_at

public int failed_at
Simulation time at which this connection has failed. Should contain zero if the connection has not failed. Note that a connection fails if both of its paths have failed (assuming that bkp_path is not null). It should be reset to zero as soon as the connection is restored.

Constructor Detail

ConnectionInfo

public ConnectionInfo(int id,
                      int cap,
                      Path<V,E> wrk_path,
                      Path<V,E> bkp_path)
Instanciates a ConnectionInfo, with a given id, capacity and paths. The reference to the routing algorithm is set to null and the indicator of "backup in use" (see bkp_in_use) is set to false. The parameter wrk_path must not be null, whereas bkp_path may be null.


ConnectionInfo

public ConnectionInfo(ConnectionInfo<V,E> c)
Copy constructor (Beware: shallow copy).

Method Detail

setBackupStatus

public void setBackupStatus(boolean bkp_is_active)
Sets the "backup path is in use" flag.


backupIsActive

public boolean backupIsActive()
Returns true when backup path is active.


toString

public java.lang.String toString()
A partial (string) representation of a ConnectionInfo object.

Overrides:
toString in class java.lang.Object