com.sun.management.snmp.usm.usmmib
Class TableUsmUserTableImpl

java.lang.Object
  extended by com.sun.management.snmp.agent.SnmpTableSupport
      extended by com.sun.management.snmp.usm.usmmib.TableUsmUserTable
          extended by com.sun.management.snmp.usm.usmmib.TableUsmUserTableImpl
All Implemented Interfaces:
SnmpTableCallbackHandler, SnmpTableEntryFactory, SnmpUsmMibTable, Serializable

public class TableUsmUserTableImpl
extends TableUsmUserTable
implements SnmpUsmMibTable

The table has been customized to instantiate UsmUserEntryImpl. You can overload createUsmUserEntry method in order to instantiate your own UsmUserEntry.

Since:
Java DMK 5.1
See Also:
Serialized Form

Field Summary
static int MAX_USM_USER_NAME_LENGTH
           
 
Fields inherited from class com.sun.management.snmp.usm.usmmib.TableUsmUserTable
server
 
Fields inherited from class com.sun.management.snmp.agent.SnmpTableSupport
entries, meta, theMib
 
Constructor Summary
TableUsmUserTableImpl(SnmpEngine engine, SnmpMib myMib, MBeanServer server, SnmpUsmLcd lcd)
          Constructor for the table.
TableUsmUserTableImpl(SnmpEngine engine, SnmpMib myMib, SnmpUsmLcd lcd)
          Constructor.
 
Method Summary
 void addEntryCb(int pos, SnmpOid row, ObjectName name, Object entry, SnmpMibTable meta)
          This callback is called by the associated metadata object when a new table entry has been registered in the table metadata.
protected  UsmUserEntryImpl createUsmUserEntry(SnmpEngine engine, SnmpMib mib, SnmpUsmLcd lcd, SnmpUsmSecureUser user, SnmpMibTable tableMeta)
          Overload this method in order to instantiate your own UsmUserEntry.
 Object createUsmUserEntryMBean(SnmpMibSubRequest req, SnmpOid rowOid, int depth, ObjectName entryObjName, SnmpMibTable meta, Byte[] aUsmUserEngineID, String aUsmUserName)
          Factory method for "UsmUserEntry" entry MBean class.
 void removeEntryCb(int pos, SnmpOid row, ObjectName name, Object entry, SnmpMibTable meta)
          A user has been removed from SNMP.
 void userAdded(SnmpUsmSecureUser user)
          See SnmpUsmMibTable interface for documentation.
 void userRemoved(SnmpUsmSecureUser user)
          See SnmpUsmMibTable interface for documentation.
 void userUpdated(SnmpUsmSecureUser user)
          See SnmpUsmMibTable interface for documentation.
 
Methods inherited from class com.sun.management.snmp.usm.usmmib.TableUsmUserTable
addEntry, addEntry, buildNameFromIndex, buildOidFromIndex, buildOidFromIndexVal, buildSnmpIndex, buildSnmpIndex, createNewEntry, getEntries, getRegisteredTableMeta, removeEntry
 
Methods inherited from class com.sun.management.snmp.agent.SnmpTableSupport
addEntry, addEntry, addNotificationListener, allocateTable, bindWithTableMeta, buildSnmpIndex, getBasicEntries, getEntry, getNotificationInfo, getSize, isCreationEnabled, isRegistrationRequired, removeEntry, removeNotificationListener, setCreationEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_USM_USER_NAME_LENGTH

public static final int MAX_USM_USER_NAME_LENGTH
See Also:
Constant Field Values
Constructor Detail

TableUsmUserTableImpl

public TableUsmUserTableImpl(SnmpEngine engine,
                             SnmpMib myMib,
                             SnmpUsmLcd lcd)
Constructor.


TableUsmUserTableImpl

public TableUsmUserTableImpl(SnmpEngine engine,
                             SnmpMib myMib,
                             MBeanServer server,
                             SnmpUsmLcd lcd)
Constructor for the table. Initialize metadata for "TableUsmUserTable". The reference on the MBean server is updated so the entries created through an SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.

Method Detail

createUsmUserEntryMBean

public Object createUsmUserEntryMBean(SnmpMibSubRequest req,
                                      SnmpOid rowOid,
                                      int depth,
                                      ObjectName entryObjName,
                                      SnmpMibTable meta,
                                      Byte[] aUsmUserEngineID,
                                      String aUsmUserName)
                               throws SnmpStatusException
Description copied from class: TableUsmUserTable
Factory method for "UsmUserEntry" entry MBean class. You can redefine this method if you need to replace the default generated MBean class with your own customized class.

Overrides:
createUsmUserEntryMBean in class TableUsmUserTable
Returns:
An instance of the MBean class generated for the "UsmUserEntry" conceptual row. Note that when using standard metadata, the returned object must implement the "UsmUserEntryMBean" interface.
Throws:
SnmpStatusException

createUsmUserEntry

protected UsmUserEntryImpl createUsmUserEntry(SnmpEngine engine,
                                              SnmpMib mib,
                                              SnmpUsmLcd lcd,
                                              SnmpUsmSecureUser user,
                                              SnmpMibTable tableMeta)
Overload this method in order to instantiate your own UsmUserEntry. This method returns a UsmUserEntryImpl .

Parameters:
engine - The local SNMP engine.
mib - The current mib.
lcd - The lcd the MIB is bound to.
user - The lcd user bound to the newly created entry.

userAdded

public void userAdded(SnmpUsmSecureUser user)
See SnmpUsmMibTable interface for documentation.

Specified by:
userAdded in interface SnmpUsmMibTable
Parameters:
user - The newly added user.

userUpdated

public void userUpdated(SnmpUsmSecureUser user)
See SnmpUsmMibTable interface for documentation.

Specified by:
userUpdated in interface SnmpUsmMibTable
Parameters:
user - The updated user.

userRemoved

public void userRemoved(SnmpUsmSecureUser user)
See SnmpUsmMibTable interface for documentation.

Specified by:
userRemoved in interface SnmpUsmMibTable
Parameters:
user - The removed user.

addEntryCb

public void addEntryCb(int pos,
                       SnmpOid row,
                       ObjectName name,
                       Object entry,
                       SnmpMibTable meta)
                throws SnmpStatusException
Description copied from class: SnmpTableSupport
This callback is called by the associated metadata object when a new table entry has been registered in the table metadata. This method will update the entries list.

Specified by:
addEntryCb in interface SnmpTableCallbackHandler
Overrides:
addEntryCb in class SnmpTableSupport
Parameters:
pos - The position at which the new entry was inserted in the table.
row - The row OID of the new entry
name - The ObjectName of the new entry (as specified by the factory)
entry - The new entry (as returned by the factory)
meta - The table metadata object.
Throws:
SnmpStatusException

removeEntryCb

public void removeEntryCb(int pos,
                          SnmpOid row,
                          ObjectName name,
                          Object entry,
                          SnmpMibTable meta)
                   throws SnmpStatusException
A user has been removed from SNMP.

Specified by:
removeEntryCb in interface SnmpTableCallbackHandler
Overrides:
removeEntryCb in class TableUsmUserTable
Parameters:
pos - The position from which the entry was deleted
row - The row OID of the deleted entry
name - The ObjectName of the deleted entry (may be null if ObjectName's were not required)
entry - The deleted entry (may be null if only ObjectName's were required)
meta - The table metadata object.
Throws:
SnmpStatusException

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.