java.util.EventListener
, MOTableRowListener<R>
LogMOTableSizeLimit
public class MOTableSizeLimit<R extends MOTableRow> extends java.lang.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 | Description |
---|---|---|
static java.lang.String |
PROPERTY_PREFIX |
The property prefix each size limit definition has to start with.
|
Constructor | Description |
---|---|
MOTableSizeLimit(int maxNumRows) |
|
MOTableSizeLimit(java.util.Properties limits) |
Modifier and Type | Method | Description |
---|---|---|
java.util.SortedMap<org.snmp4j.smi.OID,java.lang.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(java.util.Properties limits) |
|
void |
setMaxNumRows(int maxNumRows) |
public static final java.lang.String PROPERTY_PREFIX
snmp4j.MOTableSizeLimit.<OID>=<limit>
where limit
is a positive number or zero.public MOTableSizeLimit(int maxNumRows)
public MOTableSizeLimit(java.util.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 java.util.SortedMap<org.snmp4j.smi.OID,java.lang.Integer> getLimits()
public void setLimits(java.util.Properties limits)
Copyright © 2018 SNMP4J.org. All rights reserved.