View Javadoc
1   /*
2    * This file is part of Waarp Project (named also Waarp or GG).
3    *
4    *  Copyright (c) 2019, Waarp SAS, 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 Waarp 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   * Waarp 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   * Waarp . If not, see <http://www.gnu.org/licenses/>.
19   */
20  package org.waarp.snmp.interf;
21  
22  import org.snmp4j.agent.MOGroup;
23  import org.snmp4j.agent.MOScope;
24  import org.snmp4j.agent.mo.snmp.SNMPv2MIB;
25  import org.snmp4j.smi.OID;
26  import org.waarp.snmp.WaarpSnmpAgent;
27  import org.waarp.snmp.utils.WaarpMOScalar;
28  
29  /**
30   * Interface for All MIBs in Waarp project
31   */
32  public interface WaarpInterfaceMib extends MOGroup {
33    OID rootEnterpriseMib = new OID(".1.3.6.1.4.1");
34  
35    enum TrapLevel {
36      /**
37       * No Trap/Notification at all
38       */
39      None,
40      /**
41       * Trap/Notification only for start and stop
42       */
43      StartStop,
44      /**
45       * Trap/Notification up to high alert
46       */
47      Alert,
48      /**
49       * Trap/Notification up to warning alert
50       */
51      Warning,
52      /**
53       * Trap/Notification for all important elements
54       */
55      All,
56      /**
57       * Trap/Notification for all, whatever level
58       */
59      AllEvents;
60  
61      public final boolean isLevelValid(final int level) {
62        return level >= ordinal();
63      }
64    }
65  
66    /**
67     * Set the agent
68     *
69     * @param agent
70     */
71    void setAgent(WaarpSnmpAgent agent);
72  
73    /**
74     * @return the base OID for trap or notification of Start or Shutdown
75     */
76    OID getBaseOidStartOrShutdown();
77  
78    /**
79     * @return the SNMPv2MIB associated with this MIB
80     */
81    SNMPv2MIB getSNMPv2MIB();
82  
83    /**
84     * Update the row for these services
85     *
86     * @param scalar
87     */
88    void updateServices(WaarpMOScalar scalar);
89  
90    /**
91     * Update the row for these services
92     *
93     * @param range
94     */
95    void updateServices(MOScope range);
96  }