KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ist > coach > coachEmsMibComponents > SnmpProtocolMonitorProviderComposition > SnmpProtocolMonitorProviderImpl


1 /*====================================================================
2
3 This file was produced by the OpenCCM CIF_JIMPL generator.
4
5 OpenCCM: The Open CORBA Component Model Platform
6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL
7 Contact: openccm@objectweb.org
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA
23
24 Initial developer(s): Christophe Demarey.
25 Contributor(s): ______________________________________.
26
27 ====================================================================*/

28
29 package ist.coach.coachEmsMibComponents.SnmpProtocolMonitorProviderComposition;
30
31 import intt.itu.itut_x780.UIDType;
32 import intt.itu.itut_x780.CreateError;
33 import intt.itu.itut_x780.ApplicationError;
34 import intt.itu.itut_x780.SourceIndicatorType;
35 import intt.itu.itut_x780.AttributeValueType;
36
37 import ist.coach.coachEmfCommon.Utils;
38
39 import ist.coach.coachEmfCommon.ObjectDeletionImpl;
40 import ist.coach.coachEmfCommon.ExceptionMessages;
41
42 import ist.coach.coachEmfCommon.ApplicationErrorInfoTypeImpl;
43 import ist.coach.coachEmfCommon.DataTypeImpl;
44 import ist.coach.coachEmfServices.SnmpAdapter.DataType;
45 import ist.coach.coachEmfServices.SnmpAdapter.SnmpApplicationError;
46 import ist.coach.coachEmsMib.SnmpProtocolMonitorValueType;
47
48 import ist.coach.coachEmsCommon.SnmpIdentifiers;
49
50 import ist.coach.coachEmsCommon.SnmpProtocolMonitorValueTypeImpl;
51 import org.omg.CosNaming.NameComponent JavaDoc;
52 import org.omg.CORBA.TCKind JavaDoc;
53
54 import org.opennms.protocols.snmp.SnmpSMI;
55 import ist.coach.coachEmfServices.EmfBasicLog.*;
56 import java.util.Hashtable JavaDoc;
57 /**
58  * This is the CIDL-based implementation of the
59  * OMG IDL3 IDL:coach.ist/coachEmsMibComponents/SnmpProtocolMonitorProvider:1.0 component type.
60  *
61  * @author OpenCCM CIF_Jimpl Compiler.
62  */

