01: /*_############################################################################
02: _##
03: _## SNMP4J-Agent - MOMutableTableModel.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
06: _##
07: _## Licensed under the Apache License, Version 2.0 (the "License");
08: _## you may not use this file except in compliance with the License.
09: _## You may obtain a copy of the License at
10: _##
11: _## http://www.apache.org/licenses/LICENSE-2.0
12: _##
13: _## Unless required by applicable law or agreed to in writing, software
14: _## distributed under the License is distributed on an "AS IS" BASIS,
15: _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: _## See the License for the specific language governing permissions and
17: _## limitations under the License.
18: _##
19: _##########################################################################*/
20:
21: package org.snmp4j.agent.mo;
22:
23: import org.snmp4j.smi.OID;
24:
25: /**
26: * The <code>MOMutableTableModel</code> defines the interface for mutable
27: * table models. Mutable table models support row creation and deletion through
28: * SNMP SET operations.
29: *
30: * @author Frank Fock
31: * @version 1.0
32: */
33: public interface MOMutableTableModel extends MOTableModel,
34: MOTableRowFactory {
35:
36: /**
37: * Adds a row to the table. If a row with the same index already exists
38: * it will be replaced and returned.
39: *
40: * @param row
41: * the <code>MOTableRow</code> instance to add.
42: * @return
43: * the previous row with the specified index or <code>null</code> if it
44: * did not have one.
45: */
46: MOTableRow addRow(MOTableRow row);
47:
48: /**
49: * Removes the row with the specified index from the table and returns it.
50: * @param index
51: * the row index of the row to remove.
52: * @return
53: * the removed row or <code>null</code> if the table did not contain such
54: * a row.
55: */
56: MOTableRow removeRow(OID index);
57:
58: /**
59: * Removes all rows.
60: */
61: void clear();
62:
63: /**
64: * Remove all rows that do not match the given filter criteria
65: * from the model.
66: * @param filter
67: * the <code>MOTableRowFilter</code> that filters out the rows to
68: * delete.
69: */
70: void clear(MOTableRowFilter filter);
71:
72: /**
73: * Sets the factory instance to be used for creating rows for this model.
74: *
75: * @param rowFactory
76: * a <code>MOTableRowFactory</code> instance or <code>null</code> to
77: * disable row creation.
78: */
79: void setRowFactory(MOTableRowFactory rowFactory);
80: }
|