FileDocCategorySizeDatePackage
SnmpMibTree.javaAPI DocJava SE 5 API6967Fri Aug 26 14:55:06 BST 2005com.sun.jmx.snmp.daemon

SnmpMibTree

public final class SnmpMibTree extends Object
The class is used for building a tree representation of the different root oids of the supported MIBs. Each node is associated to a specific MIB.

Fields Summary
private com.sun.jmx.snmp.agent.SnmpMibAgent
defaultAgent
private TreeNode
root
Constructors Summary
public SnmpMibTree()

      defaultAgent= null;
      root= new TreeNode(-1, null, null);
    
Methods Summary
public com.sun.jmx.snmp.agent.SnmpMibAgentgetAgentMib(com.sun.jmx.snmp.SnmpOid oid)

        TreeNode node= root.retrieveMatchingBranch(oid.longValue(), 0);
        if (node == null)
            return defaultAgent;
        else
	    if(node.getAgentMib() == null)
		return defaultAgent;
	    else
		return node.getAgentMib();
    
public com.sun.jmx.snmp.agent.SnmpMibAgentgetDefaultAgent()

        return defaultAgent;
    
public voidprintTree()

        root.printTree(">");
    
public voidregister(com.sun.jmx.snmp.agent.SnmpMibAgent agent)

        root.registerNode(agent);
    
public voidregister(com.sun.jmx.snmp.agent.SnmpMibAgent agent, long[] oid)

      root.registerNode(oid, 0, agent);
    
public voidsetDefaultAgent(com.sun.jmx.snmp.agent.SnmpMibAgent def)

        defaultAgent= def;
        root.agent= def;
    
public voidunregister(com.sun.jmx.snmp.agent.SnmpMibAgent agent, com.sun.jmx.snmp.SnmpOid[] oids)

	for(int i = 0; i < oids.length; i++) {
	    long[] oid = oids[i].longValue();
	    TreeNode node = root.retrieveMatchingBranch(oid, 0);
	    if (node == null)
		continue;
	    node.removeAgent(agent);
	}
    
public voidunregister(com.sun.jmx.snmp.agent.SnmpMibAgent agent)

	
	root.removeAgentFully(agent);