org.snmp4j.agent.mo.snmp
Class SNMPv2MIB

java.lang.Object
  extended by org.snmp4j.agent.mo.snmp.SNMPv2MIB
All Implemented Interfaces:
java.util.EventListener, AgentCapabilityList, MOGroup, org.snmp4j.event.CounterListener

public class SNMPv2MIB
extends java.lang.Object
implements MOGroup, org.snmp4j.event.CounterListener, AgentCapabilityList

The SystemGroup implements the objects in the SNMPv2-MIB specification. Since version 2.0, the SysUpTime class uses System.nanoTime() instead System.currentTimeMillis() for up-time computation which makes the implementation stable against system time changes.

Version:
2.0
Author:
Frank Fock

Nested Class Summary
static class SNMPv2MIB.SnmpEnableAuthenTrapsEnum
           
 class SNMPv2MIB.SysOREntry
           
static class SNMPv2MIB.SysUpTimeImpl
           
 
Constructor Summary
SNMPv2MIB(org.snmp4j.smi.OctetString sysDescr, org.snmp4j.smi.OID sysOID, org.snmp4j.smi.Integer32 sysServices)
           
 
Method Summary
 org.snmp4j.smi.OID addSysOREntry(org.snmp4j.smi.OID sysORID, org.snmp4j.smi.OctetString sysORDescr)
          Add a capabilities description to the exported list.
 org.snmp4j.smi.OctetString getContact()
           
 org.snmp4j.smi.OctetString getDescr()
           
 org.snmp4j.smi.OctetString getLocation()
           
 org.snmp4j.smi.OctetString getName()
           
 NotificationOriginator getNotificationOriginator()
          Gets the notification originator used for sending authenticationFailure traps.
 org.snmp4j.smi.OID getObjectID()
           
 org.snmp4j.smi.Integer32 getServices()
           
 SysUpTime getSysUpTime()
           
static SysUpTime getSysUpTime(org.snmp4j.smi.OctetString context)
          Returns the sysUpTime for the supplied context.
 org.snmp4j.smi.TimeTicks getUpTime()
           
 void incrementCounter(org.snmp4j.event.CounterEvent event)
           
 void registerMOs(MOServer server, org.snmp4j.smi.OctetString context)
          Registers the managed objects of this group with the server for the supplied context.
 MOTableRow removeSysOREntry(org.snmp4j.smi.OID index)
          Remove a capabilities description from the exported list.
 void setContact(org.snmp4j.smi.OctetString contact)
           
 void setLocation(org.snmp4j.smi.OctetString sysLocation)
           
 void setName(org.snmp4j.smi.OctetString sysName)
           
 void setNotificationOriginator(NotificationOriginator notificationOriginator)
          Sets the NotificationOriginator to be used for sending the authenticationFailure trap.
 void unregisterMOs(MOServer server, org.snmp4j.smi.OctetString context)
          Unregisters the managed objects of this group from the supplied server and from the supplied context.
protected  void updateSysORLastChange()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SNMPv2MIB

public SNMPv2MIB(org.snmp4j.smi.OctetString sysDescr,
                 org.snmp4j.smi.OID sysOID,
                 org.snmp4j.smi.Integer32 sysServices)
Method Detail

updateSysORLastChange

protected void updateSysORLastChange()

addSysOREntry

public org.snmp4j.smi.OID addSysOREntry(org.snmp4j.smi.OID sysORID,
                                        org.snmp4j.smi.OctetString sysORDescr)
Description copied from interface: AgentCapabilityList
Add a capabilities description to the exported list.

Specified by:
addSysOREntry in interface AgentCapabilityList
Parameters:
sysORID - the OID of an AGENT-CAPABILITIES statement.
sysORDescr - A textual description of the capabilities identified by the corresponding instance of sysORID.
Returns:
the index OID of the entry that uniquely identifies it.

removeSysOREntry

public MOTableRow removeSysOREntry(org.snmp4j.smi.OID index)
Description copied from interface: AgentCapabilityList
Remove a capabilities description from the exported list.

Specified by:
removeSysOREntry in interface AgentCapabilityList
Parameters:
index - the index OID previously returned by AgentCapabilityList.addSysOREntry(org.snmp4j.smi.OID, org.snmp4j.smi.OctetString).
Returns:
MOTableRow the removed sysOREntry row or null if such a row could not be found.

registerMOs

public void registerMOs(MOServer server,
                        org.snmp4j.smi.OctetString context)
                 throws DuplicateRegistrationException
Description copied from interface: MOGroup
Registers the managed objects of this group with the server for the supplied context.

Specified by:
registerMOs in interface MOGroup
Parameters:
server - the MOServer where to register the managed objects.
context - the context to use (may be null if no specific context is selected).
Throws:
DuplicateRegistrationException - if a managed object's scope (i.e. lower bound) is already registered at the server.

unregisterMOs

public void unregisterMOs(MOServer server,
                          org.snmp4j.smi.OctetString context)
Description copied from interface: MOGroup
Unregisters the managed objects of this group from the supplied server and from the supplied context.

Specified by:
unregisterMOs in interface MOGroup
Parameters:
server - the MOServer where to unregister the managed objects.
context - the context to use (may be null if no specific context is selected).

getContact

public org.snmp4j.smi.OctetString getContact()

setContact

public void setContact(org.snmp4j.smi.OctetString contact)

getDescr

public org.snmp4j.smi.OctetString getDescr()

getLocation

public org.snmp4j.smi.OctetString getLocation()

setLocation

public void setLocation(org.snmp4j.smi.OctetString sysLocation)

getName

public org.snmp4j.smi.OctetString getName()

setName

public void setName(org.snmp4j.smi.OctetString sysName)

getObjectID

public org.snmp4j.smi.OID getObjectID()

getServices

public org.snmp4j.smi.Integer32 getServices()

getUpTime

public org.snmp4j.smi.TimeTicks getUpTime()

getSysUpTime

public SysUpTime getSysUpTime()

incrementCounter

public void incrementCounter(org.snmp4j.event.CounterEvent event)
Specified by:
incrementCounter in interface org.snmp4j.event.CounterListener

getSysUpTime

public static SysUpTime getSysUpTime(org.snmp4j.smi.OctetString context)
Returns the sysUpTime for the supplied context.

Parameters:
context - a context or null for the default context.
Returns:
the SysUpTime instance associated with the given context or null if such a sysUpTime instance has not been registered yet.

setNotificationOriginator

public void setNotificationOriginator(NotificationOriginator notificationOriginator)
Sets the NotificationOriginator to be used for sending the authenticationFailure trap.

Parameters:
notificationOriginator - a NotificationOriginator instance or null to disable authenticationFailure traps (default).

getNotificationOriginator

public NotificationOriginator getNotificationOriginator()
Gets the notification originator used for sending authenticationFailure traps.

Returns:
a NotificationOriginator.
Since:
1.2

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.