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.r66;
21  
22  import goldengate.common.logging.GgInternalLogger;
23  import goldengate.common.logging.GgInternalLoggerFactory;
24  import goldengate.snmp.GgSnmpAgent;
25  import goldengate.snmp.interf.GgInterfaceMib;
26  import goldengate.snmp.utils.GgEntry;
27  import goldengate.snmp.utils.GgMORow;
28  import goldengate.snmp.utils.GgMOScalar;
29  import goldengate.snmp.utils.GgUptime;
30  import goldengate.snmp.utils.MemoryGauge32;
31  import goldengate.snmp.utils.MemoryGauge32.MemoryType;
32  
33  import org.snmp4j.agent.DuplicateRegistrationException;
34  import org.snmp4j.agent.MOServer;
35  import org.snmp4j.agent.mo.MOAccessImpl;
36  import org.snmp4j.agent.mo.snmp.SNMPv2MIB;
37  import org.snmp4j.agent.mo.snmp.SysUpTime;
38  import org.snmp4j.smi.Integer32;
39  import org.snmp4j.smi.OID;
40  import org.snmp4j.smi.OctetString;
41  import org.snmp4j.smi.SMIConstants;
42  import org.snmp4j.smi.TimeTicks;
43  
44  /**
45   * Private MIB for GoldenGate OpenR66
46   * 
47   * @author Frederic Bregier
48   * 
49   */
50  public abstract class GgPrivateMib implements GgInterfaceMib {
51      /**
52       * Internal Logger
53       */
54      private static GgInternalLogger logger = GgInternalLoggerFactory
55              .getLogger(GgPrivateMib.class);
56  
57      // These are both standard in RFC-1213
58      /** 
59       * SnmpConstants.sysDescr
60       */
61      public String textualSysDecr = null;
62  
63      /**
64       *  SnmpConstants.sysObjectID
65       */
66      public OID ggObjectId = null; // will be smiPrivateCode.typeGoldenGate
67  
68      /** 
69       * SnmpConstants.sysContact
70       */
71      public String contactName = "Nobody";
72  
73      /**
74       *  SnmpConstants.sysName
75       */
76      public String textualName = "OpenR66";
77  
78      /**
79       *  SnmpConstants.sysLocation
80       */
81      public String address = "somewhere";
82  
83      /**
84       *  SnmpConstants.sysServices
85       *  
86       *  transport + application
87       */
88      public int service = 72; 
89  
90      /**
91       *  SnmpConstants.sysUpTime
92       */
93      public SysUpTime upTime = null;
94  
95      /**
96       *  need to add ".port" like "6666" Only in TCP (no UDP supported for
97       *  GoldenGate)
98       *  
99       *  example: rootEnterpriseMib+"66666"+".1.1.4.";
100      */
101     public String applicationProtocolBase = null;
102 
103     /**
104      * will be = new OID(applicationProtocolBase+port);
105      */
106     public OID applicationProtocol = null;
107 
108     /**
109      *  Private MIB: not published so take an OID probably not attributed
110      */
111     public int smiPrivateCode = 66666;
112 
113     /**
114      *  identification of GoldenGate module
115      */
116     public int smiTypeGoldengate = 66; // default = 66 = R66
117     /**
118      * root OID in String
119      */
120     public String srootOIDGoldenGate;
121     /**
122      * root OID
123      */
124     public OID rootOIDGoldenGate;
125 
126     /**
127      *  Used in Notify
128      */
129     public OID rootOIDGoldenGateNotif;
130 
131     /**
132      *  Used in Notify Start or Shutdown
133      */
134     public OID rootOIDGoldenGateNotifStartOrShutdown;
135 
136     /**
137      *  Info static part
138      */
139     public OID rootOIDGoldenGateInfo;
140     /**
141      * Info Row access
142      */
143     public GgMORow rowInfo;
144 
145     /**
146      *  Global dynamic part
147      */
148     public OID rootOIDGoldenGateGlobal;
149     /**
150      * Global Row access
151      */
152     public GgMORow rowGlobal;
153 
154     /**
155      *  Uptime OID
156      */
157     public OID rootOIDGoldenGateGlobalUptime;
158 
159     /**
160      *  Corresponding UpTime in Mib
161      */
162     public GgMOScalar scalarUptime = null;
163 
164     /**
165      *  Detailed dynamic part
166      */
167     public OID rootOIDGoldenGateDetailed;
168     /**
169      * Detailed Row access
170      */
171     public GgMORow rowDetailed;
172 
173     /**
174      *  Error dynamic part
175      */
176     public OID rootOIDGoldenGateError;
177     /**
178      * Error Row access
179      */
180     public GgMORow rowError;
181 
182     /**
183      *  New SNMPV2 MIB
184      */
185     public SNMPv2MIB snmpv2;
186 
187     /**
188      *  Corresponding agent
189      */
190     public GgSnmpAgent agent;
191     /**
192      * 
193      * @param sysdesc The System Description to associate
194      * @param port the port to show as used by the application
195      * @param smiPrivateCodeFinal the smiPrivateCode (should be 66666)
196      * @param typeGoldenGateObject the type of GoldenGate Object (should be 66)
197      * @param scontactName the contact name to show
198      * @param stextualName the textual name to show
199      * @param saddress the address to show
200      * @param iservice the service to show (should be 72)
201      */
202     public GgPrivateMib(String sysdesc, int port, int smiPrivateCodeFinal,
203             int typeGoldenGateObject, String scontactName, String stextualName,
204             String saddress, int iservice) {
205         textualSysDecr = sysdesc;
206         smiPrivateCode = smiPrivateCodeFinal;
207         smiTypeGoldengate = typeGoldenGateObject;
208         contactName = scontactName;
209         textualName = stextualName;
210         address = saddress;
211         service = iservice;
212         srootOIDGoldenGate = rootEnterpriseMib.toString() + "." +
213                 smiPrivateCode + "." + smiTypeGoldengate;
214         applicationProtocolBase = srootOIDGoldenGate + ".1.1.4.";
215         ggObjectId = new OID(srootOIDGoldenGate);
216         applicationProtocol = new OID(applicationProtocolBase + port);
217         rootOIDGoldenGate = new OID(srootOIDGoldenGate);
218         rootOIDGoldenGateInfo = new OID(srootOIDGoldenGate + ".1");
219         rootOIDGoldenGateGlobal = new OID(srootOIDGoldenGate + ".2");
220         rootOIDGoldenGateGlobalUptime = new OID(
221                 rootOIDGoldenGateGlobal.toString() + "." +
222                         goldenGateGlobalValuesIndex.applUptime.getOID() + ".0");
223         rootOIDGoldenGateDetailed = new OID(srootOIDGoldenGate + ".3");
224         rootOIDGoldenGateError = new OID(srootOIDGoldenGate + ".4");
225         rootOIDGoldenGateNotif = new OID(srootOIDGoldenGate + ".5.1");
226         rootOIDGoldenGateNotifStartOrShutdown = new OID(srootOIDGoldenGate +
227                 ".5.1.1.1");
228     }
229 
230     /*
231      * (non-Javadoc)
232      * 
233      * @see goldengate.snmp.GgInterfaceMib#setAgent(goldengate.snmp.GgSnmpAgent)
234      */
235     @Override
236     public void setAgent(GgSnmpAgent agent) {
237         this.agent = agent;
238     }
239 
240     /*
241      * (non-Javadoc)
242      * 
243      * @see goldengate.snmp.GgInterfaceMib#getBaseOidStartOrShutdown()
244      */
245     @Override
246     public OID getBaseOidStartOrShutdown() {
247         return rootOIDGoldenGateNotifStartOrShutdown;
248     }
249 
250     /*
251      * (non-Javadoc)
252      * 
253      * @see goldengate.snmp.GgInterfaceMib#getSNMPv2MIB()
254      */
255     @Override
256     public SNMPv2MIB getSNMPv2MIB() {
257         return snmpv2;
258     }
259 
260     /**
261      * Unregister and Register again the SNMPv2MIB with System adapted to this
262      * Mib
263      * 
264      * @throws DuplicateRegistrationException
265      */
266     protected void agentRegisterSystem() throws DuplicateRegistrationException {
267         // Since BaseAgent registers some mibs by default we need to unregister
268         // one before we register our own sysDescr. Normally you would
269         // override that method and register the mibs that you need
270 
271         agent.unregisterManagedObject(agent.getSnmpv2MIB());
272 
273         // Register a system description, use one from you product environment
274         // to test with
275         snmpv2 = new SNMPv2MIB(new OctetString(textualSysDecr), ggObjectId,
276                 new Integer32(service));
277         snmpv2.setContact(new OctetString(contactName));
278         snmpv2.setLocation(new OctetString(address));
279         snmpv2.setName(new OctetString(textualName));
280         snmpv2.registerMOs(agent.getServer(), null);
281         if (logger.isDebugEnabled()) {
282             logger.debug("SNMPV2: " + snmpv2.getContact() + ":" +
283                     snmpv2.getDescr() + ":" + snmpv2.getLocation() + ":" +
284                     snmpv2.getName() + ":" + snmpv2.getObjectID() + ":" +
285                     snmpv2.getServices() + ":" + snmpv2.getUpTime());
286         }
287         // Save UpTime reference since used everywhere
288         upTime = snmpv2.getSysUpTime();
289     }
290 
291     /**
292      * Register this MIB
293      * 
294      * @throws DuplicateRegistrationException
295      */
296     protected void defaultAgentRegisterGoldenGateMib()
297             throws DuplicateRegistrationException {
298         // register Static info
299         rowInfo = new GgMORow(this, rootOIDGoldenGateInfo,
300                 goldenGateDefinition, MibLevel.staticInfo.ordinal());
301         rowInfo.registerMOs(agent.getServer(), null);
302         // register General info
303         rowGlobal = new GgMORow(this, rootOIDGoldenGateGlobal,
304                 goldenGateGlobalValues, MibLevel.globalInfo.ordinal());
305         GgMOScalar memoryScalar = rowGlobal.row[goldenGateGlobalValuesIndex.memoryTotal
306                 .ordinal()];
307         memoryScalar.setValue(new MemoryGauge32(MemoryType.TotalMemory));
308         memoryScalar = rowGlobal.row[goldenGateGlobalValuesIndex.memoryFree
309                 .ordinal()];
310         memoryScalar.setValue(new MemoryGauge32(MemoryType.FreeMemory));
311         memoryScalar = rowGlobal.row[goldenGateGlobalValuesIndex.memoryUsed
312                 .ordinal()];
313         memoryScalar.setValue(new MemoryGauge32(MemoryType.UsedMemory));
314         rowGlobal.registerMOs(agent.getServer(), null);
315         // setup UpTime to SysUpTime and change status
316         scalarUptime = rowGlobal.row[goldenGateGlobalValuesIndex.applUptime
317                 .ordinal()];
318         scalarUptime.setValue(new GgUptime(upTime));
319         changeStatus(OperStatus.restarting);
320         changeStatus(OperStatus.up);
321         // register Detailed info
322         rowDetailed = new GgMORow(this, rootOIDGoldenGateDetailed,
323                 goldenGateDetailedValues, MibLevel.detailedInfo.ordinal());
324         rowDetailed.registerMOs(agent.getServer(), null);
325         // register Error info
326         rowError = new GgMORow(this, rootOIDGoldenGateError,
327                 goldenGateErrorValues, MibLevel.errorInfo.ordinal());
328         rowError.registerMOs(agent.getServer(), null);
329     }
330 
331     /**
332      * Register this MIB
333      * 
334      * @throws DuplicateRegistrationException
335      */
336     protected abstract void agentRegisterGoldenGateMib()
337             throws DuplicateRegistrationException;
338 
339     /**
340      * Unregister this MIB
341      */
342     protected void agentUnregisterMibs() {
343         logger.debug("UnRegisterGoldenGate");
344         rowInfo.unregisterMOs(agent.getServer(), agent.getDefaultContext());
345         rowGlobal.unregisterMOs(agent.getServer(), agent.getDefaultContext());
346         rowDetailed.unregisterMOs(agent.getServer(), agent.getDefaultContext());
347         rowError.unregisterMOs(agent.getServer(), agent.getDefaultContext());
348     }
349 
350     /*
351      * (non-Javadoc)
352      * 
353      * @see org.snmp4j.agent.MOGroup#registerMOs(org.snmp4j.agent.MOServer,
354      * org.snmp4j.smi.OctetString)
355      */
356     @Override
357     public void registerMOs(MOServer server, OctetString context)
358             throws DuplicateRegistrationException {
359         agentRegisterSystem();
360         agentRegisterGoldenGateMib();
361     }
362 
363     /*
364      * (non-Javadoc)
365      * 
366      * @see org.snmp4j.agent.MOGroup#unregisterMOs(org.snmp4j.agent.MOServer,
367      * org.snmp4j.smi.OctetString)
368      */
369     @Override
370     public void unregisterMOs(MOServer server, OctetString context) {
371         agentUnregisterMibs();
372     }
373 
374     /**
375      * Change the status and the LastChange Timeticks
376      * 
377      * @param status
378      */
379     public void changeStatus(OperStatus status) {
380         GgMOScalar statusScalar = rowGlobal.row[goldenGateGlobalValuesIndex.applOperStatus
381                 .ordinal()];
382         Integer32 var = (Integer32) statusScalar.getValue();
383         if (var.getValue() != status.status) {
384             var.setValue(status.status);
385             GgMOScalar lastTimeScalar = rowGlobal.row[goldenGateGlobalValuesIndex.applLastChange
386                     .ordinal()];
387             TimeTicks time = (TimeTicks) lastTimeScalar.getValue();
388             time.setValue(upTime.get().getValue());
389         }
390     }
391 
392     /**
393      *  MIB entry levels
394      * @author Frederic Bregier
395      *
396      */
397     public static enum MibLevel {
398         staticInfo, globalInfo, detailedInfo, errorInfo, trapInfo
399     }
400     // From now the MIB definition
401     /**
402      *  Notification Elements
403      * @author Frederic Bregier
404      *
405      */
406     public static enum NotificationElements {
407         TrapShutdown(1),
408         TrapError(2),
409         TrapWarning(3),
410         TrapOverloaded(4),
411         InfoTask(5);
412 
413         public int[] oid;
414 
415         private NotificationElements(int oid) {
416             this.oid = new int[] {
417                 oid };
418         }
419 
420         public OID getOID(OID oidBase) {
421             return new OID(oidBase.getValue(), this.oid);
422         }
423 
424         public OID getOID(OID oidBase, int rank) {
425             int[] ids = new int[] {
426                     this.oid[0], rank };
427             return new OID(oidBase.getValue(), ids);
428         }
429     }
430     /**
431      * Notification for a task trap
432      * @author Frederic Bregier
433      *
434      */
435     public static enum NotificationTasks {
436         globalStepInfo,
437         stepInfo,
438         rankFileInfo,
439         stepStatusInfo,
440         filenameInfo,
441         originalNameInfo,
442         idRuleInfo,
443         modeTransInfo,
444         retrieveModeInfo,
445         startTransInfo,
446         infoStatusInfo,
447         requesterInfo,
448         requestedInfo,
449         specialIdInfo;
450 
451         public int getOID() {
452             return this.ordinal() + 1;
453         }
454     }
455     /**
456      * Definition part
457      * @author Frederic Bregier
458      *
459      */
460     public static enum goldenGateDefinitionIndex {
461         applName,
462         applServerName,
463         applVersion,
464         applDescription,
465         applURL,
466         applApplicationProtocol;
467 
468         public int getOID() {
469             return this.ordinal() + 1;
470         }
471     }
472     /**
473      * Definition part
474      */
475     public static GgEntry[] goldenGateDefinition = {
476             // applName
477             new GgEntry(SMIConstants.SYNTAX_OCTET_STRING,
478                     MOAccessImpl.ACCESS_READ_ONLY),
479             // applServerName
480             new GgEntry(SMIConstants.SYNTAX_OCTET_STRING,
481                     MOAccessImpl.ACCESS_READ_ONLY),
482             // applVersion
483             new GgEntry(SMIConstants.SYNTAX_OCTET_STRING,
484                     MOAccessImpl.ACCESS_READ_ONLY),
485             // applDescription
486             new GgEntry(SMIConstants.SYNTAX_OCTET_STRING,
487                     MOAccessImpl.ACCESS_READ_ONLY),
488             // applURL
489             new GgEntry(SMIConstants.SYNTAX_OCTET_STRING,
490                     MOAccessImpl.ACCESS_READ_ONLY),
491             // applApplicationProtocol
492             new GgEntry(SMIConstants.SYNTAX_OBJECT_IDENTIFIER,
493                     MOAccessImpl.ACCESS_READ_ONLY) };
494     /**
495      * Global part
496      * @author Frederic Bregier
497      *
498      */
499     public static enum goldenGateGlobalValuesIndex {
500         applUptime,
501         applOperStatus,
502         applLastChange,
503         applInboundAssociations,
504         applOutboundAssociations,
505         applAccumInboundAssociations,
506         applAccumOutboundAssociations,
507         applLastInboundActivity,
508         applLastOutboundActivity,
509         applRejectedInboundAssociations,
510         applFailedOutboundAssociations,
511         applInboundBandwidthKBS,
512         applOutboundBandwidthKBS,
513         nbInfoUnknown,
514         nbInfoNotUpdated,
515         nbInfoInterrupted,
516         nbInfoToSubmit,
517         nbInfoError,
518         nbInfoRunning,
519         nbInfoDone,
520         nbStepAllTransfer,
521         memoryTotal,
522         memoryFree,
523         memoryUsed,
524         nbThreads,
525         nbNetworkConnection;
526 
527         public int getOID() {
528             return this.ordinal() + 1;
529         }
530     }
531     /**
532      * Global part
533      */
534     public static GgEntry[] goldenGateGlobalValues = {
535             // applUptime
536             new GgEntry(SMIConstants.SYNTAX_TIMETICKS,
537                     MOAccessImpl.ACCESS_READ_ONLY),
538             // applOperStatus
539             new GgEntry(SMIConstants.SYNTAX_INTEGER,
540                     MOAccessImpl.ACCESS_READ_ONLY),
541             // applLastChange
542             new GgEntry(SMIConstants.SYNTAX_TIMETICKS,
543                     MOAccessImpl.ACCESS_READ_ONLY),
544             // applInboundAssociations
545             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
546                     MOAccessImpl.ACCESS_READ_ONLY),
547             // applOutboundAssociations
548             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
549                     MOAccessImpl.ACCESS_READ_ONLY),
550             // applAccumInboundAssociations
551             new GgEntry(SMIConstants.SYNTAX_COUNTER32,
552                     MOAccessImpl.ACCESS_READ_ONLY),
553             // applAccumOutboundAssociations
554             new GgEntry(SMIConstants.SYNTAX_COUNTER32,
555                     MOAccessImpl.ACCESS_READ_ONLY),
556             // applLastInboundActivity
557             new GgEntry(SMIConstants.SYNTAX_TIMETICKS,
558                     MOAccessImpl.ACCESS_READ_ONLY),
559             // applLastOutboundActivity
560             new GgEntry(SMIConstants.SYNTAX_TIMETICKS,
561                     MOAccessImpl.ACCESS_READ_ONLY),
562             // applRejectedInboundAssociations
563             new GgEntry(SMIConstants.SYNTAX_COUNTER32,
564                     MOAccessImpl.ACCESS_READ_ONLY),
565             // applFailedOutboundAssociations
566             new GgEntry(SMIConstants.SYNTAX_COUNTER32,
567                     MOAccessImpl.ACCESS_READ_ONLY),
568             // Bandwidth
569             // applInboundBandwidthKBS
570             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
571                     MOAccessImpl.ACCESS_READ_ONLY),
572             // applOutboundBandwidthKBS
573             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
574                     MOAccessImpl.ACCESS_READ_ONLY),
575             // Overall status including past, future and current transfers
576             // nbInfoUnknown
577             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
578                     MOAccessImpl.ACCESS_READ_ONLY),
579             // nbInfoNotUpdated
580             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
581                     MOAccessImpl.ACCESS_READ_ONLY),
582             // nbInfoInterrupted
583             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
584                     MOAccessImpl.ACCESS_READ_ONLY),
585             // nbInfoToSubmit
586             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
587                     MOAccessImpl.ACCESS_READ_ONLY),
588             // nbInfoError
589             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
590                     MOAccessImpl.ACCESS_READ_ONLY),
591             // nbInfoRunning
592             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
593                     MOAccessImpl.ACCESS_READ_ONLY),
594             // nbInfoDone
595             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
596                     MOAccessImpl.ACCESS_READ_ONLY),
597             // Current situation of all transfers, running or not
598             // nbStepAllTransfer
599             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
600                     MOAccessImpl.ACCESS_READ_ONLY),
601             // memoryTotal
602             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
603                     MOAccessImpl.ACCESS_READ_ONLY),
604             // memoryFree
605             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
606                     MOAccessImpl.ACCESS_READ_ONLY),
607             // memoryUsed
608             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
609                     MOAccessImpl.ACCESS_READ_ONLY),
610             // nbThreads
611             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
612                     MOAccessImpl.ACCESS_READ_ONLY),
613             // nbNetworkConnection
614             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
615                     MOAccessImpl.ACCESS_READ_ONLY) };
616     /**
617      * Detailed part
618      * @author Frederic Bregier
619      *
620      */
621     public static enum goldenGateDetailedValuesIndex {
622         nbStepNotask,
623         nbStepPretask,
624         nbStepTransfer,
625         nbStepPosttask,
626         nbStepAllDone,
627         nbStepError,
628         nbAllRunningStep,
629         nbRunningStep,
630         nbInitOkStep,
631         nbPreProcessingOkStep,
632         nbTransferOkStep,
633         nbPostProcessingOkStep,
634         nbCompleteOkStep;
635 
636         public int getOID() {
637             return this.ordinal() + 1;
638         }
639     }
640     /**
641      * Detailed part
642      */
643     public static GgEntry[] goldenGateDetailedValues = {
644             // nbStepNotask
645             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
646                     MOAccessImpl.ACCESS_READ_ONLY),
647             // nbStepPretask
648             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
649                     MOAccessImpl.ACCESS_READ_ONLY),
650             // nbStepTransfer
651             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
652                     MOAccessImpl.ACCESS_READ_ONLY),
653             // nbStepPosttask
654             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
655                     MOAccessImpl.ACCESS_READ_ONLY),
656             // nbStepAllDone
657             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
658                     MOAccessImpl.ACCESS_READ_ONLY),
659             // nbStepError
660             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
661                     MOAccessImpl.ACCESS_READ_ONLY),
662             // First on Running Transfers only
663             // nbAllRunningStep
664             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
665                     MOAccessImpl.ACCESS_READ_ONLY),
666             // nbRunningStep
667             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
668                     MOAccessImpl.ACCESS_READ_ONLY),
669             // nbInitOkStep
670             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
671                     MOAccessImpl.ACCESS_READ_ONLY),
672             // nbPreProcessingOkStep
673             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
674                     MOAccessImpl.ACCESS_READ_ONLY),
675             // nbTransferOkStep
676             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
677                     MOAccessImpl.ACCESS_READ_ONLY),
678             // nbPostProcessingOkStep
679             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
680                     MOAccessImpl.ACCESS_READ_ONLY),
681             // nbCompleteOkStep
682             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
683                     MOAccessImpl.ACCESS_READ_ONLY) };
684     /**
685      * Error part
686      * @author Frederic Bregier
687      *
688      */
689     public static enum goldenGateErrorValuesIndex {
690         nbStatusConnectionImpossible,
691         nbStatusServerOverloaded,
692         nbStatusBadAuthent,
693         nbStatusExternalOp,
694         nbStatusTransferError,
695         nbStatusMD5Error,
696         nbStatusDisconnection,
697         nbStatusFinalOp,
698         nbStatusUnimplemented,
699         nbStatusInternal,
700         nbStatusWarning,
701         nbStatusQueryAlreadyFinished,
702         nbStatusQueryStillRunning,
703         nbStatusNotKnownHost,
704         nbStatusQueryRemotelyUnknown,
705         nbStatusCommandNotFound,
706         nbStatusPassThroughMode,
707         nbStatusRemoteShutdown,
708         nbStatusShutdown,
709         nbStatusRemoteError,
710         nbStatusStopped,
711         nbStatusCanceled,
712         nbStatusFileNotFound,
713         nbStatusUnknown;
714 
715         public int getOID() {
716             return this.ordinal() + 1;
717         }
718     }
719     /**
720      * Error part
721      */
722     public static GgEntry[] goldenGateErrorValues = {
723             // Error Status on all transfers
724             // nbStatusConnectionImpossible
725             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
726                     MOAccessImpl.ACCESS_READ_ONLY),
727             // nbStatusServerOverloaded
728             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
729                     MOAccessImpl.ACCESS_READ_ONLY),
730             // nbStatusBadAuthent
731             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
732                     MOAccessImpl.ACCESS_READ_ONLY),
733             // nbStatusExternalOp
734             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
735                     MOAccessImpl.ACCESS_READ_ONLY),
736             // nbStatusTransferError
737             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
738                     MOAccessImpl.ACCESS_READ_ONLY),
739             // nbStatusMD5Error
740             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
741                     MOAccessImpl.ACCESS_READ_ONLY),
742             // nbStatusDisconnection
743             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
744                     MOAccessImpl.ACCESS_READ_ONLY),
745             // nbStatusFinalOp
746             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
747                     MOAccessImpl.ACCESS_READ_ONLY),
748             // nbStatusUnimplemented
749             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
750                     MOAccessImpl.ACCESS_READ_ONLY),
751             // nbStatusInternal
752             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
753                     MOAccessImpl.ACCESS_READ_ONLY),
754             // nbStatusWarning
755             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
756                     MOAccessImpl.ACCESS_READ_ONLY),
757             // nbStatusQueryAlreadyFinished
758             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
759                     MOAccessImpl.ACCESS_READ_ONLY),
760             // nbStatusQueryStillRunning
761             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
762                     MOAccessImpl.ACCESS_READ_ONLY),
763             // nbStatusNotKnownHost
764             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
765                     MOAccessImpl.ACCESS_READ_ONLY),
766             // nbStatusQueryRemotelyUnknown
767             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
768                     MOAccessImpl.ACCESS_READ_ONLY),
769             // nbStatusCommandNotFound
770             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
771                     MOAccessImpl.ACCESS_READ_ONLY),
772             // nbStatusPassThroughMode
773             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
774                     MOAccessImpl.ACCESS_READ_ONLY),
775             // nbStatusRemoteShutdown
776             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
777                     MOAccessImpl.ACCESS_READ_ONLY),
778             // nbStatusShutdown
779             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
780                     MOAccessImpl.ACCESS_READ_ONLY),
781             // nbStatusRemoteError
782             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
783                     MOAccessImpl.ACCESS_READ_ONLY),
784             // nbStatusStopped
785             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
786                     MOAccessImpl.ACCESS_READ_ONLY),
787             // nbStatusCanceled
788             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
789                     MOAccessImpl.ACCESS_READ_ONLY),
790             // nbStatusFileNotFound
791             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
792                     MOAccessImpl.ACCESS_READ_ONLY),
793             // nbStatusUnknown
794             new GgEntry(SMIConstants.SYNTAX_GAUGE32,
795                     MOAccessImpl.ACCESS_READ_ONLY) };
796     /**
797      * Oper Status (as defined in Net Application SNMP)
798      * @author Frederic Bregier
799      *
800      */
801     public static enum OperStatus {
802         up(1), down(2), halted(3), congested(4), restarting(5), quiescing(6);
803 
804         public int status;
805 
806         private OperStatus(int status) {
807             this.status = status;
808         }
809     }
810 }