org.snmp4j.agent.mo.util
Class MOTableSizeLimit

java.lang.Object
  extended by org.snmp4j.agent.mo.util.MOTableSizeLimit
All Implemented Interfaces:
java.util.EventListener, MOTableRowListener
Direct Known Subclasses:
LogMOTableSizeLimit

public class MOTableSizeLimit
extends java.lang.Object
implements MOTableRowListener

This class implements a size limit on the number of rows in a table. If the limit is reached or exceeded, no more additional rows can be added by SNMP means.

Since:
1.1.5
Version:
1.1.5
Author:
Frank Fock

Field Summary
static java.lang.String PROPERTY_PREFIX
          The property prefix each size limit definition has to start with.
 
Constructor Summary
MOTableSizeLimit(int maxNumRows)
           
MOTableSizeLimit(java.util.Properties limits)
           
 
Method Summary
 java.util.SortedMap getLimits()
           
 int getMaxNumRows()
           
protected  boolean removeEldest(MOTableRowEvent 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 event)
          A column or a complete row is changed/has been changed.
 void setLimits(java.util.Properties limits)
           
 void setMaxNumRows(int maxNumRows)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_PREFIX

public static final java.lang.String PROPERTY_PREFIX
The property prefix each size limit definition has to start with. The OID subtree for which the definition is effective is then appended as follows:
 snmp4j.MOTableSizeLimit.=
 
where limit is a positive number or zero.

See Also:
Constant Field Values
Constructor Detail

MOTableSizeLimit

public MOTableSizeLimit(int maxNumRows)

MOTableSizeLimit

public MOTableSizeLimit(java.util.Properties limits)
Method Detail

rowChanged

public void rowChanged(MOTableRowEvent event)
A column or a complete row is changed/has been changed.

Specified by:
rowChanged in interface MOTableRowListener
Parameters:
event - a MOTableRowEvent describing the event. To veto the event the MOTableRowEvent.setVetoStatus(int) and optionally also the MOTableRowEvent.setVetoColumn(int) can be called.

removeEldest

protected boolean removeEldest(MOTableRowEvent triggeringEvent,
                               int numRows)
Remove try to remove a given number of eldest rows of the table referred to in the triggering event object.

Parameters:
triggeringEvent - the MOTableRowEvent object that describes the table with exceeding row limit.
numRows - the number of rows to remove (if possible).
Returns:
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.

setMaxNumRows

public void setMaxNumRows(int maxNumRows)

getMaxNumRows

public int getMaxNumRows()

getLimits

public java.util.SortedMap getLimits()

setLimits

public void setLimits(java.util.Properties limits)

Copyright 2005-2008 Frank Fock (SNMP4J.org)