alma::acs::gui::loglevel::tree::LogLvlTreeModel Class Reference

Inheritance diagram for alma::acs::gui::loglevel::tree::LogLvlTreeModel:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::gui::loglevel::tree::LogLvlTreeModel:
Collaboration graph
[legend]

List of all members.

Classes

class  NoLeafNode

Public Member Functions

 LogLvlTreeModel (ORB theOrb, Logger theLogger)
void start () throws Exception
void stop ()
void refreshTree ()
DefaultMutableTreeNode findNode (DefaultMutableTreeNode node, String name, int handle)
void clientLoggedIn (ClientInfo clientInfo)
void clientLoggedOut (int clientHandle)
void componentLoggedIn (ComponentInfo compInfo)
void componentReleased (ComponentInfo compInfo)
void componentLoggedOut (int compHandle)
void containerLoggedIn (ContainerInfo contInfo)
void containerLoggedOut (int conthandle)
void showComponents (boolean show)
void showClients (boolean show)
Manager getManagerRef ()

Protected Member Functions

boolean isManagerNode (DefaultMutableTreeNode selNode)

Private Member Functions

void buildManagersNode ()
void buildClientsNode ()
void buildContainersNode ()
void buildComponentsNode ()
String formatManagerLoc (String manLoc)
boolean checkNodeContent (DefaultMutableTreeNode node, String name, int handle)
void updateComponent (ComponentInfo info)
void removeComponent (int handle)
void removeFromComponentSubtree (int compHandle)
void addNode (TreeContentInfo newItem, DefaultMutableTreeNode node)

Private Attributes

AdministratorClient admin = null
ORB orb = null
Logger log = null
DefaultMutableTreeNode rootNode = null
DefaultMutableTreeNode managersNode = new NoLeafNode("Managers")
DefaultMutableTreeNode clientsNode = new NoLeafNode("Clients")
DefaultMutableTreeNode containersNode = new NoLeafNode("Containers")
DefaultMutableTreeNode componentsNode = new NoLeafNode("Components")

Detailed Description

The model for the tree of containers/components

Author:
acaproni

Constructor & Destructor Documentation

alma::acs::gui::loglevel::tree::LogLvlTreeModel::LogLvlTreeModel ( ORB  theOrb,
Logger  theLogger 
) [inline]

Constructor

References log, and orb.


Member Function Documentation

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::addNode ( TreeContentInfo  newItem,
DefaultMutableTreeNode  node 
) [inline, private]

Add an entry to a node. The new node is inserted ordered by its name.

Parameters:
newItem The new entry to add
node The node where the entry has to be addded

References alma::acs::gui::loglevel::tree::node::TreeContentInfo::getName().

Referenced by clientLoggedIn(), componentLoggedIn(), containerLoggedIn(), and updateComponent().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::buildClientsNode (  )  [inline, private]

Build the node of clients by reading the active clients

Parameters:
clients 

References admin, clientLoggedIn(), clientsNode, and alma::acs::gui::loglevel::tree::AdministratorClient::retrieveClientInfo().

Referenced by refreshTree().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::buildComponentsNode (  )  [inline, private]

Build the list of components by reading the running components

Parameters:
container 

References admin, componentLoggedIn(), and alma::acs::gui::loglevel::tree::AdministratorClient::retrieveComponentInfo().

Referenced by refreshTree().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::buildContainersNode (  )  [inline, private]

Build the node of containers by reading the active containers

References admin, containerLoggedIn(), containersNode, and alma::acs::gui::loglevel::tree::AdministratorClient::retrieveContainerInfo().

Referenced by refreshTree().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::buildManagersNode (  )  [inline, private]
boolean alma::acs::gui::loglevel::tree::LogLvlTreeModel::checkNodeContent ( DefaultMutableTreeNode  node,
String  name,
int  handle 
) [inline, private]

Check the content of the passed node. The check is done taking the content of the Node and checking if its name (or handle) is equal to the passed parameter. The comparison is done on the name if the name param is not null, otherwise on the handle.

If the node is the root, name is checked against the string or rootNode

Parameters:
node The node whose content has to be checked
name The name of the component/client/container If it is null, it is ignored
handle The handle (ignored if the name is not null)
Returns:
true if the name or the handle contained in the node are equal to the passed parameter false otherwise (even if the node is null)

References alma::acs::gui::loglevel::tree::node::TreeContentInfo::compareHandle(), and alma::acs::gui::loglevel::tree::node::TreeContentInfo::compareName().

