org.snmp4j.agent.agentx.subagent
Class DefaultAgentXSharedMOTable<R extends org.snmp4j.agent.mo.MOTableRow,C extends org.snmp4j.agent.mo.MOColumn,M extends org.snmp4j.agent.mo.MOTableModel<R>>

java.lang.Object
  extended by org.snmp4j.agent.mo.DefaultMOTable<R,C,M>
      extended by org.snmp4j.agent.agentx.subagent.DefaultAgentXSharedMOTable<R,C,M>
All Implemented Interfaces:
AgentXSharedMOTable<R,C,M>, AgentXSharedMutableMOTable<R,C,M>, org.snmp4j.agent.ManagedObject, org.snmp4j.agent.ManagedObjectValueAccess, org.snmp4j.agent.mo.MOTable<R,C,M>, org.snmp4j.agent.MOScope, org.snmp4j.agent.RegisteredManagedObject, org.snmp4j.agent.SerializableManagedObject

public class DefaultAgentXSharedMOTable<R extends org.snmp4j.agent.mo.MOTableRow,C extends org.snmp4j.agent.mo.MOColumn,M extends org.snmp4j.agent.mo.MOTableModel<R>>
extends org.snmp4j.agent.mo.DefaultMOTable<R,C,M>
implements AgentXSharedMutableMOTable<R,C,M>

The DefaultAgentXSharedMOTable class is a default implementation for a shared table. It supports dynamic (while AgentX session is up) row creation and deletion.

Version:
1.0
Author:
Frank Fock

Nested Class Summary
 
Nested classes/interfaces inherited from class org.snmp4j.agent.mo.DefaultMOTable
org.snmp4j.agent.mo.DefaultMOTable.ChangeSet
 
Field Summary
 
Fields inherited from class org.snmp4j.agent.mo.DefaultMOTable
moChangeListeners, model, moTableRowListeners, newRows, pendingChanges
 
Constructor Summary
DefaultAgentXSharedMOTable(org.snmp4j.smi.OID oid, org.snmp4j.agent.mo.MOTableIndex indexDef, C[] columns)
           
DefaultAgentXSharedMOTable(org.snmp4j.smi.OID oid, org.snmp4j.agent.mo.MOTableIndex indexDef, C[] columns, M model)
           
 
Method Summary
 boolean changeRowIndex(org.snmp4j.smi.OID oldIndex, org.snmp4j.smi.OID newIndex)
          Changes the index of a row without firing a MOTableRowEvent about removing and adding of the row.
 AgentXSharedMOTableSupport getAgentXSharedMOTableSupport()
          Returns the shared table support object this shared table uses.
 byte getOverrideIndexAllocationMode()
           
 byte getOverridePriority()
           
 void setAgentXSharedMOTableSupport(AgentXSharedMOTableSupport sharedTableSupport)
          Sets the shared table support that this shared table should be use to (de)register rows and (de)allocate indexes while this shared table is part of an connected AgentX session.
 void setOverrideIndexAllocationMode(byte overrideIndexAllocationMode)
          Sets the index allocation mode that overrides the allocation mode inherited from the shared table support for index allocation operations for this shared table.
 void setOverridePriority(byte overridePriority)
          Sets the registration priority that overrides the priority inherited from the shared table support object (if not equal zero).
 
Methods inherited from class org.snmp4j.agent.mo.DefaultMOTable
addMOChangeListener, addMOTableRowListener, addPendingChanges, addRow, cleanup, commit, covers, createRow, createRow, find, findCell, fireAfterMOChange, fireAfterPrepareMOChange, fireBeforeMOChange, fireBeforePrepareMOChange, fireRowChanged, get, getCellInfo, getCellOID, getChangesFromRequest, getColumn, getColumnCount, getColumnIndex, getColumns, getDefaultValues, getID, getIndexDef, getIndexPart, getLowerBound, getModel, getNewRows, getOID, getPendingChangeSet, getPersistentValues, getScope, getUpperBound, getValue, getValue, getValue, hasNewRows, isChangeSetComplete, isCovered, isLowerIncluded, isOverlapping, isUpperIncluded, isVolatile, load, next, prepare, removeAll, removeMOChangeListener, removeMOTableRowListener, removeRow, save, setModel, setValue, setVolatile, toString, undo, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.snmp4j.agent.mo.MOTable
addMOChangeListener, addMOTableRowListener, addRow, createRow, createRow, find, getCellInfo, getColumn, getColumnCount, getColumnIndex, getColumns, getDefaultValues, getIndexDef, getIndexPart, getModel, getOID, getValue, getValue, removeMOChangeListener, removeMOTableRowListener, removeRow
 
