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

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

public class TableUsmUserTable
extends SnmpTableSupport
implements Serializable

The class is used for implementing the "UsmUserTable" group. The group is defined with the following oid: 1.3.6.1.6.3.15.1.2.2.

Since:
Java DMK 5.1
See Also:
Serialized Form

Field Summary
protected  MBeanServer server
          Reference to the MBean server.
 
Fields inherited from class com.sun.management.snmp.agent.SnmpTableSupport
entries, meta, theMib
 
Constructor Summary
TableUsmUserTable(SnmpMib myMib)
          Constructor for the table.
TableUsmUserTable(SnmpMib myMib, MBeanServer server)
          Constructor for the table.
 
Method Summary
 void addEntry(UsmUserEntryMBean entry)
          Add a new entry to the table.
 void addEntry(UsmUserEntryMBean entry, ObjectName name)
          Add a new entry to the table.
 ObjectName buildNameFromIndex(SnmpIndex index)
          Builds the default ObjectName of an entry from the SnmpIndex identifying this entry.
 SnmpOid buildOidFromIndex(SnmpIndex index)
          Build index for "UsmUserEntry".
 SnmpOid buildOidFromIndexVal(Byte[] aUsmUserEngineID, String aUsmUserName)
          Build index for "UsmUserEntry".
 SnmpIndex buildSnmpIndex(long[] index, int start)
          Build index for "UsmUserEntry".
 SnmpIndex buildSnmpIndex(UsmUserEntryMBean entry)
          Build index for "UsmUserEntry".
 void createNewEntry(SnmpMibSubRequest req, SnmpOid rowOid, int depth, SnmpMibTable meta)
          Creates a new entry in the table.
 Object createUsmUserEntryMBean(SnmpMibSubRequest req, SnmpOid rowOid, int depth, ObjectName entryObjName, SnmpMibTable meta, Byte[] aUsmUserEngineID, String aUsmUserName)
          Factory method for "UsmUserEntry" entry MBean class.
 UsmUserEntryMBean[] getEntries()
          Return the entries stored in the table.
