Package net.percederberg.mibble

Examples of net.percederberg.mibble.MibType


     *             value didn't match the type
     */
    private AsnObject createAsnValue(SnmpRequest request)
        throws SnmpException {

        MibType  type = request.getType();
        String   value = request.getValue();

        if (type.hasTag(MibTypeTag.UNIVERSAL_CATEGORY, 2)) {
            // INTEGER & Integer32
            return new AsnInteger(parseInteger(value));
        } else if (type.hasTag(MibTypeTag.UNIVERSAL_CATEGORY, 4)) {
            // OCTET STRING
            return new AsnOctets(value);
        } else if (type.hasTag(MibTypeTag.UNIVERSAL_CATEGORY, 6)) {
            // OBJECT IDENTIFIER
            return new AsnObjectId(value);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 0)) {
            // IPAddress
            return new AsnOctets(parseInetAddress(value));
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 1)) {
            // Counter
            return new AsnUnsInteger(parseInteger(value),
                                     SnmpConstants.COUNTER);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 2)) {
            // Gauge
            return new AsnUnsInteger(parseInteger(value),
                                     SnmpConstants.GAUGE);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 3)) {
            // TimeTicks
            return new AsnUnsInteger(parseInteger(value),
                                     SnmpConstants.TIMETICKS);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 4)) {
            // Opaque
            return new AsnOctets(value);
        } else if (type.hasTag(MibTypeTag.APPLICATION_CATEGORY, 6)) {
            // Counter64
            return new AsnUnsInteger64(parseLong(value));
        } else {
            throw new SnmpException("Unsupported MIB type: " + type);
        }
View Full Code Here


     * @throws MibException if an error was encountered during the
     *             initialization
     */
    void initialize(MibLoaderLog log) throws MibException {
        ArrayList  list = new ArrayList();
        MibType    type = null;

        value = value.initialize(log, null);
        if (getBaseSymbol() != null) {
            // TODO: use utility function to retrieve correct base type here
            type = getBaseSymbol().getType();
View Full Code Here

        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) {
View Full Code Here

     * Returns the tool tip text for this node.
     *
     * @return the tool tip text for this node.
     */
    public String getToolTipText() {
        MibType  type;
        String   str;

        if (value != null  && value.getSymbol() != null) {
            type = value.getSymbol().getType();
            if (type instanceof SnmpType) {
View Full Code Here

    private MibType initializeReference(MibSymbol symbol,
                                        MibLoaderLog log,
                                        MibTypeSymbol ref)
        throws MibException {

        MibType  type = ref.getType();

        if (type != null) {
            type = type.initialize(symbol, log);
        }
        if (type == null) {
            return null;
        }
        try {
            if (constraint != null) {
                type = type.createReference(constraint);
            } else if (values != null) {
                type = type.createReference(values);
            } else {
                type = type.createReference();
            }
            type = type.initialize(symbol, log);
        } catch (UnsupportedOperationException e) {
            throw new MibException(location, e.getMessage());
        }
        type.setReferenceSymbol(ref);
        initializeTypeTag(type, tag);
        return type;
    }
View Full Code Here

TOP

Related Classes of net.percederberg.mibble.MibType

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.