KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > mo > snmp > SNMPv2TC


1 /*_############################################################################
2   _##
3   _## SNMP4J-Agent - SNMPv2TC.java
4   _##
5   _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
6   _##
7   _## Licensed under the Apache License, Version 2.0 (the "License");
8   _## you may not use this file except in compliance with the License.
9   _## You may obtain a copy of the License at
10   _##
11   _## http://www.apache.org/licenses/LICENSE-2.0
12   _##
13   _## Unless required by applicable law or agreed to in writing, software
14   _## distributed under the License is distributed on an "AS IS" BASIS,
15   _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   _## See the License for the specific language governing permissions and
17   _## limitations under the License.
18   _##
19   _##########################################################################*/

20
21 package org.snmp4j.agent.mo.snmp;
22
23 import java.util.Map JavaDoc;
24 import java.util.HashMap JavaDoc;
25 import java.util.Collection JavaDoc;
26 import org.snmp4j.agent.mo.snmp.tc.TCModule;
27 import org.snmp4j.agent.mo.snmp.tc.TextualConvention;
28 import org.snmp4j.agent.mo.snmp.tc.DateAndTimeTC;
29 import org.snmp4j.agent.mo.snmp.tc.TimeStampTC;
30 import org.snmp4j.agent.mo.snmp.tc.StorageTypeTC;
31 import org.snmp4j.agent.mo.snmp.tc.RowStatusTC;
32 import org.snmp4j.agent.mo.snmp.tc.DisplayStringTC;
33 import org.snmp4j.agent.mo.snmp.tc.TruthValueTC;
34 import org.snmp4j.agent.mo.snmp.tc.TestAndIncrTC;
35
36 public final class SNMPv2TC implements TCModule {
37
38   public static final String JavaDoc MODULE_NAME = "SNMPv2-TC";
39
40   public static final String JavaDoc AUTONOMOUSTYPE = "AutonomousType";
41   public static final String JavaDoc TIMESTAMP = "TimeStamp";
42   public static final String JavaDoc DISPLAYSTRING = "DisplayString";
43   public static final String JavaDoc STORAGETYPE = "StorageType";
44   public static final String JavaDoc DATEANDTIME = "DateAndTime";
45   public static final String JavaDoc ROWSTATUS = "RowStatus";
46   public static final String JavaDoc TRUTHVALUE = "TruthValue";
47   public static final String JavaDoc TESTANDINCR = "TestAndIncr";
48
49   private static Object JavaDoc[][] tcMapping = {
50       { DATEANDTIME, new DateAndTimeTC() },
51       { TIMESTAMP, new TimeStampTC() },
52       { STORAGETYPE, new StorageTypeTC() },
53       { DISPLAYSTRING, new DisplayStringTC() },
54       { ROWSTATUS, new RowStatusTC() },
55       { TRUTHVALUE, new TruthValueTC() },
56       { TESTANDINCR, new TestAndIncrTC() }
57   };
58
59   private static Map JavaDoc textualConventions = new HashMap JavaDoc(tcMapping.length);
60
61   static {
62     for (int i=0; i<tcMapping.length; i++) {
63       textualConventions.put(tcMapping[i][0], tcMapping[i][1]);
64     }
65   }
66
67   public SNMPv2TC() {
68   }
69
70   public final String JavaDoc getName() {
71     return MODULE_NAME;
72   }
73
74   public TextualConvention getTextualConvention(String JavaDoc name) {
75     return (TextualConvention) textualConventions.get(name);
76   }
77
78   public Collection JavaDoc getTextualConventions() {
79     return textualConventions.values();
80   }
81 }
82
Popular Tags