ist.palcom.localnetworkview
Class PalcomDeviceTree

java.lang.Object
  extended by ist.palcom.localnetworkview.PalcomDeviceTree

public class PalcomDeviceTree
extends java.lang.Object

PalcomDeviceTree describes a device's view of the world. It builds a tree rooted by the Universe node which has two children: - Net - the tree of devices and services known through discovery - ConnectionList - the list of known connections The class is responsible for keeping the tree consistent. E.g., if a device is removed from the tree, all connections having that device as provider or consumer are also removed. There are two ways of reacting to changes to the tree: - addNode() and removeNode() return true if the request led to an actual modification to the tree (duplicates and irrelevant messages are ignored) - objects implementing DeviceTreeChangeListener can register for notification when nodes are added, removed, or changed. As much as possible of the functionality (e.g., lookup, etc.) is delegated to the NetworkNode class hierarchy and implemented in the attribute grammar.


Constructor Summary
PalcomDeviceTree()
           
 
Method Summary
 void addChangeListener(DeviceTreeChangeListener l)
           
 boolean addNode(java.lang.Object i)
          addNode is inserts newly discovered services and connections into the tree.
 Universe getUniverse()
           
 void removeChangeListener(DeviceTreeChangeListener l)
           
 void removeConnections()
          A crude way of implementing refresh of the communications list
 boolean removeNode(java.lang.Object i)
          Remove the node(s) corresponding to an Info, including dependencies (e.g, if a device is removed, its connections are also removed) The public method delegates the actual work to private methods, one for each type of node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PalcomDeviceTree

public PalcomDeviceTree()
Method Detail

getUniverse

public Universe getUniverse()
Returns:
the root of this tree

addNode

public boolean addNode(java.lang.Object i)
addNode is inserts newly discovered services and connections into the tree. It is also responsible for linking new nodes to existing ones -- e.g., a connection node to its service nodes. The public method delegates the actual work to private methods, one for each type of node.

Returns:
true if the tree was actually modified

removeNode

public boolean removeNode(java.lang.Object i)
Remove the node(s) corresponding to an Info, including dependencies (e.g, if a device is removed, its connections are also removed) The public method delegates the actual work to private methods, one for each type of node.

Parameters:
i - - the Info
Returns:
true if the tree was actually modified

removeConnections

public void removeConnections()
A crude way of implementing refresh of the communications list


addChangeListener

public void addChangeListener(DeviceTreeChangeListener l)

removeChangeListener

public void removeChangeListener(DeviceTreeChangeListener l)