// Home | Go Back //
package agent.ifmib;
import java.io.*;
import java.util.*;
import com.ireasoning.util.*;
import com.ireasoning.protocol.snmp.*;
import javax.management.*;
public class AgentMib
{
private static MBeanServer _server;
private static OIDTreeNode _root;
public static void registerMBeans(MBeanServer server, OIDTreeNode root)
{
_server = server;
_root = root;
try
{
registerInterfacesGroup();
registerIfTable();
registerIfXTable();
registerIfRcvAddressTable();
registerIfStackTable();
}
catch(Exception e)
{
Logger.error(e);
throw new SnmpException(e.toString());
}
}
public static void registerInterfacesGroup() throws Exception
{
if ( _interfacesGroup != null ) return;
_interfacesGroup = new InterfacesGroup(_root, ".1.3.6.1.2.1.2", null);
_server.registerMBean(_interfacesGroup, new ObjectName("iReasoning:name=InterfacesGroup"));
}
public static void registerIfXTable() throws Exception
{
if ( _ifXTable != null ) return;
_ifXTable = new IfXTable(_root, ".1.3.6.1.2.1.31.1.1", null);
_server.registerMBean(_ifXTable, new ObjectName("iReasoning:name=IfXTable"));
}
public static void registerIfStackTable() throws Exception
{
if ( _ifStackTable != null ) return;
_ifStackTable = new IfStackTable(_root, ".1.3.6.1.2.1.31.1.2", null);
_server.registerMBean(_ifStackTable, new ObjectName("iReasoning:name=IfStackTable"));
}
public static void registerIfRcvAddressTable() throws Exception
{
if ( _ifRcvAddressTable != null ) return;
_ifRcvAddressTable = new IfRcvAddressTable(_root, ".1.3.6.1.2.1.31.1.4", null);
_server.registerMBean(_ifRcvAddressTable, new ObjectName("iReasoning:name=IfRcvAddressTable"));
}
public static void registerIfTable() throws Exception
{
if ( _ifTable != null ) return;
_ifTable = new IfTable(_root, ".1.3.6.1.2.1.2.2", null);
_server.registerMBean(_ifTable, new ObjectName("iReasoning:name=IfTable"));
}
public static InterfacesGroup getInterfacesGroup( )
{
if( _interfacesGroup == null )
{
try
{
registerInterfacesGroup();
}
catch(Exception e)
{
Logger.error(e);
}
}
return _interfacesGroup;
}
public static IfXTable getIfXTable( )
{
if( _ifXTable == null )
{
try
{
registerIfXTable();
}
catch(Exception e)
{
Logger.error(e);
}
}
return _ifXTable;
}
public static IfStackTable getIfStackTable( )
{
if( _ifStackTable == null )
{
try
{
registerIfStackTable();
}
catch(Exception e)
{
Logger.error(e);
}
}
return _ifStackTable;
}
public static IfRcvAddressTable getIfRcvAddressTable( )
{
if( _ifRcvAddressTable == null )
{
try
{
registerIfRcvAddressTable();
}
catch(Exception e)
{
Logger.error(e);
}
}
return _ifRcvAddressTable;
}
public static IfTable getIfTable( )
{
if( _ifTable == null )
{
try
{
registerIfTable();
}
catch(Exception e)
{
Logger.error(e);
}
}
return _ifTable;
}
static InterfacesGroup _interfacesGroup;
static IfXTable _ifXTable;
static IfStackTable _ifStackTable;
static IfRcvAddressTable _ifRcvAddressTable;
static IfTable _ifTable;
}