public class MOTableSizeLimit<R extends MOTableRow> extends Object implements MOTableRowListener<R>
Use the DefaultMOServer.registerTableRowListener(org.snmp4j.agent.MOServer, org.snmp4j.agent.mo.MOTableRowListener<R>)
method to
register this table row listener for all tables in your agent, in order
to be able to control the table sizes of all the tables in a server.
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_PREFIX
The property prefix each size limit definition has to start with.
|
Constructor and Description |
---|
MOTableSizeLimit(int maxNumRows) |
MOTableSizeLimit(Properties limits) |
Modifier and Type | Method and Description |
---|---|
SortedMap<org.snmp4j.smi.OID,Integer> |
getLimits() |
int |
getMaxNumRows() |
protected boolean |
removeEldest(MOTableRowEvent<R> triggeringEvent,
int numRows)
Remove try to remove a given number of eldest rows of the table referred
to in the triggering event object.
|
void |
rowChanged(MOTableRowEvent<R> event)
A column or a complete row is changed/has been changed.
|
void |
setLimits(Properties limits) |
void |
setMaxNumRows(int maxNumRows) |
public static final String PROPERTY_PREFIX
snmp4j.MOTableSizeLimit.<OID>=<limit>
where limit
is a positive number or zero.public MOTableSizeLimit(int maxNumRows)
public MOTableSizeLimit(Properties limits)
public void rowChanged(MOTableRowEvent<R> event)
rowChanged
in interface MOTableRowListener<R extends MOTableRow>
event
- a MOTableRowEvent
describing the event. To veto
the event the MOTableRowEvent.setVetoStatus(int)
and optionally also
the MOTableRowEvent.setVetoColumn(int)
can be called.protected boolean removeEldest(MOTableRowEvent<R> triggeringEvent, int numRows)
triggeringEvent
- the MOTableRowEvent object that describes the table with exceeding
row limit.numRows
- the number of rows to remove (if possible).true
if one or more rows could be removed and
false
if the causing event should be denied/rejected.
The default implementation returns false
always.public void setMaxNumRows(int maxNumRows)
public int getMaxNumRows()
public void setLimits(Properties limits)
Copyright © 2018 SNMP4J.org. All rights reserved.