KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > agentx > subagent > AgentXSharedMutableMOTable


1 /*_############################################################################
2   _##
3   _## SNMP4J-AgentX - AgentXSharedMutableMOTable.java
4   _##
5   _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
6   _##
7   _## This program is free software; you can redistribute it and/or modify
8   _## it under the terms of the GNU General Public License version 2 as
9   _## 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;
26 // For JavaDoc:
27
import org.snmp4j.agent.agentx.AgentXSession;
28 import org.snmp4j.agent.mo.MOTableRowEvent;
29 import org.snmp4j.agent.mo.MOTableSubIndex;
30
31 /**
32  * The <code>AgentXSharedMutableMOTable</code> extends the
33  * <code>AgentXSharedMOTable</code> and <code>MutableMOTable</code> interface.
34  * It serves as a marker interface to be able to differentiate
35  * between regular tables, AgentX shared index tables, and AgentX shared index
36  * tables with varying number of rows (this kind). The latter two
37  * require an index definition where all sub-indexes have an OID specified
38  * ({@link MOTableSubIndex#getOid()}). AgentX shared index tables provide
39  * services needed for sharing rows of the same conceptual table
40  * across multiple AgentX sub-agents.
41  * <p>
42  * This mutable variant is able to add (allocate and register) and remove
43  * (deallocate and deregister) rows after initial registration of the subagent.
44  *
45  * @author Frank Fock
46  * @version 1.0
47  */

48 public interface AgentXSharedMutableMOTable extends AgentXSharedMOTable {
49
50   /**
51    * Returns the shared table support object this shared table uses.
52    * @return
53    * an <code>AgentXSharedMOTableSupport</code> instance or <code>null</code>
54    * if this table has not been initialized for AgentX yet.
55    */

56   AgentXSharedMOTableSupport getAgentXSharedMOTableSupport();
57
58   /**
59    * Sets the shared table support that this shared table should be use to
60    * (de)register rows and (de)allocate indexes while this shared table is
61    * part of an connected AgentX session. The shared table determines whether
62    * the AgentX session is established by inspecting the {@link AgentXSession}
63    * instance returned by this shared tabe support. If either the shared table
64    * support instance is <code>null</code> or {@link AgentXSession#isClosed()}
65    * returns <code>true</code> the AgentX session is considered to be
66    * disconnected (not established).
67    *
68    * @param sharedTableSupport
69    * an <code>AgentXSharedMOTableSupport</code> instance to be used to
70    * (de)allocate indexes and (de)register rows at the AgentX master agent.
71    */

72   void setAgentXSharedMOTableSupport(AgentXSharedMOTableSupport
73                                      sharedTableSupport);
74
75   /**
76    * Changes the index of a row without firing a {@link MOTableRowEvent}
77    * about removing and adding of the row. Only a
78    * {@link MOTableRowEvent#UPDATED} event will be fired.
79    *
80    * @param oldIndex
81    * the old index of the row to change.
82    * @param newIndex
83    * the new index of the row.
84    * @return
85    * <code>true</code> if the row index could be changed and
86    * <code>false</code> if either the row does not exists or the table model
87    * does not allow to add/remove rows.
88    */

89   boolean changeRowIndex(OID oldIndex, OID newIndex);
90 }
91
Popular Tags