Package net.percederberg.mibble

Examples of net.percederberg.mibble.MibSymbol


     *             initialization
     */
    public MibValue initialize(MibLoaderLog log, MibType type)
        throws MibException {

        MibSymbol  sym;
        MibValue   value;
        String     message;

        sym = getSymbol(log);
        if (sym instanceof MibValueSymbol) {
View Full Code Here


     * @param log            the optional loader log
     *
     * @return the referenced symbol
     */
    private MibSymbol getSymbol(MibLoaderLog log) {
        MibSymbol  sym;
        String     message;

        sym = context.findSymbol(name, false);
        if (sym == null) {
            sym = context.findSymbol(name, true);
            if (sym != null && log != null) {
                message = "missing import for '" + name + "', using " +
                          "definition from " + sym.getMib().getName();
                log.addWarning(location, message);
            }
        }
        return sym;
    }
View Full Code Here

                              ElementType element,
                              int pos)
        throws MibException {

        Mib                    mib = symbol.getMib();
        MibSymbol              elementSymbol;
        String                 name;
        MibType                type;
        ObjectIdentifierValue  value;

        elementSymbol = mib.getSymbol(element.getName());
        if (elementSymbol == null) {
            if (element.getName() != null) {
                name = pos + " '" + element.getName() + "'";
            } else {
                name = String.valueOf(pos);
            }
            log.addWarning(symbol.getLocation(),
                           "sequence element " + name + " is undefined " +
                           "in MIB, a default symbol will be created");
            name = element.getName();
            if (name == null) {
                name = symbol.getName() + "." + pos;
            }
            type = new SnmpObjectType(element.getType(),
                                      null,
                                      SnmpAccess.READ_ONLY,
                                      SnmpStatus.CURRENT,
                                      "AUTOMATICALLY CREATED SYMBOL",
                                      null,
                                      new ArrayList(),
                                      null);
            value = (ObjectIdentifierValue) symbol.getValue();
            value = new ObjectIdentifierValue(symbol.getLocation(),
                                              value,
                                              element.getName(),
                                              pos);
            elementSymbol = new MibValueSymbol(symbol.getLocation(),
                                               mib,
                                               name,
                                               type,
                                               value);
            elementSymbol.initialize(log);
        } else if (elementSymbol instanceof MibTypeSymbol) {
            if (element.getName() != null) {
                name = pos + " '" + element.getName() + "'";
            } else {
                name = String.valueOf(pos);
View Full Code Here

     *
     * @param mib            the MIB to add
     */
    public void addMib(Mib mib) {
        Iterator   iter = mib.getAllSymbols().iterator();
        MibSymbol  symbol;
        MibNode    root;
        MibNode    node;
        JTree      valueTree;

        // Create value sub tree
View Full Code Here

     * @since 2.2
     */
    public MibType initialize(MibSymbol symbol, MibLoaderLog log)
        throws MibException {

        MibSymbol  sym;
        String     message;

        sym = getSymbol(log);
        if (sym instanceof MibTypeSymbol) {
            type = initializeReference(symbol, log, (MibTypeSymbol) sym);
            if (type == null) {
                message = "referenced symbol '" + sym.getName() +
                          "' contains undefined type";
                throw new MibException(location, message);
            }
            return type;
        } else if (sym == null) {
View Full Code Here

     * @param log            the optional loader log
     *
     * @return the referenced symbol
     */
    private MibSymbol getSymbol(MibLoaderLog log) {
        MibSymbol  sym;
        String     message;

        sym = context.findSymbol(name, false);
        if (sym == null) {
            sym = context.findSymbol(name, true);
            if (sym != null && log != null) {
                message = "missing import for '" + name + "', using " +
                          "definition from " + sym.getMib().getName();
                log.addWarning(location, message);
            }
        }
        return sym;
    }
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.MibSymbol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.