01: /*_############################################################################
02: _##
03: _## SNMP4J-Agent - TextualConvention.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
06: _##
07: _## Licensed under the Apache License, Version 2.0 (the "License");
08: _## you may not use this file except in compliance with the License.
09: _## 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.tc;
22:
23: import org.snmp4j.smi.OID;
24: import org.snmp4j.agent.MOAccess;
25: import org.snmp4j.smi.Variable;
26: import org.snmp4j.agent.mo.MOScalar;
27: import org.snmp4j.agent.mo.MOColumn;
28:
29: /**
30: * The <code>TextualConvention</code> interface defines the common properties
31: * of SMI textual conventions needed to use them across different MIB modules
32: * within an agent implementation.
33: * <p>
34: * A textual convention is characterized by its name and the MIB module name
35: * where it has been defined. With these attributes a TC registry is able to
36: * lookup TC implementations by name.
37: * <p>
38: * A <code>MOFactory</code> can then use a TC name to lookup its implementation
39: * and then use one of the two factory methods of each TC to create either
40: * a scalar or columnar <code>ManagedObject</code> instance.
41: * <p>
42: * If you need to use your own TC implementations (either replacing/extending
43: * already provided ones or adding new ones) then register them to the
44: * <code>MOFactory</code> you are using.
45: *
46: * @author Frank Fock
47: * @version 1.0
48: */
49: public interface TextualConvention {
50:
51: /**
52: * Returns the MIB module name that defined this textual convention.
53: * @return
54: * an unique module name
55: */
56: String getModuleName();
57:
58: /**
59: * Returns the name of the textual convention as defined in the MIB module.
60: * @return
61: * the unique name (within the MIB module) of the TC.
62: */
63: String getName();
64:
65: /**
66: * Creates a MOScalar instance of this TC specified by OID, access, and value.
67: * @param oid
68: * the OID of the scalar isntance.
69: * @param access
70: * the access definition.
71: * @param value
72: * the <code>Variable</code> instance containing the value of the
73: * scalar.
74: * @return
75: * a MOScalar instance.
76: */
77: MOScalar createScalar(OID oid, MOAccess access, Variable value);
78:
79: /**
80: * Creates a MOColumn instance of this TC specified by the column ID,
81: * access, default value, and mutable flag.
82: * @param columnID
83: * the column id as defined in the MIB module (typically starting at one).
84: * @param access
85: * the access definition.
86: * @param defaultValue
87: * the default value or <code>null</code> if there is no DEFVAL clause for
88: * this column.
89: * @param mutableInService
90: * <code>true</code> if this column may be modified while row is in
91: * service.
92: * @return
93: * the MOColumn created.
94: */
95: MOColumn createColumn(int columnID, int syntax, MOAccess access,
96: Variable defaultValue, boolean mutableInService);
97: }
|