Methods Summary |
---|
protected void | addEntry(SnmpIndex index, java.lang.Object entry)Add an entry in this table.
This method registers an entry in the table and perform
synchronization with the associated table metadata object.
This method assumes that the given entry will not be registered,
or will be registered with its default ObjectName built from the
associated SnmpIndex.
If the entry is going to be registered, then
{@link com.sun.jmx.snmp.agent.SnmpTableSupport#addEntry(SnmpIndex, ObjectName, Object)} should be prefered.
This function is mainly provided for backward compatibility.
SnmpOid oid = buildOidFromIndex(index);
ObjectName name = null;
if (isRegistrationRequired()) {
name = buildNameFromIndex(index);
}
meta.addEntry(oid,name,entry);
|
protected void | addEntry(SnmpIndex index, javax.management.ObjectName name, java.lang.Object entry)Add an entry in this table.
This method registers an entry in the table and performs
synchronization with the associated table metadata object.
SnmpOid oid = buildOidFromIndex(index);
meta.addEntry(oid,name,entry);
|
public void | addEntryCb(int pos, com.sun.jmx.snmp.SnmpOid row, javax.management.ObjectName name, java.lang.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.
This method will update the entries list.
try {
if (entries != null) entries.add(pos,entry);
} catch (Exception e) {
throw new SnmpStatusException(SnmpStatusException.noSuchName);
}
|
public void | addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)Enables to add an SNMP entry listener to this
SnmpMibTable .
meta.addNotificationListener(listener,filter,handback);
|
protected java.util.List | allocateTable()Allocates an ArrayList for storing table entries.
This method is called within the constructor at object creation.
Any object implementing the {@link java.util.List} interface can
be used.
return new ArrayList();
|
protected void | bindWithTableMeta()Binds this table with its associated metadata, registering itself
as an SnmpTableEntryFactory.
if (meta == null) return;
registrationRequired = meta.isRegistrationRequired();
meta.registerEntryFactory(this);
|
public abstract javax.management.ObjectName | buildNameFromIndex(SnmpIndex index)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 meaningfull when entries
are registered MBeans.
|
public abstract com.sun.jmx.snmp.SnmpOid | buildOidFromIndex(SnmpIndex index)Builds an SnmpOid from an SnmpIndex object.
This method is generated by mibgen and used internally.
|
protected abstract SnmpIndex | buildSnmpIndex(long[] oid, int start)Builds an SnmpIndex object from the index part of an OID.
This method is generated by mibgen and used internally.
|
public SnmpIndex | buildSnmpIndex(com.sun.jmx.snmp.SnmpOid rowOid)Builds an entry SnmpIndex from its row OID.
This method is generated by mibgen and used internally.
return buildSnmpIndex(rowOid.longValue(false), 0);
|
public abstract void | createNewEntry(SnmpMibSubRequest request, com.sun.jmx.snmp.SnmpOid rowOid, int depth, SnmpMibTable meta)Creates a new entry in the table.
This factory method is generated by mibgen and used internally.
It is part of the
{@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface.
You may subclass this method to implement any specific behaviour
your application requires.
|
protected java.lang.Object[] | getBasicEntries()Returns the entries in the table.
if (entries == null) return null;
Object[] array= new Object[entries.size()];
entries.toArray(array);
return array;
|
public java.lang.Object | getEntry(int pos)Returns the entry located at the given position in the table.
if (entries == null) return null;
return entries.get(pos);
|
public javax.management.MBeanNotificationInfo[] | getNotificationInfo()Returns a NotificationInfo object containing the
notification class and the notification type sent by the
SnmpMibTable .
return meta.getNotificationInfo();
|
protected abstract SnmpMibTable | getRegisteredTableMeta(SnmpMib mib)Returns the metadata object associated with this table.
This method is generated by mibgen and used internally.
|
public int | getSize()Returns the number of entries registered in the table.
return meta.getSize();
|
public boolean | isCreationEnabled()Tells whether a new entry should be created when a SET operation
is received for an entry that does not exist yet.
This method calls isCreationEnabled() on the metadata
object associated with this table.
return meta.isCreationEnabled();
|
public boolean | isRegistrationRequired()Tells whether the metadata object to which this table is linked
requires entries to be registered. In this case passing an
ObjectName when registering entries will be mandatory.
return registrationRequired;
|
protected void | removeEntry(SnmpIndex index, java.lang.Object entry)Remove an entry from this table.
This method unregisters an entry from the table and performs
synchronization with the associated table metadata object.
SnmpOid oid = buildOidFromIndex(index);
meta.removeEntry(oid,entry);
|
public void | removeEntryCb(int pos, com.sun.jmx.snmp.SnmpOid row, javax.management.ObjectName name, java.lang.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.
This method will update the entries list.
try {
if (entries != null) entries.remove(pos);
} catch (Exception e) {
}
|
public synchronized void | removeNotificationListener(javax.management.NotificationListener listener)Enables to remove an SNMP entry listener from this
SnmpMibTable .
meta.removeNotificationListener(listener);
|
public void | setCreationEnabled(boolean remoteCreationFlag)This method lets you dynamically switch the creation policy.
setCreationEnabled() will switch the policy of
remote entry creation via SET operations, by calling
setCreationEnabled() on the metadata object
associated with this table.
By default remote entry creation via SET operation is disabled.
meta.setCreationEnabled(remoteCreationFlag);
|