Referenced by findNode().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::clientLoggedIn ( ClientInfo  clientInfo  )  [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::clientLoggedOut ( int  clientHandle  )  [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::componentLoggedIn ( ComponentInfo  compInfo  )  [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::componentLoggedOut ( int  compHandle  )  [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::componentReleased ( ComponentInfo  compInfo  )  [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::containerLoggedIn ( ContainerInfo  contInfo  )  [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::containerLoggedOut ( int  conthandle  )  [inline]
DefaultMutableTreeNode alma::acs::gui::loglevel::tree::LogLvlTreeModel::findNode ( DefaultMutableTreeNode  node,
String  name,
int  handle 
) [inline]

Navigate the tree to find a container with the given name or handle. The search begins from the passed node and scans all the childs until it finds the node. The search is done comparing the name with the name of the item hold by the tree node and its childreen. If the name param is null, the handle is used.

The method is recursive.

Parameters:
node The root of the subtree to look for the node. If it is null, the search starts from the root.
name The name of the node i.e. the name of the client/conatainer/component hold by the node If null, the handle is used during the search
handle The handle of the client/component/container to search This param is used only if name is null
Returns:
The first node in the tree with the given mane null If such a node does not exist

References checkNodeContent().

Referenced by clientLoggedOut(), containerLoggedIn(), containerLoggedOut(), removeComponent(), removeFromComponentSubtree(), showClients(), showComponents(), alma::acs::gui::loglevel::tree::TreeMouseListener::TreeMouseListener(), and updateComponent().

String alma::acs::gui::loglevel::tree::LogLvlTreeModel::formatManagerLoc ( String  manLoc  )  [inline, private]

Fromat the manager loc in a more readable string

Parameters:
manLoc The managerLoc (like corbaloc::....)
Returns:
A humager readable string

Referenced by buildManagersNode(), and isManagerNode().

Manager alma::acs::gui::loglevel::tree::LogLvlTreeModel::getManagerRef (  )  [inline]

Return the manager reference

Returns:
The manager reference or null if the reference is not available

References admin, and alma::acs::gui::loglevel::tree::AdministratorClient::getManagerRef().

Referenced by alma::acs::gui::loglevel::tree::TreeMouseListener::getLogConfFromManager().

boolean alma::acs::gui::loglevel::tree::LogLvlTreeModel::isManagerNode ( DefaultMutableTreeNode  selNode  )  [inline, protected]

Returns if the given node is the manager

Parameters:
selNode the node to test
Returns:
true if the node is the manager

References admin, formatManagerLoc(), and alma::acs::gui::loglevel::tree::AdministratorClient::getManagerLoc().

Referenced by alma::acs::gui::loglevel::tree::TreeMouseListener::showLoggingConfigTab().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::refreshTree (  )  [inline]

Build the tree. It read the clients, components and containers and add them to the tree.

References admin, buildClientsNode(), buildComponentsNode(), buildContainersNode(), buildManagersNode(), clientsNode, componentsNode, containersNode, managersNode, and rootNode.

Referenced by alma::acs::gui::loglevel::tree::TreePopupMenu::actionPerformed(), and start().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::removeComponent ( int  handle  )  [inline, private]

Remove all the occurrencies of the component with the given handle from the tree

Parameters:
handle The handle of the component to remove

References containersNode, and findNode().

Referenced by componentLoggedOut().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::removeFromComponentSubtree ( int  compHandle  )  [inline, private]

Remove a node from the subtree of components

Parameters:
compHandle The handle of the component to remove

References componentsNode, and findNode().

Referenced by componentLoggedOut().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::showClients ( boolean  show  )  [inline]

show/hide the clients subtree

Parameters:
show If true the clients node is set to visible

References clientsNode, findNode(), and rootNode.

Referenced by alma::acs::gui::loglevel::tree::TreePopupMenu::actionPerformed().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::showComponents ( boolean  show  )  [inline]

show/hide the components subtree

Parameters:
show If true the components node is set to visible

References componentsNode, findNode(), and rootNode.

Referenced by alma::acs::gui::loglevel::tree::TreePopupMenu::actionPerformed().

void alma::acs::gui::loglevel::tree::LogLvlTreeModel::start (  )  throws Exception [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::stop (  )  [inline]
void alma::acs::gui::loglevel::tree::LogLvlTreeModel::updateComponent ( ComponentInfo  info  )  [inline, private]

Add a component to its container if it is not already there

Parameters:
info The component to add to the container

References addNode(), si::ijs::maci::ComponentInfo::container_name, containersNode, findNode(), and si::ijs::maci::ComponentInfo::name.

Referenced by componentLoggedIn().


Member Data Documentation

DefaultMutableTreeNode alma::acs::gui::loglevel::tree::LogLvlTreeModel::clientsNode = new NoLeafNode("Clients") [private]
DefaultMutableTreeNode alma::acs::gui::loglevel::tree::LogLvlTreeModel::componentsNode = new NoLeafNode("Components") [private]
DefaultMutableTreeNode alma::acs::gui::loglevel::tree::LogLvlTreeModel::containersNode = new NoLeafNode("Containers") [private]

Referenced by LogLvlTreeModel(), and start().

DefaultMutableTreeNode alma::acs::gui::loglevel::tree::LogLvlTreeModel::managersNode = new NoLeafNode("Managers") [private]

Referenced by buildManagersNode(), and refreshTree().

Referenced by LogLvlTreeModel(), and start().

DefaultMutableTreeNode alma::acs::gui::loglevel::tree::LogLvlTreeModel::rootNode = null [private]

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2