protected  SnmpMibTable getRegisteredTableMeta(SnmpMib mib)
          Returns the metadata object associated with this table.
 void removeEntry(UsmUserEntryMBean entry)
          Remove the specified entry from the table.
 void removeEntryCb(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 removed from the table metadata.
 
Methods inherited from class com.sun.management.snmp.agent.SnmpTableSupport
addEntry, addEntry, addEntryCb, 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

server

protected MBeanServer server
Reference to the MBean server.

Constructor Detail

TableUsmUserTable

public TableUsmUserTable(SnmpMib myMib)
Constructor for the table. Initialize metadata for "TableUsmUserTable". The reference on the MBean server is not updated so the entries created through an SNMP SET will not be registered in Java DMK.


TableUsmUserTable

public TableUsmUserTable(SnmpMib myMib,
                         MBeanServer server)
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

createNewEntry

public void createNewEntry(SnmpMibSubRequest req,
                           SnmpOid rowOid,
                           int depth,
                           SnmpMibTable meta)
                    throws SnmpStatusException
Description copied from class: SnmpTableSupport
Creates a new entry in the table. This factory method is generated by mibgen and used internally. It is part of the SnmpTableEntryFactory interface. You may subclass this method to implement any specific behavior your application requires.

Specified by:
createNewEntry in interface SnmpTableEntryFactory
Specified by:
createNewEntry in class SnmpTableSupport
Parameters:
req - The SNMP subrequest containing the sublist of varbinds for the new entry.
rowOid - The OID indexing the conceptual row (entry) for which the creation was requested.
depth - The depth reached in the OID tree (the position at which the columnar object ids start in the OIDs included in the varbind).
meta - The metadata object impacted by the subrequest
Throws:
SnmpStatusException - if the entry cannot be created.

getRegisteredTableMeta

protected SnmpMibTable getRegisteredTableMeta(SnmpMib mib)
Description copied from class: SnmpTableSupport
Returns the metadata object associated with this table. This method is generated by mibgen and used internally.

Specified by:
getRegisteredTableMeta in class SnmpTableSupport
Parameters:
mib - The SnmpMib object holding the Metadata corresponding to this table.
Returns:
The metadata object associated with this table. Returns null if this implementation of the MIB doesn't support this table.

removeEntryCb

public void removeEntryCb(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 removed from the table metadata. This method will update the entries list.

Specified by:
removeEntryCb in interface SnmpTableCallbackHandler
Overrides:
removeEntryCb in class SnmpTableSupport
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

addEntry

public void addEntry(UsmUserEntryMBean entry)
              throws SnmpStatusException
Add a new entry to the table. If the associated metadata requires ObjectNames a new ObjectName will be generated using "buildNameFromIndex". This method calls "addEntry" from "SnmpTableSupport". See the "SnmpTableSupport" Javadoc API for more details.

Throws:
SnmpStatusException

addEntry

public void addEntry(UsmUserEntryMBean entry,
                     ObjectName name)
              throws SnmpStatusException
Add a new entry to the table. This method calls "addEntry" from "SnmpTableSupport". See the "SnmpTableSupport" Javadoc API for more details.

Throws:
SnmpStatusException

getEntries

public UsmUserEntryMBean[] getEntries()
Return the entries stored in the table. This method calls "getBasicEntries" from "SnmpTableSupport". See the "SnmpTableSupport" Javadoc API for more details.


removeEntry

public void removeEntry(UsmUserEntryMBean entry)
                 throws SnmpStatusException
Remove the specified entry from the table. This method calls "removeEntry" from "SnmpTableSupport". See the "SnmpTableSupport" Javadoc API for more details.

Throws:
SnmpStatusException

buildNameFromIndex

public ObjectName buildNameFromIndex(SnmpIndex index)
                              throws SnmpStatusException
Description copied from class: SnmpTableSupport
Builds the default ObjectName of an entry from the SnmpIndex identifying this entry. No access is made on the entry itself. This method is generated by mibgen and used internally. You can subclass this method if you want to change the default ObjectName policy. This is only meaningful when entries are registered MBeans.

Specified by:
buildNameFromIndex in class SnmpTableSupport
Parameters:
index - The SnmpIndex identifying the entry from which we want to build the default ObjectName.
Returns:
The default ObjectName for the entry identified by the given index.
Throws:
SnmpStatusException - if the given index is not valid.

buildSnmpIndex

public SnmpIndex buildSnmpIndex(UsmUserEntryMBean entry)
                         throws SnmpStatusException
Build index for "UsmUserEntry".

Throws:
SnmpStatusException

buildOidFromIndex

public SnmpOid buildOidFromIndex(SnmpIndex index)
                          throws SnmpStatusException
Build index for "UsmUserEntry".

Specified by:
buildOidFromIndex in class SnmpTableSupport
Parameters:
index - An SnmpIndex object identifying a table entry.
Returns:
The SnmpOid form of the given entry index.
Throws:
SnmpStatusException - if the given index is not valid.

buildOidFromIndexVal

public SnmpOid buildOidFromIndexVal(Byte[] aUsmUserEngineID,
                                    String aUsmUserName)
                             throws SnmpStatusException
Build index for "UsmUserEntry".

Throws:
SnmpStatusException

buildSnmpIndex

public SnmpIndex buildSnmpIndex(long[] index,
                                int start)
                         throws SnmpStatusException
Build index for "UsmUserEntry".

Specified by:
buildSnmpIndex in class SnmpTableSupport
Parameters:
index - The OID from which to build the index, represented as an array of long.
start - The position where to start from in the OID array.
Returns:
The SnmpOid form of the given entry index.
Throws:
SnmpStatusException - if the given index is not valid.

createUsmUserEntryMBean

public Object createUsmUserEntryMBean(SnmpMibSubRequest req,
                                      SnmpOid rowOid,
                                      int depth,
                                      ObjectName entryObjName,
                                      SnmpMibTable meta,
                                      Byte[] aUsmUserEngineID,
                                      String aUsmUserName)
                               throws SnmpStatusException
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.

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

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.