63 public class SnmpProtocolMonitorProviderImpl
64      extends ist.coach.coachEmsMibComponents.SnmpProtocolMonitorProviderComposition.SnmpProtocolMonitorProvider_impl
65 {
66     // ==================================================================
67
//
68
// Internal states.
69
//
70
// ==================================================================
71
org.omg.CORBA.ORB JavaDoc orb = null;
72     private String JavaDoc _facade_name;
73
74     protected static Hashtable JavaDoc elements;
75     private static int notifId = 12000;
76     private BasicLog logSupport;
77
78     ist.coach.coachEmfServices.SnmpAdapter.SnmpConnector connector = null;
79
80     private static final String JavaDoc SNMP_AUTH_CONFIG_PACKAGE = "snmpEnableAuthenTrapPackage";
81
82     private static final String JavaDoc READ_COMMUNITY = SnmpIdentifiers.READ_COMMUNITY;
83     private static final String JavaDoc WRITE_COMMUNITY = SnmpIdentifiers.WRITE_COMMUNITY;
84
85     // ==================================================================
86
//
87
// Constructors.
88
//
89
// ==================================================================
90

91     public SnmpProtocolMonitorProviderImpl()
92     {
93       elements = new Hashtable JavaDoc();
94     }
95
96     //
97
// Methods for the OMG IDL Components::EnterpriseComponent local interface.
98
//
99
// ==================================================================
100
//
101
// IDL:omg.org/Components/EnterpriseComponent/configuration_complete:1.0
102
//
103
/**
104      ** Completes the component configuration.
105      **
106      ** @throws org.omg.Components.InvalidConfiguration
107      ** Thrown if the configuration is invalid.
108      **/

109     public void
110     configuration_complete()
111     throws org.omg.Components.InvalidConfiguration
112     {
113         //
114
// DONE : implement !!!
115
//
116

117         if ((connector = get_context().get_connection_connector()) == null)
118             throw new org.omg.Components.InvalidConfiguration();
119         if ((logSupport = get_context().get_connection_basic_log()) == null)
120             throw new org.omg.Components.InvalidConfiguration();
121
122         orb = org.objectweb.ccm.CORBA.TheORB.getORB();
123
124         System.err.println("SnmpProtocolMonitorProvider configuration completed...");
125
126
127     } // ==================================================================
128
//
129
// Methods.
130
//
131
// ==================================================================
132

133     /**
134      * Implementation of the ::itut_x780Components::CCM_NamedComponent_Executor::facade_name attribute as accessor operation.
135      */

136     public String JavaDoc
137     facade_name()
138     {
139         //
140
// DONE : implement
141
//
142
return _facade_name;
143     }
144
145     /**
146      * Implementation of the ::itut_x780Components::CCM_NamedComponent_Executor::facade_name attribute as mutator operation.
147      */

148     public void
149     facade_name(String JavaDoc val)
150     {
151              //
152
// DONE : implement
153
//
154
if (val != null)
155             _facade_name = new String JavaDoc(val);
156     }
157
158     /**
159      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInPktsGet operation.
160      */

161     public long
162     snmpInPktsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
163     throws intt.itu.itut_x780.ApplicationError
164     {
165         //
166
// DONE : implement
167
//
168
String JavaDoc key = Utils.name2string(name);
169
170       if (elements.containsKey(key) == false) {
171         ApplicationErrorInfoTypeImpl error_code =
172             new ApplicationErrorInfoTypeImpl();
173
174         error_code.error = new UIDType(
175             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
176             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
177
178         error_code.details = new String JavaDoc("object with name " +
179             key + " does not exist.");
180
181         throw new ApplicationError(error_code);
182       }
183
184       SnmpProtocolMonitorDataStructure data =
185         (SnmpProtocolMonitorDataStructure) elements.get(key);
186
187       DataType snmpAttrData = null;
188
189       try {
190         snmpAttrData = connector.get(
191             SnmpIdentifiers.SNMP_INPKTS_OID,
192             new String JavaDoc (data.mgmtIpAddress),
193             data.getSnmpPort(),
194             READ_COMMUNITY);
195       }
196       catch (SnmpApplicationError e) {
197
198         ApplicationErrorInfoTypeImpl error_code =
199             new ApplicationErrorInfoTypeImpl();
200
201         error_code.error = new UIDType(
202             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
203             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
204
205         if (e.reason.equals(ExceptionMessages.agent_response_error))
206             error_code.details = ExceptionMessages.agent_response_error;
207         else
208             error_code.details = new String JavaDoc ("Could not retrieve snmpInPkts " +
209                 "for SnmpProtocolMonitor Object with name " + key + ":" +
210                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INPKTS_OID +
211                 " does not exist.");
212
213             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
214               (short) LogSeverity._Error,
215               "SNMP Error getting snmpInPkts: " + e.reason);
216
217           throw new ApplicationError (error_code);
218       }
219
220       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
221
222       if (value.type().kind().value() != TCKind._tk_longlong) {
223
224         ApplicationErrorInfoTypeImpl error_code =
225             new ApplicationErrorInfoTypeImpl();
226
227         error_code.error = new UIDType(
228             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
229             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
230
231         error_code.details = new String JavaDoc ("Could not retrieve snmpInPkts " +
232             "for SnmpProtocolMonitor Object with name " + key + ":" +
233             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INPKTS_OID +
234             " is not of type integer, as expected.");
235
236         throw new ApplicationError (error_code);
237       }
238
239       long snmpAttrValue = value.extract_longlong();
240
241       return snmpAttrValue;
242
243     }
244
245     /**
246      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutPktsGet operation.
247      */

248     public long
249     snmpOutPktsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
250     throws intt.itu.itut_x780.ApplicationError
251     {
252         //
253
// DONE : implement
254
//
255
String JavaDoc key = Utils.name2string(name);
256
257       if (elements.containsKey(key) == false) {
258         ApplicationErrorInfoTypeImpl error_code =
259             new ApplicationErrorInfoTypeImpl();
260
261         error_code.error = new UIDType(
262             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
263             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
264
265         error_code.details = new String JavaDoc("object with name " +
266             key + " does not exist.");
267
268         throw new ApplicationError(error_code);
269       }
270
271       SnmpProtocolMonitorDataStructure data =
272         (SnmpProtocolMonitorDataStructure) elements.get(key);
273
274       DataType snmpAttrData = null;
275
276       try {
277         snmpAttrData = connector.get(
278             SnmpIdentifiers.SNMP_OUTPKTS_OID,
279             new String JavaDoc (data.mgmtIpAddress),
280             data.getSnmpPort(),
281             READ_COMMUNITY);
282       }
283       catch (SnmpApplicationError e) {
284
285         ApplicationErrorInfoTypeImpl error_code =
286             new ApplicationErrorInfoTypeImpl();
287
288         error_code.error = new UIDType(
289             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
290             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
291
292         if (e.reason.equals(ExceptionMessages.agent_response_error))
293             error_code.details = ExceptionMessages.agent_response_error;
294         else
295             error_code.details = new String JavaDoc ("Could not retrieve snmpOutPkts " +
296                 "for SnmpProtocolMonitor Object with name " + key + ":" +
297                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTPKTS_OID +
298                 " does not exist.");
299
300             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
301               (short) LogSeverity._Error,
302               "SNMP Error getting snmpInPkts: " + e.reason);
303
304           throw new ApplicationError (error_code);
305       }
306
307       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
308
309       if (value.type().kind().value() != TCKind._tk_longlong) {
310
311         ApplicationErrorInfoTypeImpl error_code =
312             new ApplicationErrorInfoTypeImpl();
313
314         error_code.error = new UIDType(
315             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
316             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
317
318         error_code.details = new String JavaDoc ("Could not retrieve snmpOutPkts " +
319             "for SnmpProtocolMonitor Object with name " + key + ":" +
320             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTPKTS_OID +
321             " is not of type integer, as expected.");
322
323         throw new ApplicationError (error_code);
324       }
325
326       long snmpAttrValue = value.extract_longlong();
327
328       return snmpAttrValue;
329
330     }
331
332     /**
333      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInBadVersionsGet operation.
334      */

335     public long
336     snmpInBadVersionsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
337     throws intt.itu.itut_x780.ApplicationError
338     {
339         //
340
// DONE : implement
341
//
342
String JavaDoc key = Utils.name2string(name);
343
344       if (elements.containsKey(key) == false) {
345         ApplicationErrorInfoTypeImpl error_code =
346             new ApplicationErrorInfoTypeImpl();
347
348         error_code.error = new UIDType(
349             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
350             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
351
352         error_code.details = new String JavaDoc("object with name " +
353             key + " does not exist.");
354
355         throw new ApplicationError(error_code);
356       }
357
358       SnmpProtocolMonitorDataStructure data =
359         (SnmpProtocolMonitorDataStructure) elements.get(key);
360
361       DataType snmpAttrData = null;
362
363       try {
364         snmpAttrData = connector.get(
365             SnmpIdentifiers.SNMP_INBADVERSIONS_OID,
366             new String JavaDoc (data.mgmtIpAddress),
367             data.getSnmpPort(),
368             READ_COMMUNITY);
369       }
370       catch (SnmpApplicationError e) {
371
372         ApplicationErrorInfoTypeImpl error_code =
373             new ApplicationErrorInfoTypeImpl();
374
375         error_code.error = new UIDType(
376             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
377             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
378
379         if (e.reason.equals(ExceptionMessages.agent_response_error))
380             error_code.details = ExceptionMessages.agent_response_error;
381         else
382             error_code.details = new String JavaDoc ("Could not retrieve snmpInBadVersions " +
383                 "for SnmpProtocolMonitor Object with name " + key + ":" +
384                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADVERSIONS_OID +
385                 " does not exist.");
386
387             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
388               (short) LogSeverity._Error,
389               "SNMP Error getting snmpInPkts: " + e.reason);
390
391           throw new ApplicationError (error_code);
392       }
393
394       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
395
396       if (value.type().kind().value() != TCKind._tk_longlong) {
397
398         ApplicationErrorInfoTypeImpl error_code =
399             new ApplicationErrorInfoTypeImpl();
400
401         error_code.error = new UIDType(
402             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
403             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
404
405         error_code.details = new String JavaDoc ("Could not retrieve snmpInBadVersions " +
406             "for SnmpProtocolMonitor Object with name " + key + ":" +
407             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADVERSIONS_OID +
408             " is not of type integer, as expected.");
409
410         throw new ApplicationError (error_code);
411       }
412
413       long snmpAttrValue = value.extract_longlong();
414
415       return snmpAttrValue;
416
417     }
418
419     /**
420      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInBadCommunityNamesGet operation.
421      */

422     public long
423     snmpInBadCommunityNamesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
424     throws intt.itu.itut_x780.ApplicationError
425     {
426         //
427
// DONE : implement
428
//
429
String JavaDoc key = Utils.name2string(name);
430
431       if (elements.containsKey(key) == false) {
432         ApplicationErrorInfoTypeImpl error_code =
433             new ApplicationErrorInfoTypeImpl();
434
435         error_code.error = new UIDType(
436             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
437             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
438
439         error_code.details = new String JavaDoc("object with name " +
440             key + " does not exist.");
441
442         throw new ApplicationError(error_code);
443       }
444
445       SnmpProtocolMonitorDataStructure data =
446         (SnmpProtocolMonitorDataStructure) elements.get(key);
447
448       DataType snmpAttrData = null;
449
450       try {
451         snmpAttrData = connector.get(
452             SnmpIdentifiers.SNMP_INBADCOMMUNITYNAME_OID,
453             new String JavaDoc (data.mgmtIpAddress),
454             data.getSnmpPort(),
455             READ_COMMUNITY);
456       }
457       catch (SnmpApplicationError e) {
458
459         ApplicationErrorInfoTypeImpl error_code =
460             new ApplicationErrorInfoTypeImpl();
461
462         error_code.error = new UIDType(
463             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
464             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
465
466         if (e.reason.equals(ExceptionMessages.agent_response_error))
467             error_code.details = ExceptionMessages.agent_response_error;
468         else
469             error_code.details = new String JavaDoc ("Could not retrieve snmpInBadCommunityNames " +
470                 "for SnmpProtocolMonitor Object with name " + key + ":" +
471                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADCOMMUNITYNAME_OID +
472                 " does not exist.");
473
474             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
475               (short) LogSeverity._Error,
476               "SNMP Error getting snmpInPkts: " + e.reason);
477
478           throw new ApplicationError (error_code);
479       }
480
481       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
482
483       if (value.type().kind().value() != TCKind._tk_longlong) {
484
485         ApplicationErrorInfoTypeImpl error_code =
486             new ApplicationErrorInfoTypeImpl();
487
488         error_code.error = new UIDType(
489             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
490             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
491
492         error_code.details = new String JavaDoc ("Could not retrieve snmpInBadCommunityNames " +
493             "for SnmpProtocolMonitor Object with name " + key + ":" +
494             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADCOMMUNITYNAME_OID +
495             " is not of type integer, as expected.");
496
497         throw new ApplicationError (error_code);
498       }
499
500       long snmpAttrValue = value.extract_longlong();
501
502       return snmpAttrValue;
503
504     }
505
506     /**
507      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInBadCommunityUsesGet operation.
508      */

509     public long
510     snmpInBadCommunityUsesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
511     throws intt.itu.itut_x780.ApplicationError
512     {
513         //
514
// DONE : implement
515
//
516
String JavaDoc key = Utils.name2string(name);
517
518       if (elements.containsKey(key) == false) {
519         ApplicationErrorInfoTypeImpl error_code =
520             new ApplicationErrorInfoTypeImpl();
521
522         error_code.error = new UIDType(
523             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
524             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
525
526         error_code.details = new String JavaDoc("object with name " +
527             key + " does not exist.");
528
529         throw new ApplicationError(error_code);
530       }
531
532       SnmpProtocolMonitorDataStructure data =
533         (SnmpProtocolMonitorDataStructure) elements.get(key);
534
535       DataType snmpAttrData = null;
536
537       try {
538         snmpAttrData = connector.get(
539             SnmpIdentifiers.SNMP_INBADCOMMUNITYUSES_OID,
540             new String JavaDoc (data.mgmtIpAddress),
541             data.getSnmpPort(),
542             READ_COMMUNITY);
543       }
544       catch (SnmpApplicationError e) {
545
546         ApplicationErrorInfoTypeImpl error_code =
547             new ApplicationErrorInfoTypeImpl();
548
549         error_code.error = new UIDType(
550             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
551             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
552
553         if (e.reason.equals(ExceptionMessages.agent_response_error))
554             error_code.details = ExceptionMessages.agent_response_error;
555         else
556             error_code.details = new String JavaDoc ("Could not retrieve snmpInBadCommunityUses " +
557                 "for SnmpProtocolMonitor Object with name " + key + ":" +
558                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADCOMMUNITYUSES_OID +
559                 " does not exist.");
560
561             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
562               (short) LogSeverity._Error,
563               "SNMP Error getting snmpInPkts: " + e.reason);
564
565           throw new ApplicationError (error_code);
566       }
567
568       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
569
570       if (value.type().kind().value() != TCKind._tk_longlong) {
571
572         ApplicationErrorInfoTypeImpl error_code =
573             new ApplicationErrorInfoTypeImpl();
574
575         error_code.error = new UIDType(
576             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
577             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
578
579         error_code.details = new String JavaDoc ("Could not retrieve snmpInBadCommunityUses " +
580             "for SnmpProtocolMonitor Object with name " + key + ":" +
581             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADCOMMUNITYUSES_OID +
582             " is not of type integer, as expected.");
583
584         throw new ApplicationError (error_code);
585       }
586
587       long snmpAttrValue = value.extract_longlong();
588
589       return snmpAttrValue;
590     }
591
592     /**
593      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInASNParseErrsGet operation.
594      */

595     public long
596     snmpInASNParseErrsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
597     throws intt.itu.itut_x780.ApplicationError
598     {
599         //
600
// DONE : implement
601
//
602
String JavaDoc key = Utils.name2string(name);
603
604       if (elements.containsKey(key) == false) {
605         ApplicationErrorInfoTypeImpl error_code =
606             new ApplicationErrorInfoTypeImpl();
607
608         error_code.error = new UIDType(
609             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
610             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
611
612         error_code.details = new String JavaDoc("object with name " +
613             key + " does not exist.");
614
615         throw new ApplicationError(error_code);
616       }
617
618       SnmpProtocolMonitorDataStructure data =
619         (SnmpProtocolMonitorDataStructure) elements.get(key);
620
621       DataType snmpAttrData = null;
622
623       try {
624         snmpAttrData = connector.get(
625             SnmpIdentifiers.SNMP_INASNPARSEERRORS_OID,
626             new String JavaDoc (data.mgmtIpAddress),
627             data.getSnmpPort(),
628             READ_COMMUNITY);
629       }
630       catch (SnmpApplicationError e) {
631
632         ApplicationErrorInfoTypeImpl error_code =
633             new ApplicationErrorInfoTypeImpl();
634
635         error_code.error = new UIDType(
636             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
637             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
638
639         if (e.reason.equals(ExceptionMessages.agent_response_error))
640             error_code.details = ExceptionMessages.agent_response_error;
641         else
642             error_code.details = new String JavaDoc ("Could not retrieve snmpInASNParseErrs " +
643                 "for SnmpProtocolMonitor Object with name " + key + ":" +
644                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INASNPARSEERRORS_OID +
645                 " does not exist.");
646
647             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
648               (short) LogSeverity._Error,
649               "SNMP Error getting snmpInPkts: " + e.reason);
650
651           throw new ApplicationError (error_code);
652       }
653
654       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
655
656       if (value.type().kind().value() != TCKind._tk_longlong) {
657
658         ApplicationErrorInfoTypeImpl error_code =
659             new ApplicationErrorInfoTypeImpl();
660
661         error_code.error = new UIDType(
662             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
663             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
664
665         error_code.details = new String JavaDoc ("Could not retrieve snmpInASNParseErrs " +
666             "for SnmpProtocolMonitor Object with name " + key + ":" +
667             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INASNPARSEERRORS_OID +
668             " is not of type integer, as expected.");
669
670         throw new ApplicationError (error_code);
671       }
672
673       long snmpAttrValue = value.extract_longlong();
674
675       return snmpAttrValue;
676     }
677
678     /**
679      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInTooBigsGet operation.
680      */

681     public long
682     snmpInTooBigsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
683     throws intt.itu.itut_x780.ApplicationError
684     {
685         //
686
// DONE : implement
687
//
688
String JavaDoc key = Utils.name2string(name);
689
690       if (elements.containsKey(key) == false) {
691         ApplicationErrorInfoTypeImpl error_code =
692             new ApplicationErrorInfoTypeImpl();
693
694         error_code.error = new UIDType(
695             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
696             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
697
698         error_code.details = new String JavaDoc("object with name " +
699             key + " does not exist.");
700
701         throw new ApplicationError(error_code);
702       }
703
704       SnmpProtocolMonitorDataStructure data =
705         (SnmpProtocolMonitorDataStructure) elements.get(key);
706
707       DataType snmpAttrData = null;
708
709       try {
710         snmpAttrData = connector.get(
711             SnmpIdentifiers.SNMP_INTOOBIG_OID,
712             new String JavaDoc (data.mgmtIpAddress),
713             data.getSnmpPort(),
714             READ_COMMUNITY);
715       }
716       catch (SnmpApplicationError e) {
717
718         ApplicationErrorInfoTypeImpl error_code =
719             new ApplicationErrorInfoTypeImpl();
720
721         error_code.error = new UIDType(
722             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
723             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
724
725         if (e.reason.equals(ExceptionMessages.agent_response_error))
726             error_code.details = ExceptionMessages.agent_response_error;
727         else
728             error_code.details = new String JavaDoc ("Could not retrieve snmpInTooBigs " +
729                 "for SnmpProtocolMonitor Object with name " + key + ":" +
730                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTOOBIG_OID +
731                 " does not exist.");
732
733             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
734               (short) LogSeverity._Error,
735               "SNMP Error getting snmpInPkts: " + e.reason);
736
737           throw new ApplicationError (error_code);
738       }
739
740       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
741
742       if (value.type().kind().value() != TCKind._tk_longlong) {
743
744         ApplicationErrorInfoTypeImpl error_code =
745             new ApplicationErrorInfoTypeImpl();
746
747         error_code.error = new UIDType(
748             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
749             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
750
751         error_code.details = new String JavaDoc ("Could not retrieve snmpInTooBigs " +
752             "for SnmpProtocolMonitor Object with name " + key + ":" +
753             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTOOBIG_OID +
754             " is not of type integer, as expected.");
755
756         throw new ApplicationError (error_code);
757       }
758
759       long snmpAttrValue = value.extract_longlong();
760
761       return snmpAttrValue;
762     }
763
764     /**
765      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInNoSuchNamesGet operation.
766      */

767     public long
768     snmpInNoSuchNamesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
769     throws intt.itu.itut_x780.ApplicationError
770     {
771         //
772
// DONE : implement
773
//
774
String JavaDoc key = Utils.name2string(name);
775
776       if (elements.containsKey(key) == false) {
777         ApplicationErrorInfoTypeImpl error_code =
778             new ApplicationErrorInfoTypeImpl();
779
780         error_code.error = new UIDType(
781             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
782             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
783
784         error_code.details = new String JavaDoc("object with name " +
785             key + " does not exist.");
786
787         throw new ApplicationError(error_code);
788       }
789
790       SnmpProtocolMonitorDataStructure data =
791         (SnmpProtocolMonitorDataStructure) elements.get(key);
792
793       DataType snmpAttrData = null;
794
795       try {
796         snmpAttrData = connector.get(
797             SnmpIdentifiers.SNMP_INNOSUCHNAMES_OID,
798             new String JavaDoc (data.mgmtIpAddress),
799             data.getSnmpPort(),
800             READ_COMMUNITY);
801       }
802       catch (SnmpApplicationError e) {
803
804         ApplicationErrorInfoTypeImpl error_code =
805             new ApplicationErrorInfoTypeImpl();
806
807         error_code.error = new UIDType(
808             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
809             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
810
811         if (e.reason.equals(ExceptionMessages.agent_response_error))
812             error_code.details = ExceptionMessages.agent_response_error;
813         else
814             error_code.details = new String JavaDoc ("Could not retrieve snmpInNoSuchNames " +
815                 "for SnmpProtocolMonitor Object with name " + key + ":" +
816                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INNOSUCHNAMES_OID +
817                 " does not exist.");
818
819             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
820               (short) LogSeverity._Error,
821               "SNMP Error getting snmpInPkts: " + e.reason);
822
823           throw new ApplicationError (error_code);
824       }
825
826       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
827
828       if (value.type().kind().value() != TCKind._tk_longlong) {
829
830         ApplicationErrorInfoTypeImpl error_code =
831             new ApplicationErrorInfoTypeImpl();
832
833         error_code.error = new UIDType(
834             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
835             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
836
837         error_code.details = new String JavaDoc ("Could not retrieve snmpInNoSuchNames " +
838             "for SnmpProtocolMonitor Object with name " + key + ":" +
839             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INNOSUCHNAMES_OID +
840             " is not of type integer, as expected.");
841
842         throw new ApplicationError (error_code);
843       }
844
845       long snmpAttrValue = value.extract_longlong();
846
847       return snmpAttrValue;
848     }
849
850     /**
851      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInBadValuesGet operation.
852      */

853     public long
854     snmpInBadValuesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
855     throws intt.itu.itut_x780.ApplicationError
856     {
857         //
858
// DONE : implement
859
//
860
String JavaDoc key = Utils.name2string(name);
861
862       if (elements.containsKey(key) == false) {
863         ApplicationErrorInfoTypeImpl error_code =
864             new ApplicationErrorInfoTypeImpl();
865
866         error_code.error = new UIDType(
867             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
868             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
869
870         error_code.details = new String JavaDoc("object with name " +
871             key + " does not exist.");
872
873         throw new ApplicationError(error_code);
874       }
875
876       SnmpProtocolMonitorDataStructure data =
877         (SnmpProtocolMonitorDataStructure) elements.get(key);
878
879       DataType snmpAttrData = null;
880
881       try {
882         snmpAttrData = connector.get(
883             SnmpIdentifiers.SNMP_INBADVALUES_OID,
884             new String JavaDoc (data.mgmtIpAddress),
885             data.getSnmpPort(),
886             READ_COMMUNITY);
887       }
888       catch (SnmpApplicationError e) {
889
890         ApplicationErrorInfoTypeImpl error_code =
891             new ApplicationErrorInfoTypeImpl();
892
893         error_code.error = new UIDType(
894             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
895             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
896
897         if (e.reason.equals(ExceptionMessages.agent_response_error))
898             error_code.details = ExceptionMessages.agent_response_error;
899         else
900             error_code.details = new String JavaDoc ("Could not retrieve snmpInBadValues " +
901                 "for SnmpProtocolMonitor Object with name " + key + ":" +
902                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADVALUES_OID +
903                 " does not exist.");
904
905             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
906               (short) LogSeverity._Error,
907               "SNMP Error getting snmpInPkts: " + e.reason);
908
909           throw new ApplicationError (error_code);
910       }
911
912       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
913
914       if (value.type().kind().value() != TCKind._tk_longlong) {
915
916         ApplicationErrorInfoTypeImpl error_code =
917             new ApplicationErrorInfoTypeImpl();
918
919         error_code.error = new UIDType(
920             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
921             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
922
923         error_code.details = new String JavaDoc ("Could not retrieve snmpInBadValues " +
924             "for SnmpProtocolMonitor Object with name " + key + ":" +
925             " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INBADVALUES_OID +
926             " is not of type integer, as expected.");
927
928         throw new ApplicationError (error_code);
929       }
930
931       long snmpAttrValue = value.extract_longlong();
932
933       return snmpAttrValue;
934     }
935
936     /**
937      * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInReadOnlysGet operation.
938      */

939     public long
940     snmpInReadOnlysGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
941     throws intt.itu.itut_x780.ApplicationError
942     {
943         //
944
// DONE : implement
945
//
946
String JavaDoc key = Utils.name2string(name);
947
948       if (elements.containsKey(key) == false) {
949         ApplicationErrorInfoTypeImpl error_code =
950             new ApplicationErrorInfoTypeImpl();
951
952         error_code.error = new UIDType(
953             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
954             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
955
956         error_code.details = new String JavaDoc("object with name " +
957             key + " does not exist.");
958
959         throw new ApplicationError(error_code);
960       }
961
962       SnmpProtocolMonitorDataStructure data =
963         (SnmpProtocolMonitorDataStructure) elements.get(key);
964
965       DataType snmpAttrData = null;
966
967       try {
968         snmpAttrData = connector.get(
969             SnmpIdentifiers.SNMP_INREADONLYS_OID,
970             new String JavaDoc (data.mgmtIpAddress),
971             data.getSnmpPort(),
972             READ_COMMUNITY);
973       }
974       catch (SnmpApplicationError e) {
975
976         ApplicationErrorInfoTypeImpl error_code =
977             new ApplicationErrorInfoTypeImpl();
978
979         error_code.error = new UIDType(
980             intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
981             intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
982
983         if (e.reason.equals(ExceptionMessages.agent_response_error))
984             error_code.details = ExceptionMessages.agent_response_error;
985         else
986             error_code.details = new String JavaDoc ("Could not retrieve snmpInReadOnlys " +
987                 "for SnmpProtocolMonitor Object with name " + key + ":" +
988                 " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INREADONLYS_OID +
989                 " does not exist.");
990
991             Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
992               (short) LogSeverity._Error,
993               "SNMP Error getting snmpInPkts: " + e.reason);
994
995           throw new ApplicationError (error_code);
996       }
997
998       org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
999
1000      if (value.type().kind().value() != TCKind._tk_longlong) {
1001
1002        ApplicationErrorInfoTypeImpl error_code =
1003            new ApplicationErrorInfoTypeImpl();
1004
1005        error_code.error = new UIDType(
1006            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1007            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1008
1009        error_code.details = new String JavaDoc ("Could not retrieve snmpInReadOnlys " +
1010            "for SnmpProtocolMonitor Object with name " + key + ":" +
1011            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INREADONLYS_OID +
1012            " is not of type integer, as expected.");
1013
1014        throw new ApplicationError (error_code);
1015      }
1016
1017      long snmpAttrValue = value.extract_longlong();
1018
1019      return snmpAttrValue;
1020    }
1021
1022    /**
1023     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInGenErrsGet operation.
1024     */

1025    public long
1026    snmpInGenErrsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1027    throws intt.itu.itut_x780.ApplicationError
1028    {
1029        //
1030
// DONE : implement
1031
//
1032
String JavaDoc key = Utils.name2string(name);
1033
1034      if (elements.containsKey(key) == false) {
1035        ApplicationErrorInfoTypeImpl error_code =
1036            new ApplicationErrorInfoTypeImpl();
1037
1038        error_code.error = new UIDType(
1039            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1040            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1041
1042        error_code.details = new String JavaDoc("object with name " +
1043            key + " does not exist.");
1044
1045        throw new ApplicationError(error_code);
1046      }
1047
1048      SnmpProtocolMonitorDataStructure data =
1049        (SnmpProtocolMonitorDataStructure) elements.get(key);
1050
1051      DataType snmpAttrData = null;
1052
1053      try {
1054        snmpAttrData = connector.get(
1055            SnmpIdentifiers.SNMP_INGENERRS_OID,
1056            new String JavaDoc (data.mgmtIpAddress),
1057            data.getSnmpPort(),
1058            READ_COMMUNITY);
1059      }
1060      catch (SnmpApplicationError e) {
1061
1062        ApplicationErrorInfoTypeImpl error_code =
1063            new ApplicationErrorInfoTypeImpl();
1064
1065        error_code.error = new UIDType(
1066            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1067            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1068
1069        if (e.reason.equals(ExceptionMessages.agent_response_error))
1070            error_code.details = ExceptionMessages.agent_response_error;
1071        else
1072            error_code.details = new String JavaDoc ("Could not retrieve snmpInGenErrs " +
1073                "for SnmpProtocolMonitor Object with name " + key + ":" +
1074                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGENERRS_OID +
1075                " does not exist.");
1076
1077            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1078              (short) LogSeverity._Error,
1079              "SNMP Error getting snmpInPkts: " + e.reason);
1080
1081          throw new ApplicationError (error_code);
1082      }
1083
1084      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1085
1086      if (value.type().kind().value() != TCKind._tk_longlong) {
1087
1088        ApplicationErrorInfoTypeImpl error_code =
1089            new ApplicationErrorInfoTypeImpl();
1090
1091        error_code.error = new UIDType(
1092            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1093            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1094
1095        error_code.details = new String JavaDoc ("Could not retrieve snmpInGenErrs " +
1096            "for SnmpProtocolMonitor Object with name " + key + ":" +
1097            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGENERRS_OID +
1098            " is not of type integer, as expected.");
1099
1100        throw new ApplicationError (error_code);
1101      }
1102
1103      long snmpAttrValue = value.extract_longlong();
1104
1105      return snmpAttrValue;
1106    }
1107
1108    /**
1109     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInTotalReqVarsGet operation.
1110     */

1111    public long
1112    snmpInTotalReqVarsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1113    throws intt.itu.itut_x780.ApplicationError
1114    {
1115       //
1116
// DONE : implement
1117
//
1118
String JavaDoc key = Utils.name2string(name);
1119
1120      if (elements.containsKey(key) == false) {
1121        ApplicationErrorInfoTypeImpl error_code =
1122            new ApplicationErrorInfoTypeImpl();
1123
1124        error_code.error = new UIDType(
1125            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1126            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1127
1128        error_code.details = new String JavaDoc("object with name " +
1129            key + " does not exist.");
1130
1131        throw new ApplicationError(error_code);
1132      }
1133
1134      SnmpProtocolMonitorDataStructure data =
1135        (SnmpProtocolMonitorDataStructure) elements.get(key);
1136
1137      DataType snmpAttrData = null;
1138
1139      try {
1140        snmpAttrData = connector.get(
1141            SnmpIdentifiers.SNMP_INTOTALREQVARS_OID,
1142            new String JavaDoc (data.mgmtIpAddress),
1143            data.getSnmpPort(),
1144            READ_COMMUNITY);
1145      }
1146      catch (SnmpApplicationError e) {
1147
1148        ApplicationErrorInfoTypeImpl error_code =
1149            new ApplicationErrorInfoTypeImpl();
1150
1151        error_code.error = new UIDType(
1152            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1153            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1154
1155        if (e.reason.equals(ExceptionMessages.agent_response_error))
1156            error_code.details = ExceptionMessages.agent_response_error;
1157        else
1158            error_code.details = new String JavaDoc ("Could not retrieve snmpInTotalReqVars " +
1159                "for SnmpProtocolMonitor Object with name " + key + ":" +
1160                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTOTALREQVARS_OID +
1161                " does not exist.");
1162
1163            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1164              (short) LogSeverity._Error,
1165              "SNMP Error getting snmpInPkts: " + e.reason);
1166
1167          throw new ApplicationError (error_code);
1168      }
1169
1170      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1171
1172      if (value.type().kind().value() != TCKind._tk_longlong) {
1173
1174        ApplicationErrorInfoTypeImpl error_code =
1175            new ApplicationErrorInfoTypeImpl();
1176
1177        error_code.error = new UIDType(
1178            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1179            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1180
1181        error_code.details = new String JavaDoc ("Could not retrieve snmpInTotalReqVars " +
1182            "for SnmpProtocolMonitor Object with name " + key + ":" +
1183            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTOTALREQVARS_OID +
1184            " is not of type integer, as expected.");
1185
1186        throw new ApplicationError (error_code);
1187      }
1188
1189      long snmpAttrValue = value.extract_longlong();
1190
1191      return snmpAttrValue;
1192    }
1193
1194    /**
1195     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInTotalSetVarsGet operation.
1196     */

1197    public long
1198    snmpInTotalSetVarsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1199    throws intt.itu.itut_x780.ApplicationError
1200    {
1201       //
1202
// DONE : implement
1203
//
1204
String JavaDoc key = Utils.name2string(name);
1205
1206      if (elements.containsKey(key) == false) {
1207        ApplicationErrorInfoTypeImpl error_code =
1208            new ApplicationErrorInfoTypeImpl();
1209
1210        error_code.error = new UIDType(
1211            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1212            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1213
1214        error_code.details = new String JavaDoc("object with name " +
1215            key + " does not exist.");
1216
1217        throw new ApplicationError(error_code);
1218      }
1219
1220      SnmpProtocolMonitorDataStructure data =
1221        (SnmpProtocolMonitorDataStructure) elements.get(key);
1222
1223      DataType snmpAttrData = null;
1224
1225      try {
1226        snmpAttrData = connector.get(
1227            SnmpIdentifiers.SNMP_INTOTALSETVARS_OID,
1228            new String JavaDoc (data.mgmtIpAddress),
1229            data.getSnmpPort(),
1230            READ_COMMUNITY);
1231      }
1232      catch (SnmpApplicationError e) {
1233
1234        ApplicationErrorInfoTypeImpl error_code =
1235            new ApplicationErrorInfoTypeImpl();
1236
1237        error_code.error = new UIDType(
1238            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1239            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1240
1241        if (e.reason.equals(ExceptionMessages.agent_response_error))
1242            error_code.details = ExceptionMessages.agent_response_error;
1243        else
1244            error_code.details = new String JavaDoc ("Could not retrieve snmpInTotalSetVars " +
1245                "for SnmpProtocolMonitor Object with name " + key + ":" +
1246                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTOTALSETVARS_OID +
1247                " does not exist.");
1248
1249            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1250              (short) LogSeverity._Error,
1251              "SNMP Error getting snmpInPkts: " + e.reason);
1252
1253          throw new ApplicationError (error_code);
1254      }
1255
1256      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1257
1258      if (value.type().kind().value() != TCKind._tk_longlong) {
1259
1260        ApplicationErrorInfoTypeImpl error_code =
1261            new ApplicationErrorInfoTypeImpl();
1262
1263        error_code.error = new UIDType(
1264            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1265            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1266
1267        error_code.details = new String JavaDoc ("Could not retrieve snmpInTotalSetVars " +
1268            "for SnmpProtocolMonitor Object with name " + key + ":" +
1269            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTOTALSETVARS_OID +
1270            " is not of type integer, as expected.");
1271
1272        throw new ApplicationError (error_code);
1273      }
1274
1275      long snmpAttrValue = value.extract_longlong();
1276
1277      return snmpAttrValue;
1278    }
1279
1280    /**
1281     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInGetRequestsGet operation.
1282     */

1283    public long
1284    snmpInGetRequestsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1285    throws intt.itu.itut_x780.ApplicationError
1286    {
1287       //
1288
// DONE : implement
1289
//
1290
String JavaDoc key = Utils.name2string(name);
1291
1292      if (elements.containsKey(key) == false) {
1293        ApplicationErrorInfoTypeImpl error_code =
1294            new ApplicationErrorInfoTypeImpl();
1295
1296        error_code.error = new UIDType(
1297            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1298            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1299
1300        error_code.details = new String JavaDoc("object with name " +
1301            key + " does not exist.");
1302
1303        throw new ApplicationError(error_code);
1304      }
1305
1306      SnmpProtocolMonitorDataStructure data =
1307        (SnmpProtocolMonitorDataStructure) elements.get(key);
1308
1309      DataType snmpAttrData = null;
1310
1311      try {
1312        snmpAttrData = connector.get(
1313            SnmpIdentifiers.SNMP_INGETREQS_OID,
1314            new String JavaDoc (data.mgmtIpAddress),
1315            data.getSnmpPort(),
1316            READ_COMMUNITY);
1317      }
1318      catch (SnmpApplicationError e) {
1319
1320        ApplicationErrorInfoTypeImpl error_code =
1321            new ApplicationErrorInfoTypeImpl();
1322
1323        error_code.error = new UIDType(
1324            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1325            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1326
1327        if (e.reason.equals(ExceptionMessages.agent_response_error))
1328            error_code.details = ExceptionMessages.agent_response_error;
1329        else
1330            error_code.details = new String JavaDoc ("Could not retrieve snmpInGetRequests " +
1331                "for SnmpProtocolMonitor Object with name " + key + ":" +
1332                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGETREQS_OID +
1333                " does not exist.");
1334
1335            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1336              (short) LogSeverity._Error,
1337              "SNMP Error getting snmpInPkts: " + e.reason);
1338
1339          throw new ApplicationError (error_code);
1340      }
1341
1342      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1343
1344      if (value.type().kind().value() != TCKind._tk_longlong) {
1345
1346        ApplicationErrorInfoTypeImpl error_code =
1347            new ApplicationErrorInfoTypeImpl();
1348
1349        error_code.error = new UIDType(
1350            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1351            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1352
1353        error_code.details = new String JavaDoc ("Could not retrieve snmpInGetRequests " +
1354            "for SnmpProtocolMonitor Object with name " + key + ":" +
1355            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGETREQS_OID +
1356            " is not of type integer, as expected.");
1357
1358        throw new ApplicationError (error_code);
1359      }
1360
1361      long snmpAttrValue = value.extract_longlong();
1362
1363      return snmpAttrValue;
1364    }
1365
1366    /**
1367     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInGetNextsGet operation.
1368     */

1369    public long
1370    snmpInGetNextsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1371    throws intt.itu.itut_x780.ApplicationError
1372    {
1373       //
1374
// DONE : implement
1375
//
1376
String JavaDoc key = Utils.name2string(name);
1377
1378      if (elements.containsKey(key) == false) {
1379        ApplicationErrorInfoTypeImpl error_code =
1380            new ApplicationErrorInfoTypeImpl();
1381
1382        error_code.error = new UIDType(
1383            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1384            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1385
1386        error_code.details = new String JavaDoc("object with name " +
1387            key + " does not exist.");
1388
1389        throw new ApplicationError(error_code);
1390      }
1391
1392      SnmpProtocolMonitorDataStructure data =
1393        (SnmpProtocolMonitorDataStructure) elements.get(key);
1394
1395      DataType snmpAttrData = null;
1396
1397      try {
1398        snmpAttrData = connector.get(
1399            SnmpIdentifiers.SNMP_INGETNEXTS_OID,
1400            new String JavaDoc (data.mgmtIpAddress),
1401            data.getSnmpPort(),
1402            READ_COMMUNITY);
1403      }
1404      catch (SnmpApplicationError e) {
1405
1406        ApplicationErrorInfoTypeImpl error_code =
1407            new ApplicationErrorInfoTypeImpl();
1408
1409        error_code.error = new UIDType(
1410            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1411            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1412
1413        if (e.reason.equals(ExceptionMessages.agent_response_error))
1414            error_code.details = ExceptionMessages.agent_response_error;
1415        else
1416            error_code.details = new String JavaDoc ("Could not retrieve snmpInGetNexts " +
1417                "for SnmpProtocolMonitor Object with name " + key + ":" +
1418                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGETNEXTS_OID +
1419                " does not exist.");
1420
1421            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1422              (short) LogSeverity._Error,
1423              "SNMP Error getting snmpInPkts: " + e.reason);
1424
1425          throw new ApplicationError (error_code);
1426      }
1427
1428      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1429
1430      if (value.type().kind().value() != TCKind._tk_longlong) {
1431
1432        ApplicationErrorInfoTypeImpl error_code =
1433            new ApplicationErrorInfoTypeImpl();
1434
1435        error_code.error = new UIDType(
1436            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1437            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1438
1439        error_code.details = new String JavaDoc ("Could not retrieve snmpInGetNexts " +
1440            "for SnmpProtocolMonitor Object with name " + key + ":" +
1441            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGETNEXTS_OID +
1442            " is not of type integer, as expected.");
1443
1444        throw new ApplicationError (error_code);
1445      }
1446
1447      long snmpAttrValue = value.extract_longlong();
1448
1449      return snmpAttrValue;
1450    }
1451
1452    /**
1453     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInSetRequestsGet operation.
1454     */

1455    public long
1456    snmpInSetRequestsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1457    throws intt.itu.itut_x780.ApplicationError
1458    {
1459       //
1460
// DONE : implement
1461
//
1462
String JavaDoc key = Utils.name2string(name);
1463
1464      if (elements.containsKey(key) == false) {
1465        ApplicationErrorInfoTypeImpl error_code =
1466            new ApplicationErrorInfoTypeImpl();
1467
1468        error_code.error = new UIDType(
1469            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1470            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1471
1472        error_code.details = new String JavaDoc("object with name " +
1473            key + " does not exist.");
1474
1475        throw new ApplicationError(error_code);
1476      }
1477
1478      SnmpProtocolMonitorDataStructure data =
1479        (SnmpProtocolMonitorDataStructure) elements.get(key);
1480
1481      DataType snmpAttrData = null;
1482
1483      try {
1484        snmpAttrData = connector.get(
1485            SnmpIdentifiers.SNMP_INSETREQS_OID,
1486            new String JavaDoc (data.mgmtIpAddress),
1487            data.getSnmpPort(),
1488            READ_COMMUNITY);
1489      }
1490      catch (SnmpApplicationError e) {
1491
1492        ApplicationErrorInfoTypeImpl error_code =
1493            new ApplicationErrorInfoTypeImpl();
1494
1495        error_code.error = new UIDType(
1496            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1497            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1498
1499        if (e.reason.equals(ExceptionMessages.agent_response_error))
1500            error_code.details = ExceptionMessages.agent_response_error;
1501        else
1502            error_code.details = new String JavaDoc ("Could not retrieve snmpInSetRequests " +
1503                "for SnmpProtocolMonitor Object with name " + key + ":" +
1504                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INSETREQS_OID +
1505                " does not exist.");
1506
1507            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1508              (short) LogSeverity._Error,
1509              "SNMP Error getting snmpInPkts: " + e.reason);
1510
1511          throw new ApplicationError (error_code);
1512      }
1513
1514      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1515
1516      if (value.type().kind().value() != TCKind._tk_longlong) {
1517
1518        ApplicationErrorInfoTypeImpl error_code =
1519            new ApplicationErrorInfoTypeImpl();
1520
1521        error_code.error = new UIDType(
1522            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1523            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1524
1525        error_code.details = new String JavaDoc ("Could not retrieve snmpInSetRequests " +
1526            "for SnmpProtocolMonitor Object with name " + key + ":" +
1527            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INSETREQS_OID +
1528            " is not of type integer, as expected.");
1529
1530        throw new ApplicationError (error_code);
1531      }
1532
1533      long snmpAttrValue = value.extract_longlong();
1534
1535      return snmpAttrValue;
1536    }
1537
1538    /**
1539     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInGetResponsesGet operation.
1540     */

1541    public long
1542    snmpInGetResponsesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1543    throws intt.itu.itut_x780.ApplicationError
1544    {
1545        // DONE : implement
1546
//
1547
String JavaDoc key = Utils.name2string(name);
1548
1549      if (elements.containsKey(key) == false) {
1550        ApplicationErrorInfoTypeImpl error_code =
1551            new ApplicationErrorInfoTypeImpl();
1552
1553        error_code.error = new UIDType(
1554            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1555            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1556
1557        error_code.details = new String JavaDoc("object with name " +
1558            key + " does not exist.");
1559
1560        throw new ApplicationError(error_code);
1561      }
1562
1563      SnmpProtocolMonitorDataStructure data =
1564        (SnmpProtocolMonitorDataStructure) elements.get(key);
1565
1566      DataType snmpAttrData = null;
1567
1568      try {
1569        snmpAttrData = connector.get(
1570            SnmpIdentifiers.SNMP_INGETRESPONSES_OID,
1571            new String JavaDoc (data.mgmtIpAddress),
1572            data.getSnmpPort(),
1573            READ_COMMUNITY);
1574      }
1575      catch (SnmpApplicationError e) {
1576
1577        ApplicationErrorInfoTypeImpl error_code =
1578            new ApplicationErrorInfoTypeImpl();
1579
1580        error_code.error = new UIDType(
1581            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1582            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1583
1584        if (e.reason.equals(ExceptionMessages.agent_response_error))
1585            error_code.details = ExceptionMessages.agent_response_error;
1586        else
1587            error_code.details = new String JavaDoc ("Could not retrieve snmpInGetResponses " +
1588                "for SnmpProtocolMonitor Object with name " + key + ":" +
1589                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGETRESPONSES_OID +
1590                " does not exist.");
1591
1592            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1593              (short) LogSeverity._Error,
1594              "SNMP Error getting snmpInPkts: " + e.reason);
1595
1596          throw new ApplicationError (error_code);
1597      }
1598
1599      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1600
1601      if (value.type().kind().value() != TCKind._tk_longlong) {
1602
1603        ApplicationErrorInfoTypeImpl error_code =
1604            new ApplicationErrorInfoTypeImpl();
1605
1606        error_code.error = new UIDType(
1607            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1608            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1609
1610        error_code.details = new String JavaDoc ("Could not retrieve snmpInGetResponses " +
1611            "for SnmpProtocolMonitor Object with name " + key + ":" +
1612            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INGETRESPONSES_OID +
1613            " is not of type integer, as expected.");
1614
1615        throw new ApplicationError (error_code);
1616      }
1617
1618      long snmpAttrValue = value.extract_longlong();
1619
1620      return snmpAttrValue;
1621    }
1622
1623    /**
1624     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpInTrapsGet operation.
1625     */

1626    public long
1627    snmpInTrapsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1628    throws intt.itu.itut_x780.ApplicationError
1629    {
1630        // DONE : implement
1631
//
1632
String JavaDoc key = Utils.name2string(name);
1633
1634      if (elements.containsKey(key) == false) {
1635        ApplicationErrorInfoTypeImpl error_code =
1636            new ApplicationErrorInfoTypeImpl();
1637
1638        error_code.error = new UIDType(
1639            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1640            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1641
1642        error_code.details = new String JavaDoc("object with name " +
1643            key + " does not exist.");
1644
1645        throw new ApplicationError(error_code);
1646      }
1647
1648      SnmpProtocolMonitorDataStructure data =
1649        (SnmpProtocolMonitorDataStructure) elements.get(key);
1650
1651      DataType snmpAttrData = null;
1652
1653      try {
1654        snmpAttrData = connector.get(
1655            SnmpIdentifiers.SNMP_INTRAPS_OID,
1656            new String JavaDoc (data.mgmtIpAddress),
1657            data.getSnmpPort(),
1658            READ_COMMUNITY);
1659      }
1660      catch (SnmpApplicationError e) {
1661
1662        ApplicationErrorInfoTypeImpl error_code =
1663            new ApplicationErrorInfoTypeImpl();
1664
1665        error_code.error = new UIDType(
1666            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1667            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1668
1669        if (e.reason.equals(ExceptionMessages.agent_response_error))
1670            error_code.details = ExceptionMessages.agent_response_error;
1671        else
1672            error_code.details = new String JavaDoc ("Could not retrieve snmpInTraps " +
1673                "for SnmpProtocolMonitor Object with name " + key + ":" +
1674                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTRAPS_OID +
1675                " does not exist.");
1676
1677            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1678              (short) LogSeverity._Error,
1679              "SNMP Error getting snmpInPkts: " + e.reason);
1680
1681          throw new ApplicationError (error_code);
1682      }
1683
1684      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1685
1686      if (value.type().kind().value() != TCKind._tk_longlong) {
1687
1688        ApplicationErrorInfoTypeImpl error_code =
1689            new ApplicationErrorInfoTypeImpl();
1690
1691        error_code.error = new UIDType(
1692            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1693            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1694
1695        error_code.details = new String JavaDoc ("Could not retrieve snmpInTraps " +
1696            "for SnmpProtocolMonitor Object with name " + key + ":" +
1697            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_INTRAPS_OID +
1698            " is not of type integer, as expected.");
1699
1700        throw new ApplicationError (error_code);
1701      }
1702
1703      long snmpAttrValue = value.extract_longlong();
1704
1705      return snmpAttrValue;
1706    }
1707
1708    /**
1709     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutTooBigsGet operation.
1710     */

1711    public long
1712    snmpOutTooBigsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1713    throws intt.itu.itut_x780.ApplicationError
1714    {
1715         // DONE : implement
1716
//
1717
String JavaDoc key = Utils.name2string(name);
1718
1719      if (elements.containsKey(key) == false) {
1720        ApplicationErrorInfoTypeImpl error_code =
1721            new ApplicationErrorInfoTypeImpl();
1722
1723        error_code.error = new UIDType(
1724            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1725            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1726
1727        error_code.details = new String JavaDoc("object with name " +
1728            key + " does not exist.");
1729
1730        throw new ApplicationError(error_code);
1731      }
1732
1733      SnmpProtocolMonitorDataStructure data =
1734        (SnmpProtocolMonitorDataStructure) elements.get(key);
1735
1736      DataType snmpAttrData = null;
1737
1738      try {
1739        snmpAttrData = connector.get(
1740            SnmpIdentifiers.SNMP_OUTTOOBIG_OID,
1741            new String JavaDoc (data.mgmtIpAddress),
1742            data.getSnmpPort(),
1743            READ_COMMUNITY);
1744      }
1745      catch (SnmpApplicationError e) {
1746
1747        ApplicationErrorInfoTypeImpl error_code =
1748            new ApplicationErrorInfoTypeImpl();
1749
1750        error_code.error = new UIDType(
1751            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1752            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1753
1754        if (e.reason.equals(ExceptionMessages.agent_response_error))
1755            error_code.details = ExceptionMessages.agent_response_error;
1756        else
1757            error_code.details = new String JavaDoc ("Could not retrieve snmpOutTooBigs " +
1758                "for SnmpProtocolMonitor Object with name " + key + ":" +
1759                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTTOOBIG_OID +
1760                " does not exist.");
1761
1762            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1763              (short) LogSeverity._Error,
1764              "SNMP Error getting snmpInPkts: " + e.reason);
1765
1766          throw new ApplicationError (error_code);
1767      }
1768
1769      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1770
1771      if (value.type().kind().value() != TCKind._tk_longlong) {
1772
1773        ApplicationErrorInfoTypeImpl error_code =
1774            new ApplicationErrorInfoTypeImpl();
1775
1776        error_code.error = new UIDType(
1777            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1778            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1779
1780        error_code.details = new String JavaDoc ("Could not retrieve snmpOutTooBigs " +
1781            "for SnmpProtocolMonitor Object with name " + key + ":" +
1782            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTTOOBIG_OID +
1783            " is not of type integer, as expected.");
1784
1785        throw new ApplicationError (error_code);
1786      }
1787
1788      long snmpAttrValue = value.extract_longlong();
1789
1790      return snmpAttrValue;
1791    }
1792
1793    /**
1794     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutNoSuchNamesGet operation.
1795     */

1796    public long
1797    snmpOutNoSuchNamesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1798    throws intt.itu.itut_x780.ApplicationError
1799    {
1800        //
1801
// DONE : implement
1802
//
1803
String JavaDoc key = Utils.name2string(name);
1804
1805      if (elements.containsKey(key) == false) {
1806        ApplicationErrorInfoTypeImpl error_code =
1807            new ApplicationErrorInfoTypeImpl();
1808
1809        error_code.error = new UIDType(
1810            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1811            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1812
1813        error_code.details = new String JavaDoc("object with name " +
1814            key + " does not exist.");
1815
1816        throw new ApplicationError(error_code);
1817      }
1818
1819      SnmpProtocolMonitorDataStructure data =
1820        (SnmpProtocolMonitorDataStructure) elements.get(key);
1821
1822      DataType snmpAttrData = null;
1823
1824      try {
1825        snmpAttrData = connector.get(
1826            SnmpIdentifiers.SNMP_OUTNOSUCHNAMES_OID,
1827            new String JavaDoc (data.mgmtIpAddress),
1828            data.getSnmpPort(),
1829            READ_COMMUNITY);
1830      }
1831      catch (SnmpApplicationError e) {
1832
1833        ApplicationErrorInfoTypeImpl error_code =
1834            new ApplicationErrorInfoTypeImpl();
1835
1836        error_code.error = new UIDType(
1837            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1838            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1839
1840        if (e.reason.equals(ExceptionMessages.agent_response_error))
1841            error_code.details = ExceptionMessages.agent_response_error;
1842        else
1843            error_code.details = new String JavaDoc ("Could not retrieve snmpOutNoSuchNames " +
1844                "for SnmpProtocolMonitor Object with name " + key + ":" +
1845                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTNOSUCHNAMES_OID +
1846                " does not exist.");
1847
1848            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1849              (short) LogSeverity._Error,
1850              "SNMP Error getting snmpInPkts: " + e.reason);
1851
1852          throw new ApplicationError (error_code);
1853      }
1854
1855      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1856
1857      if (value.type().kind().value() != TCKind._tk_longlong) {
1858
1859        ApplicationErrorInfoTypeImpl error_code =
1860            new ApplicationErrorInfoTypeImpl();
1861
1862        error_code.error = new UIDType(
1863            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1864            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1865
1866        error_code.details = new String JavaDoc ("Could not retrieve snmpOutNoSuchNames " +
1867            "for SnmpProtocolMonitor Object with name " + key + ":" +
1868            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTNOSUCHNAMES_OID +
1869            " is not of type integer, as expected.");
1870
1871        throw new ApplicationError (error_code);
1872      }
1873
1874      long snmpAttrValue = value.extract_longlong();
1875
1876      return snmpAttrValue;
1877    }
1878
1879    /**
1880     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutBadValuesGet operation.
1881     */

1882    public long
1883    snmpOutBadValuesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1884    throws intt.itu.itut_x780.ApplicationError
1885    {
1886        //
1887
// DONE : implement
1888
//
1889
String JavaDoc key = Utils.name2string(name);
1890
1891      if (elements.containsKey(key) == false) {
1892        ApplicationErrorInfoTypeImpl error_code =
1893            new ApplicationErrorInfoTypeImpl();
1894
1895        error_code.error = new UIDType(
1896            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1897            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1898
1899        error_code.details = new String JavaDoc("object with name " +
1900            key + " does not exist.");
1901
1902        throw new ApplicationError(error_code);
1903      }
1904
1905      SnmpProtocolMonitorDataStructure data =
1906        (SnmpProtocolMonitorDataStructure) elements.get(key);
1907
1908      DataType snmpAttrData = null;
1909
1910      try {
1911        snmpAttrData = connector.get(
1912            SnmpIdentifiers.SNMP_OUTBADVALUES_OID,
1913            new String JavaDoc (data.mgmtIpAddress),
1914            data.getSnmpPort(),
1915            READ_COMMUNITY);
1916      }
1917      catch (SnmpApplicationError e) {
1918
1919        ApplicationErrorInfoTypeImpl error_code =
1920            new ApplicationErrorInfoTypeImpl();
1921
1922        error_code.error = new UIDType(
1923            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1924            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1925
1926        if (e.reason.equals(ExceptionMessages.agent_response_error))
1927            error_code.details = ExceptionMessages.agent_response_error;
1928        else
1929            error_code.details = new String JavaDoc ("Could not retrieve snmpOutBadValues " +
1930                "for SnmpProtocolMonitor Object with name " + key + ":" +
1931                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTBADVALUES_OID +
1932                " does not exist.");
1933
1934            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
1935              (short) LogSeverity._Error,
1936              "SNMP Error getting snmpInPkts: " + e.reason);
1937
1938          throw new ApplicationError (error_code);
1939      }
1940
1941      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
1942
1943      if (value.type().kind().value() != TCKind._tk_longlong) {
1944
1945        ApplicationErrorInfoTypeImpl error_code =
1946            new ApplicationErrorInfoTypeImpl();
1947
1948        error_code.error = new UIDType(
1949            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1950            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1951
1952        error_code.details = new String JavaDoc ("Could not retrieve snmpOutBadValues " +
1953            "for SnmpProtocolMonitor Object with name " + key + ":" +
1954            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTBADVALUES_OID +
1955            " is not of type integer, as expected.");
1956
1957        throw new ApplicationError (error_code);
1958      }
1959
1960      long snmpAttrValue = value.extract_longlong();
1961
1962      return snmpAttrValue;
1963    }
1964
1965    /**
1966     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutGenErrsGet operation.
1967     */

1968    public long
1969    snmpOutGenErrsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
1970    throws intt.itu.itut_x780.ApplicationError
1971    {
1972        //
1973
// DONE : implement
1974
//
1975
String JavaDoc key = Utils.name2string(name);
1976
1977      if (elements.containsKey(key) == false) {
1978        ApplicationErrorInfoTypeImpl error_code =
1979            new ApplicationErrorInfoTypeImpl();
1980
1981        error_code.error = new UIDType(
1982            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
1983            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
1984
1985        error_code.details = new String JavaDoc("object with name " +
1986            key + " does not exist.");
1987
1988        throw new ApplicationError(error_code);
1989      }
1990
1991      SnmpProtocolMonitorDataStructure data =
1992        (SnmpProtocolMonitorDataStructure) elements.get(key);
1993
1994      DataType snmpAttrData = null;
1995
1996      try {
1997        snmpAttrData = connector.get(
1998            SnmpIdentifiers.SNMP_OUTGENERRS_OID,
1999            new String JavaDoc (data.mgmtIpAddress),
2000            data.getSnmpPort(),
2001            READ_COMMUNITY);
2002      }
2003      catch (SnmpApplicationError e) {
2004
2005        ApplicationErrorInfoTypeImpl error_code =
2006            new ApplicationErrorInfoTypeImpl();
2007
2008        error_code.error = new UIDType(
2009            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2010            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2011
2012        if (e.reason.equals(ExceptionMessages.agent_response_error))
2013            error_code.details = ExceptionMessages.agent_response_error;
2014        else
2015            error_code.details = new String JavaDoc ("Could not retrieve snmpOutGenErrs " +
2016                "for SnmpProtocolMonitor Object with name " + key + ":" +
2017                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGENERRS_OID +
2018                " does not exist.");
2019
2020            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2021              (short) LogSeverity._Error,
2022              "SNMP Error getting snmpInPkts: " + e.reason);
2023
2024          throw new ApplicationError (error_code);
2025      }
2026
2027      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
2028
2029      if (value.type().kind().value() != TCKind._tk_longlong) {
2030
2031        ApplicationErrorInfoTypeImpl error_code =
2032            new ApplicationErrorInfoTypeImpl();
2033
2034        error_code.error = new UIDType(
2035            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2036            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2037
2038        error_code.details = new String JavaDoc ("Could not retrieve snmpOutGenErrs " +
2039            "for SnmpProtocolMonitor Object with name " + key + ":" +
2040            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGENERRS_OID +
2041            " is not of type integer, as expected.");
2042
2043        throw new ApplicationError (error_code);
2044      }
2045
2046      long snmpAttrValue = value.extract_longlong();
2047
2048      return snmpAttrValue;
2049    }
2050
2051    /**
2052     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutGetRequestsGet operation.
2053     */

2054    public long
2055    snmpOutGetRequestsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2056    throws intt.itu.itut_x780.ApplicationError
2057    {
2058        //
2059
// DONE : implement
2060
//
2061
String JavaDoc key = Utils.name2string(name);
2062
2063      if (elements.containsKey(key) == false) {
2064        ApplicationErrorInfoTypeImpl error_code =
2065            new ApplicationErrorInfoTypeImpl();
2066
2067        error_code.error = new UIDType(
2068            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2069            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2070
2071        error_code.details = new String JavaDoc("object with name " +
2072            key + " does not exist.");
2073
2074        throw new ApplicationError(error_code);
2075      }
2076
2077      SnmpProtocolMonitorDataStructure data =
2078        (SnmpProtocolMonitorDataStructure) elements.get(key);
2079
2080      DataType snmpAttrData = null;
2081
2082      try {
2083        snmpAttrData = connector.get(
2084            SnmpIdentifiers.SNMP_OUTGETREQS_OID,
2085            new String JavaDoc (data.mgmtIpAddress),
2086            data.getSnmpPort(),
2087            READ_COMMUNITY);
2088      }
2089      catch (SnmpApplicationError e) {
2090
2091        ApplicationErrorInfoTypeImpl error_code =
2092            new ApplicationErrorInfoTypeImpl();
2093
2094        error_code.error = new UIDType(
2095            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2096            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2097
2098        if (e.reason.equals(ExceptionMessages.agent_response_error))
2099            error_code.details = ExceptionMessages.agent_response_error;
2100        else
2101            error_code.details = new String JavaDoc ("Could not retrieve snmpOutGetRequests " +
2102                "for SnmpProtocolMonitor Object with name " + key + ":" +
2103                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGETREQS_OID +
2104                " does not exist.");
2105
2106            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2107              (short) LogSeverity._Error,
2108              "SNMP Error getting snmpInPkts: " + e.reason);
2109
2110          throw new ApplicationError (error_code);
2111      }
2112
2113      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
2114
2115      if (value.type().kind().value() != TCKind._tk_longlong) {
2116
2117        ApplicationErrorInfoTypeImpl error_code =
2118            new ApplicationErrorInfoTypeImpl();
2119
2120        error_code.error = new UIDType(
2121            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2122            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2123
2124        error_code.details = new String JavaDoc ("Could not retrieve snmpOutGetRequests " +
2125            "for SnmpProtocolMonitor Object with name " + key + ":" +
2126            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGETREQS_OID +
2127            " is not of type integer, as expected.");
2128
2129        throw new ApplicationError (error_code);
2130      }
2131
2132      long snmpAttrValue = value.extract_longlong();
2133
2134      return snmpAttrValue;
2135    }
2136
2137    /**
2138     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutGetNextsGet operation.
2139     */

2140    public long
2141    snmpOutGetNextsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2142    throws intt.itu.itut_x780.ApplicationError
2143    {
2144        //
2145
// DONE : implement
2146
//
2147
String JavaDoc key = Utils.name2string(name);
2148
2149      if (elements.containsKey(key) == false) {
2150        ApplicationErrorInfoTypeImpl error_code =
2151            new ApplicationErrorInfoTypeImpl();
2152
2153        error_code.error = new UIDType(
2154            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2155            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2156
2157        error_code.details = new String JavaDoc("object with name " +
2158            key + " does not exist.");
2159
2160        throw new ApplicationError(error_code);
2161      }
2162
2163      SnmpProtocolMonitorDataStructure data =
2164        (SnmpProtocolMonitorDataStructure) elements.get(key);
2165
2166      DataType snmpAttrData = null;
2167
2168      try {
2169        snmpAttrData = connector.get(
2170            SnmpIdentifiers.SNMP_OUTGETNEXTS_OID,
2171            new String JavaDoc (data.mgmtIpAddress),
2172            data.getSnmpPort(),
2173            READ_COMMUNITY);
2174      }
2175      catch (SnmpApplicationError e) {
2176
2177        ApplicationErrorInfoTypeImpl error_code =
2178            new ApplicationErrorInfoTypeImpl();
2179
2180        error_code.error = new UIDType(
2181            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2182            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2183
2184        if (e.reason.equals(ExceptionMessages.agent_response_error))
2185            error_code.details = ExceptionMessages.agent_response_error;
2186        else
2187            error_code.details = new String JavaDoc ("Could not retrieve snmpOutGetNexts " +
2188                "for SnmpProtocolMonitor Object with name " + key + ":" +
2189                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGETNEXTS_OID +
2190                " does not exist.");
2191
2192            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2193              (short) LogSeverity._Error,
2194              "SNMP Error getting snmpInPkts: " + e.reason);
2195
2196          throw new ApplicationError (error_code);
2197      }
2198
2199      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
2200
2201      if (value.type().kind().value() != TCKind._tk_longlong) {
2202
2203        ApplicationErrorInfoTypeImpl error_code =
2204            new ApplicationErrorInfoTypeImpl();
2205
2206        error_code.error = new UIDType(
2207            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2208            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2209
2210        error_code.details = new String JavaDoc ("Could not retrieve snmpOutGetNexts " +
2211            "for SnmpProtocolMonitor Object with name " + key + ":" +
2212            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGETNEXTS_OID +
2213            " is not of type integer, as expected.");
2214
2215        throw new ApplicationError (error_code);
2216      }
2217
2218      long snmpAttrValue = value.extract_longlong();
2219
2220      return snmpAttrValue;
2221    }
2222
2223    /**
2224     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutSetRequestsGet operation.
2225     */

2226    public long
2227    snmpOutSetRequestsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2228    throws intt.itu.itut_x780.ApplicationError
2229    {
2230        //
2231
// DONE : implement
2232
//
2233
String JavaDoc key = Utils.name2string(name);
2234
2235      if (elements.containsKey(key) == false) {
2236        ApplicationErrorInfoTypeImpl error_code =
2237            new ApplicationErrorInfoTypeImpl();
2238
2239        error_code.error = new UIDType(
2240            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2241            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2242
2243        error_code.details = new String JavaDoc("object with name " +
2244            key + " does not exist.");
2245
2246        throw new ApplicationError(error_code);
2247      }
2248
2249      SnmpProtocolMonitorDataStructure data =
2250        (SnmpProtocolMonitorDataStructure) elements.get(key);
2251
2252      DataType snmpAttrData = null;
2253
2254      try {
2255        snmpAttrData = connector.get(
2256            SnmpIdentifiers.SNMP_OUTSETREQS_OID,
2257            new String JavaDoc (data.mgmtIpAddress),
2258            data.getSnmpPort(),
2259            READ_COMMUNITY);
2260      }
2261      catch (SnmpApplicationError e) {
2262
2263        ApplicationErrorInfoTypeImpl error_code =
2264            new ApplicationErrorInfoTypeImpl();
2265
2266        error_code.error = new UIDType(
2267            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2268            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2269
2270        if (e.reason.equals(ExceptionMessages.agent_response_error))
2271            error_code.details = ExceptionMessages.agent_response_error;
2272        else
2273            error_code.details = new String JavaDoc ("Could not retrieve snmpOutSetRequests " +
2274                "for SnmpProtocolMonitor Object with name " + key + ":" +
2275                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTSETREQS_OID +
2276                " does not exist.");
2277
2278            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2279              (short) LogSeverity._Error,
2280              "SNMP Error getting snmpInPkts: " + e.reason);
2281
2282          throw new ApplicationError (error_code);
2283      }
2284
2285      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
2286
2287      if (value.type().kind().value() != TCKind._tk_longlong) {
2288
2289        ApplicationErrorInfoTypeImpl error_code =
2290            new ApplicationErrorInfoTypeImpl();
2291
2292        error_code.error = new UIDType(
2293            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2294            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2295
2296        error_code.details = new String JavaDoc ("Could not retrieve snmpOutSetRequests " +
2297            "for SnmpProtocolMonitor Object with name " + key + ":" +
2298            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTSETREQS_OID +
2299            " is not of type integer, as expected.");
2300
2301        throw new ApplicationError (error_code);
2302      }
2303
2304      long snmpAttrValue = value.extract_longlong();
2305
2306      return snmpAttrValue;
2307    }
2308
2309    /**
2310     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutGetResponsesGet operation.
2311     */

2312    public long
2313    snmpOutGetResponsesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2314    throws intt.itu.itut_x780.ApplicationError
2315    {
2316         //
2317
// DONE : implement
2318
//
2319
String JavaDoc key = Utils.name2string(name);
2320
2321      if (elements.containsKey(key) == false) {
2322        ApplicationErrorInfoTypeImpl error_code =
2323            new ApplicationErrorInfoTypeImpl();
2324
2325        error_code.error = new UIDType(
2326            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2327            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2328
2329        error_code.details = new String JavaDoc("object with name " +
2330            key + " does not exist.");
2331
2332        throw new ApplicationError(error_code);
2333      }
2334
2335      SnmpProtocolMonitorDataStructure data =
2336        (SnmpProtocolMonitorDataStructure) elements.get(key);
2337
2338      DataType snmpAttrData = null;
2339
2340      try {
2341        snmpAttrData = connector.get(
2342            SnmpIdentifiers.SNMP_OUTGETRESPONSES_OID,
2343            new String JavaDoc (data.mgmtIpAddress),
2344            data.getSnmpPort(),
2345            READ_COMMUNITY);
2346      }
2347      catch (SnmpApplicationError e) {
2348
2349        ApplicationErrorInfoTypeImpl error_code =
2350            new ApplicationErrorInfoTypeImpl();
2351
2352        error_code.error = new UIDType(
2353            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2354            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2355
2356        if (e.reason.equals(ExceptionMessages.agent_response_error))
2357            error_code.details = ExceptionMessages.agent_response_error;
2358        else
2359            error_code.details = new String JavaDoc ("Could not retrieve snmpOutGetResponses " +
2360                "for SnmpProtocolMonitor Object with name " + key + ":" +
2361                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGETRESPONSES_OID +
2362                " does not exist.");
2363
2364            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2365              (short) LogSeverity._Error,
2366              "SNMP Error getting snmpInPkts: " + e.reason);
2367
2368          throw new ApplicationError (error_code);
2369      }
2370
2371      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
2372
2373      if (value.type().kind().value() != TCKind._tk_longlong) {
2374
2375        ApplicationErrorInfoTypeImpl error_code =
2376            new ApplicationErrorInfoTypeImpl();
2377
2378        error_code.error = new UIDType(
2379            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2380            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2381
2382        error_code.details = new String JavaDoc ("Could not retrieve snmpOutGetResponses " +
2383            "for SnmpProtocolMonitor Object with name " + key + ":" +
2384            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTGETRESPONSES_OID +
2385            " is not of type integer, as expected.");
2386
2387        throw new ApplicationError (error_code);
2388      }
2389
2390      long snmpAttrValue = value.extract_longlong();
2391
2392      return snmpAttrValue;
2393    }
2394
2395    /**
2396     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpOutTrapsGet operation.
2397     */

2398    public long
2399    snmpOutTrapsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2400    throws intt.itu.itut_x780.ApplicationError
2401    {
2402         //
2403
// DONE : implement
2404
//
2405
String JavaDoc key = Utils.name2string(name);
2406
2407      if (elements.containsKey(key) == false) {
2408        ApplicationErrorInfoTypeImpl error_code =
2409            new ApplicationErrorInfoTypeImpl();
2410
2411        error_code.error = new UIDType(
2412            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2413            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2414
2415        error_code.details = new String JavaDoc("object with name " +
2416            key + " does not exist.");
2417
2418        throw new ApplicationError(error_code);
2419      }
2420
2421      SnmpProtocolMonitorDataStructure data =
2422        (SnmpProtocolMonitorDataStructure) elements.get(key);
2423
2424      DataType snmpAttrData = null;
2425
2426      try {
2427        snmpAttrData = connector.get(
2428            SnmpIdentifiers.SNMP_OUTTRAPS_OID,
2429            new String JavaDoc (data.mgmtIpAddress),
2430            data.getSnmpPort(),
2431            READ_COMMUNITY);
2432      }
2433      catch (SnmpApplicationError e) {
2434
2435        ApplicationErrorInfoTypeImpl error_code =
2436            new ApplicationErrorInfoTypeImpl();
2437
2438        error_code.error = new UIDType(
2439            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2440            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2441
2442        if (e.reason.equals(ExceptionMessages.agent_response_error))
2443            error_code.details = ExceptionMessages.agent_response_error;
2444        else
2445            error_code.details = new String JavaDoc ("Could not retrieve snmpOutTraps " +
2446                "for SnmpProtocolMonitor Object with name " + key + ":" +
2447                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTTRAPS_OID +
2448                " does not exist.");
2449
2450            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2451              (short) LogSeverity._Error,
2452              "SNMP Error getting snmpInPkts: " + e.reason);
2453
2454          throw new ApplicationError (error_code);
2455      }
2456
2457      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
2458
2459      if (value.type().kind().value() != TCKind._tk_longlong) {
2460
2461        ApplicationErrorInfoTypeImpl error_code =
2462            new ApplicationErrorInfoTypeImpl();
2463
2464        error_code.error = new UIDType(
2465            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2466            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2467
2468        error_code.details = new String JavaDoc ("Could not retrieve snmpOutTraps " +
2469            "for SnmpProtocolMonitor Object with name " + key + ":" +
2470            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_OUTTRAPS_OID +
2471            " is not of type integer, as expected.");
2472
2473        throw new ApplicationError (error_code);
2474      }
2475
2476      long snmpAttrValue = value.extract_longlong();
2477
2478      return snmpAttrValue;
2479    }
2480
2481    /**
2482     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpEnableAuthenTrapsGet operation.
2483     */

2484    public int
2485    snmpEnableAuthenTrapsGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2486    throws intt.itu.itut_x780.ApplicationError
2487    {
2488         //
2489
// DONE : implement
2490
//
2491
String JavaDoc key = Utils.name2string(name);
2492
2493      if (elements.containsKey(key) == false) {
2494        ApplicationErrorInfoTypeImpl error_code =
2495            new ApplicationErrorInfoTypeImpl();
2496
2497        error_code.error = new UIDType(
2498            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2499            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2500
2501        error_code.details = new String JavaDoc("object with name " +
2502            key + " does not exist.");
2503
2504        throw new ApplicationError(error_code);
2505      }
2506
2507      SnmpProtocolMonitorDataStructure data =
2508        (SnmpProtocolMonitorDataStructure) elements.get(key);
2509
2510      DataType snmpAttrData = null;
2511
2512      try {
2513        snmpAttrData = connector.get(
2514            SnmpIdentifiers.SNMP_ENABLEAUTHTRAPS_OID,
2515            new String JavaDoc (data.mgmtIpAddress),
2516            data.getSnmpPort(),
2517            READ_COMMUNITY);
2518      }
2519      catch (SnmpApplicationError e) {
2520
2521        ApplicationErrorInfoTypeImpl error_code =
2522            new ApplicationErrorInfoTypeImpl();
2523
2524        error_code.error = new UIDType(
2525            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2526            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2527
2528        if (e.reason.equals(ExceptionMessages.agent_response_error))
2529            error_code.details = ExceptionMessages.agent_response_error;
2530        else
2531            error_code.details = new String JavaDoc ("Could not retrieve snmpEnableAuthenTraps " +
2532                "for SnmpProtocolMonitor Object with name " + key + ":" +
2533                " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_ENABLEAUTHTRAPS_OID +
2534                " does not exist.");
2535
2536            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2537              (short) LogSeverity._Error,
2538              "SNMP Error getting snmpInPkts: " + e.reason);
2539
2540          throw new ApplicationError (error_code);
2541      }
2542
2543      org.omg.CORBA.Any JavaDoc value = snmpAttrData.value;
2544
2545      if (value.type().kind().value() != TCKind._tk_long) {
2546
2547        ApplicationErrorInfoTypeImpl error_code =
2548            new ApplicationErrorInfoTypeImpl();
2549
2550        error_code.error = new UIDType(
2551            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2552            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2553
2554        error_code.details = new String JavaDoc ("Could not retrieve snmpEnableAuthenTraps " +
2555            "for SnmpProtocolMonitor Object with name " + key + ":" +
2556            " Object with Snmp Object Identifier " + SnmpIdentifiers.SNMP_ENABLEAUTHTRAPS_OID +
2557            " is not of type integer, as expected.");
2558
2559        throw new ApplicationError (error_code);
2560      }
2561
2562      int snmpAttrValue = value.extract_long();
2563
2564      return snmpAttrValue;
2565    }
2566
2567    /**
2568     * Implementation of the ::coachEmsMib::SnmpProtocolMonitor_F::snmpEnableAuthenTrapsSet operation.
2569     */

2570    public void
2571    snmpEnableAuthenTrapsSet(org.omg.CosNaming.NameComponent JavaDoc[] name, int snmpEnableAuthenTraps)
2572    throws intt.itu.itut_x780.ApplicationError,
2573     ist.coach.coachEmsMib.NOsnmpEnableAuthenTrapsPackageException
2574    {
2575            String JavaDoc key = Utils.name2string(name);
2576
2577      if (this.elements.containsKey(key) == false) {
2578
2579          ApplicationErrorInfoTypeImpl error_code =
2580            new ApplicationErrorInfoTypeImpl();
2581
2582          error_code.error = new UIDType(
2583            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2584            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2585
2586          error_code.details = new String JavaDoc ("object with name" +
2587            key + " does not exist.");
2588
2589          throw new ApplicationError(error_code);
2590      }
2591
2592      if (!Utils.packageIsSupported(SNMP_AUTH_CONFIG_PACKAGE,
2593            packagesGet(name))) {
2594        System.out.println("Package " + SNMP_AUTH_CONFIG_PACKAGE +
2595            "is not supported by SnmpProtocolMonitor Object" + key);
2596
2597        throw new ist.coach.coachEmsMib.NOsnmpEnableAuthenTrapsPackageException();
2598      }
2599
2600      SnmpProtocolMonitorDataStructure data =
2601        (SnmpProtocolMonitorDataStructure) elements.get(key);
2602
2603      org.omg.CORBA.Any JavaDoc value = orb.create_any();
2604        value.insert_long(snmpEnableAuthenTraps);
2605
2606      DataTypeImpl snmpAttrData = new DataTypeImpl(
2607          SnmpIdentifiers.SNMP_ENABLEAUTHTRAPS_OID,
2608          value,
2609         SnmpSMI.SMI_INTEGER);
2610
2611      try {
2612
2613        this.connector.set(
2614            snmpAttrData,
2615            new String JavaDoc (data.mgmtIpAddress),
2616            data.getSnmpPort(),
2617            SnmpIdentifiers.WRITE_COMMUNITY);
2618        }
2619        catch (SnmpApplicationError e) {
2620
2621            ApplicationErrorInfoTypeImpl error_code =
2622            new ApplicationErrorInfoTypeImpl();
2623
2624          error_code.error = new UIDType(
2625            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2626            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2627
2628          if (e.reason.equals(ExceptionMessages.agent_response_error))
2629            error_code.details = ExceptionMessages.agent_response_error;
2630          else
2631            error_code.details = new String JavaDoc ("Could not set snmpEnableAuthenTraps " +
2632                 "for SnmpProtocolMonitor Object with name " + key + ".");
2633
2634        Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2635          (short) LogSeverity._Error,
2636          "SNMP Error setting the contact details: " + e.reason);
2637        throw new ApplicationError(error_code);
2638
2639    }
2640    Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2641            (short) LogSeverity._Info,
2642            "snmpEnableAuthenTraps set to " + snmpEnableAuthenTraps);
2643    }
2644
2645    /**
2646     * Implementation of the ::itut_x780::ManagedObject_F::nameGet operation.
2647     */

2648    public org.omg.CosNaming.NameComponent JavaDoc[]
2649    nameGet()
2650    {
2651        //
2652
// DONE : Implement
2653
//
2654
return Utils.string2name(_facade_name);
2655    }
2656
2657    /**
2658     * Implementation of the ::itut_x780::ManagedObject_F::objectClassGet operation.
2659     */

2660    public String JavaDoc
2661    objectClassGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2662    throws intt.itu.itut_x780.ApplicationError
2663    {
2664         //
2665
// DONE : implement
2666
//
2667
String JavaDoc key = Utils.name2string(name);
2668
2669        if (elements.containsKey(key) == false) {
2670            ApplicationErrorInfoTypeImpl error_code =
2671                new ApplicationErrorInfoTypeImpl();
2672
2673            error_code.error = new UIDType(
2674                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2675                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2676
2677            error_code.details = new String JavaDoc("object with name " +
2678                key + " does not exist.");
2679
2680            throw new ApplicationError(error_code);
2681        }
2682
2683        SnmpProtocolMonitorDataStructure data =
2684            (SnmpProtocolMonitorDataStructure) elements.get(key);
2685
2686        return data.objectclass;
2687
2688    }
2689
2690    /**
2691     * Implementation of the ::itut_x780::ManagedObject_F::attributesGet operation.
2692     */

2693    public intt.itu.itut_x780.ManagedObjectValueType
2694    attributesGet(org.omg.CosNaming.NameComponent JavaDoc[] name, intt.itu.itut_x780.StringSetTypeHolder attributeNames)
2695    throws intt.itu.itut_x780.ApplicationError
2696    {
2697        //
2698
// DONE : implement
2699
//
2700
String JavaDoc key = Utils.name2string(name);
2701
2702        if (elements.containsKey(key) == false) {
2703            ApplicationErrorInfoTypeImpl error_code =
2704                new ApplicationErrorInfoTypeImpl();
2705
2706            error_code.error = new UIDType(
2707                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2708                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2709
2710            error_code.details = new String JavaDoc("object with name " +
2711                key + " does not exist.");
2712
2713            throw new ApplicationError(error_code);
2714        }
2715
2716        SnmpProtocolMonitorDataStructure data =
2717            (SnmpProtocolMonitorDataStructure) elements.get(key);
2718
2719        SnmpProtocolMonitorValueTypeImpl snmpProtocolMonitorValueType =
2720            new SnmpProtocolMonitorValueTypeImpl(
2721                snmpInPktsGet(name),
2722                snmpOutPktsGet(name),
2723                snmpInBadVersionsGet(name),
2724                snmpInBadCommunityNamesGet(name),
2725                snmpInBadCommunityUsesGet(name),
2726                snmpInASNParseErrsGet(name),
2727                snmpInTooBigsGet(name),
2728                snmpInNoSuchNamesGet(name),
2729                snmpInBadValuesGet(name),
2730                snmpInReadOnlysGet(name),
2731                snmpInGenErrsGet(name),
2732                snmpInTotalReqVarsGet(name),
2733                snmpInTotalSetVarsGet(name),
2734                snmpInGetRequestsGet(name),
2735                snmpInGetNextsGet(name),
2736                snmpInSetRequestsGet(name),
2737                snmpInGetResponsesGet(name),
2738                snmpInTrapsGet(name),
2739                snmpOutTooBigsGet(name),
2740                snmpOutNoSuchNamesGet(name),
2741                snmpOutBadValuesGet(name),
2742                snmpOutGenErrsGet(name),
2743                snmpOutGetRequestsGet(name),
2744                snmpOutGetNextsGet(name),
2745                snmpOutSetRequestsGet(name),
2746                snmpOutGetResponsesGet(name),
2747                snmpOutTrapsGet(name),
2748                snmpEnableAuthenTrapsGet(name),
2749
2750                data.name,
2751                data.objectclass,
2752                data.packages,
2753                data.sourceIndicator,
2754                data.deletePolicy
2755            );
2756            Utils.pretty_log(logSupport, Utils.name2string(name), objectClassGet(name),
2757            (short) LogSeverity._Info,
2758            "attributesGet finished successfully");
2759            return snmpProtocolMonitorValueType;
2760    }
2761
2762    /**
2763     * Implementation of the ::itut_x780::ManagedObject_F::packagesGet operation.
2764     */

2765    public String JavaDoc[]
2766    packagesGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2767    throws intt.itu.itut_x780.ApplicationError
2768    {
2769        //
2770
// DONE : implement
2771
//
2772
String JavaDoc key = Utils.name2string(name);
2773
2774        if (elements.containsKey(key) == false) {
2775            ApplicationErrorInfoTypeImpl error_code =
2776                new ApplicationErrorInfoTypeImpl();
2777
2778            error_code.error = new UIDType(
2779                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2780                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2781
2782            error_code.details = new String JavaDoc("object with name " +
2783                key + " does not exist.");
2784
2785            throw new ApplicationError(error_code);
2786        }
2787
2788        SnmpProtocolMonitorDataStructure data =
2789            (SnmpProtocolMonitorDataStructure) elements.get(key);
2790
2791        return data.packages;
2792    }
2793
2794    /**
2795     * Implementation of the ::itut_x780::ManagedObject_F::creationSourceGet operation.
2796     */

2797    public intt.itu.itut_x780.SourceIndicatorType
2798    creationSourceGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2799    throws intt.itu.itut_x780.ApplicationError
2800    {
2801         //
2802
// DONE : implement
2803
//
2804
String JavaDoc key = Utils.name2string(name);
2805
2806        if (elements.containsKey(key) == false) {
2807            ApplicationErrorInfoTypeImpl error_code =
2808                new ApplicationErrorInfoTypeImpl();
2809
2810            error_code.error = new UIDType(
2811                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2812                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2813
2814            error_code.details = new String JavaDoc("object with name " +
2815                key + " does not exist.");
2816
2817            throw new ApplicationError(error_code);
2818        }
2819
2820        SnmpProtocolMonitorDataStructure data =
2821            (SnmpProtocolMonitorDataStructure) elements.get(key);
2822
2823        return data.sourceIndicator;
2824    }
2825
2826    /**
2827     * Implementation of the ::itut_x780::ManagedObject_F::deletePolicyGet operation.
2828     */

2829    public short
2830    deletePolicyGet(org.omg.CosNaming.NameComponent JavaDoc[] name)
2831    throws intt.itu.itut_x780.ApplicationError
2832    {
2833        //
2834
// DONE : implement
2835
//
2836
String JavaDoc key = Utils.name2string(name);
2837
2838        if (elements.containsKey(key) == false) {
2839            ApplicationErrorInfoTypeImpl error_code =
2840                new ApplicationErrorInfoTypeImpl();
2841
2842            error_code.error = new UIDType(
2843                intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2844                intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2845
2846            error_code.details = new String JavaDoc("object with name " +
2847                key + " does not exist.");
2848
2849            throw new ApplicationError(error_code);
2850        }
2851
2852        SnmpProtocolMonitorDataStructure data =
2853            (SnmpProtocolMonitorDataStructure) elements.get(key);
2854
2855        return data.deletePolicy;
2856    }
2857
2858    /**
2859     * Implementation of the ::itut_x780::ManagedObject_F::destroy operation.
2860     */

2861    public void
2862    destroy(org.omg.CosNaming.NameComponent JavaDoc[] name)
2863    throws intt.itu.itut_x780.ApplicationError,
2864
2865           intt.itu.itut_x780.DeleteError
2866    {
2867        //
2868
// DONE : implement
2869
//
2870

2871    if (!elements.containsKey(Utils.name2string(name))) {
2872
2873            ApplicationErrorInfoTypeImpl error_code =
2874            new ApplicationErrorInfoTypeImpl();
2875
2876            error_code.error = new UIDType(
2877            intt.itu.itut_x780.ApplicationErrorConst.moduleName.value,
2878            intt.itu.itut_x780.ApplicationErrorConst.invalidParameter.value);
2879
2880            error_code.details = new String JavaDoc ("object with name " +
2881            Utils.name2string(name) + " does not exist.");
2882
2883            throw new ApplicationError(error_code);
2884
2885    }
2886    SnmpProtocolMonitorDataStructure snmpProtocolMonitorData = null;
2887    synchronized(elements) {
2888        snmpProtocolMonitorData =
2889            (SnmpProtocolMonitorDataStructure) elements.remove(
2890            Utils.name2string(name));
2891    }
2892    org.omg.TimeBase.UtcT eventTime = new org.omg.TimeBase.UtcT(System.currentTimeMillis(),
2893        0, (short) 0, (short) 0);
2894    get_context().push_objectDeletion(new ObjectDeletionImpl(eventTime, name,
2895                        snmpProtocolMonitorData.objectclass,
2896                        getUniqueNotificationIdentifier(),
2897// ipProtocolMonitorData.getUniqueNotificationIdentifier(),
2898
snmpProtocolMonitorData.sourceIndicator,
2899                        new AttributeValueType[0]));
2900
2901        Utils.pretty_log(logSupport, Utils.name2string(name),
2902            snmpProtocolMonitorData.objectclass, //objectClassGet(name),
2903
(short) LogSeverity._Info,
2904          "successfully removed from management system");
2905
2906    }
2907
2908        protected static int getUniqueNotificationIdentifier() {
2909
2910        notifId++;
2911        return notifId;
2912    }
2913}
2914
Popular Tags