Methods inherited from interface org.snmp4j.agent.ManagedObjectValueAccess
setValue
 
Methods inherited from interface org.snmp4j.agent.ManagedObject
cleanup, commit, get, getScope, next, prepare, undo
 

Constructor Detail

DefaultAgentXSharedMOTable

public DefaultAgentXSharedMOTable(org.snmp4j.smi.OID oid,
                                  org.snmp4j.agent.mo.MOTableIndex indexDef,
                                  C[] columns)

DefaultAgentXSharedMOTable

public DefaultAgentXSharedMOTable(org.snmp4j.smi.OID oid,
                                  org.snmp4j.agent.mo.MOTableIndex indexDef,
                                  C[] columns,
                                  M model)
Method Detail

getAgentXSharedMOTableSupport

public AgentXSharedMOTableSupport getAgentXSharedMOTableSupport()
Description copied from interface: AgentXSharedMutableMOTable
Returns the shared table support object this shared table uses.

Specified by:
getAgentXSharedMOTableSupport in interface AgentXSharedMutableMOTable<R extends org.snmp4j.agent.mo.MOTableRow,C extends org.snmp4j.agent.mo.MOColumn,M extends org.snmp4j.agent.mo.MOTableModel<R>>
Returns:
an AgentXSharedMOTableSupport instance or null if this table has not been initialized for AgentX yet.

setAgentXSharedMOTableSupport

public void setAgentXSharedMOTableSupport(AgentXSharedMOTableSupport sharedTableSupport)
Description copied from interface: AgentXSharedMutableMOTable
Sets the shared table support that this shared table should be use to (de)register rows and (de)allocate indexes while this shared table is part of an connected AgentX session. The shared table determines whether the AgentX session is established by inspecting the AgentXSession instance returned by this shared tabe support. If either the shared table support instance is null or AgentXSession.isClosed() returns true the AgentX session is considered to be disconnected (not established).

Specified by:
setAgentXSharedMOTableSupport in interface AgentXSharedMutableMOTable<R extends org.snmp4j.agent.mo.MOTableRow,C extends org.snmp4j.agent.mo.MOColumn,M extends org.snmp4j.agent.mo.MOTableModel<R>>
Parameters:
sharedTableSupport - an AgentXSharedMOTableSupport instance to be used to (de)allocate indexes and (de)register rows at the AgentX master agent.

getOverrideIndexAllocationMode

public byte getOverrideIndexAllocationMode()

getOverridePriority

public byte getOverridePriority()

setOverrideIndexAllocationMode

public void setOverrideIndexAllocationMode(byte overrideIndexAllocationMode)
Sets the index allocation mode that overrides the allocation mode inherited from the shared table support for index allocation operations for this shared table.

Parameters:
overrideIndexAllocationMode - an index allocation mode as defined by AgentXSharedMOTableSupport or zero to use the default priority.

setOverridePriority

public void setOverridePriority(byte overridePriority)
Sets the registration priority that overrides the priority inherited from the shared table support object (if not equal zero).

Parameters:
overridePriority - a value between 1 and 255 (-1 respectively - its a byte) or zero which indicates that the default priority should be used.

changeRowIndex

public boolean changeRowIndex(org.snmp4j.smi.OID oldIndex,
                              org.snmp4j.smi.OID newIndex)
Description copied from interface: AgentXSharedMutableMOTable
Changes the index of a row without firing a MOTableRowEvent about removing and adding of the row. Only a MOTableRowEvent.UPDATED event will be fired.

Specified by:
changeRowIndex in interface AgentXSharedMutableMOTable<R extends org.snmp4j.agent.mo.MOTableRow,C extends org.snmp4j.agent.mo.MOColumn,M extends org.snmp4j.agent.mo.MOTableModel<R>>
Parameters:
oldIndex - the old index of the row to change.
newIndex - the new index of the row.
Returns:
true if the row index could be changed and false if either the row does not exists or the table model does not allow to add/remove rows.

Copyright 2005-2011 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.