View Javadoc

1   /**
2    * This file is part of GoldenGate Project (named also GoldenGate or GG).
3    * 
4    * Copyright 2009, Frederic Bregier, and individual contributors by the @author
5    * tags. See the COPYRIGHT.txt in the distribution for a full listing of
6    * individual contributors.
7    * 
8    * All GoldenGate Project is free software: you can redistribute it and/or
9    * modify it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation, either version 3 of the License, or (at your
11   * option) any later version.
12   * 
13   * GoldenGate is distributed in the hope that it will be useful, but WITHOUT ANY
14   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15   * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16   * 
17   * You should have received a copy of the GNU General Public License along with
18   * GoldenGate . If not, see <http://www.gnu.org/licenses/>.
19   */
20  package goldengate.snmp.interf;
21  
22  import goldengate.snmp.GgSnmpAgent;
23  import goldengate.snmp.utils.GgMOScalar;
24  
25  import org.snmp4j.agent.MOGroup;
26  import org.snmp4j.agent.MOScope;
27  import org.snmp4j.agent.mo.snmp.SNMPv2MIB;
28  import org.snmp4j.smi.OID;
29  
30  /**
31   * Interface for All MIBs in GoldenGate project
32   * 
33   * @author Frederic Bregier
34   * 
35   */
36  public interface GgInterfaceMib extends MOGroup {
37      public static OID rootEnterpriseMib = new OID(".1.3.6.1.4.1");
38  
39      public static enum TrapLevel {
40          /**
41           * No Trap/Notification at all
42           */
43          None,
44          /**
45           * Trap/Notification only for start and stop
46           */
47          StartStop,
48          /**
49           * Trap/Notification up to high alert
50           */
51          Alert,
52          /**
53           * Trap/Notification up to warning alert
54           */
55          Warning,
56          /**
57           * Trap/Notification for all important elements
58           */
59          All;
60  
61          public boolean isLevelValid(int level) {
62              return (level >= this.ordinal());
63          }
64      }
65  
66      /**
67       * Set the agent
68       * 
69       * @param agent
70       */
71      public abstract void setAgent(GgSnmpAgent agent);
72  
73      /**
74       * 
75       * @return the base OID for trap or notification of Start or Shutdown
76       */
77      public abstract OID getBaseOidStartOrShutdown();
78  
79      /**
80       * 
81       * @return the SNMPv2MIB associated with this MIB
82       */
83      public abstract SNMPv2MIB getSNMPv2MIB();
84  
85      /**
86       * Update the row for these services
87       * 
88       * @param scalar
89       */
90      public abstract void updateServices(GgMOScalar scalar);
91  
92      /**
93       * Update the row for these services
94       * 
95       * @param range
96       */
97      public abstract void updateServices(MOScope range);
98  }