01: /*_############################################################################
02: _##
03: _## SNMP4J-AgentX - AgentXSharedMutableMOTable.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
06: _##
07: _## This program is free software; you can redistribute it and/or modify
08: _## it under the terms of the GNU General Public License version 2 as
09: _## published by the Free Software Foundation.
10: _##
11: _## This program is distributed in the hope that it will be useful,
12: _## but WITHOUT ANY WARRANTY; without even the implied warranty of
13: _## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: _## GNU General Public License for more details.
15: _##
16: _## You should have received a copy of the GNU General Public License
17: _## along with this program; if not, write to the Free Software
18: _## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19: _## MA 02110-1301 USA
20: _##
21: _##########################################################################*/
22:
23: package org.snmp4j.agent.agentx.subagent;
24:
25: import org.snmp4j.smi.OID; // For JavaDoc:
26: import org.snmp4j.agent.agentx.AgentXSession;
27: import org.snmp4j.agent.mo.MOTableRowEvent;
28: import org.snmp4j.agent.mo.MOTableSubIndex;
29:
30: /**
31: * The <code>AgentXSharedMutableMOTable</code> extends the
32: * <code>AgentXSharedMOTable</code> and <code>MutableMOTable</code> interface.
33: * It serves as a marker interface to be able to differentiate
34: * between regular tables, AgentX shared index tables, and AgentX shared index
35: * tables with varying number of rows (this kind). The latter two
36: * require an index definition where all sub-indexes have an OID specified
37: * ({@link MOTableSubIndex#getOid()}). AgentX shared index tables provide
38: * services needed for sharing rows of the same conceptual table
39: * across multiple AgentX sub-agents.
40: * <p>
41: * This mutable variant is able to add (allocate and register) and remove
42: * (deallocate and deregister) rows after initial registration of the subagent.
43: *
44: * @author Frank Fock
45: * @version 1.0
46: */
47: public interface AgentXSharedMutableMOTable extends AgentXSharedMOTable {
48:
49: /**
50: * Returns the shared table support object this shared table uses.
51: * @return
52: * an <code>AgentXSharedMOTableSupport</code> instance or <code>null</code>
53: * if this table has not been initialized for AgentX yet.
54: */
55: AgentXSharedMOTableSupport getAgentXSharedMOTableSupport();
56:
57: /**
58: * Sets the shared table support that this shared table should be use to
59: * (de)register rows and (de)allocate indexes while this shared table is
60: * part of an connected AgentX session. The shared table determines whether
61: * the AgentX session is established by inspecting the {@link AgentXSession}
62: * instance returned by this shared tabe support. If either the shared table
63: * support instance is <code>null</code> or {@link AgentXSession#isClosed()}
64: * returns <code>true</code> the AgentX session is considered to be
65: * disconnected (not established).
66: *
67: * @param sharedTableSupport
68: * an <code>AgentXSharedMOTableSupport</code> instance to be used to
69: * (de)allocate indexes and (de)register rows at the AgentX master agent.
70: */
71: void setAgentXSharedMOTableSupport(
72: AgentXSharedMOTableSupport sharedTableSupport);
73:
74: /**
75: * Changes the index of a row without firing a {@link MOTableRowEvent}
76: * about removing and adding of the row. Only a
77: * {@link MOTableRowEvent#UPDATED} event will be fired.
78: *
79: * @param oldIndex
80: * the old index of the row to change.
81: * @param newIndex
82: * the new index of the row.
83: * @return
84: * <code>true</code> if the row index could be changed and
85: * <code>false</code> if either the row does not exists or the table model
86: * does not allow to add/remove rows.
87: */
88: boolean changeRowIndex(OID oldIndex, OID newIndex);
89: }
|