Java Code Examples for com.sun.jmx.snmp.SnmpVarBind#noSuchObject()

The following examples show how to use com.sun.jmx.snmp.SnmpVarBind#noSuchObject() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SnmpRequestHandler.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 2
Source File: SnmpRequestHandler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 3
Source File: SnmpRequestHandler.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 4
Source File: SnmpRequestHandler.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 5
Source File: SnmpRequestHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 6
Source File: SnmpRequestHandler.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 7
Source File: SnmpRequestHandler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 8
Source File: SnmpRequestHandler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 9
Source File: SnmpRequestHandler.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
SnmpPduPacket makeErrorVarbindPdu(SnmpPduPacket req, int statusTag) {

        final SnmpVarBind[] vblist = req.varBindList;
        final int length = vblist.length;

        switch (statusTag) {
        case SnmpDataTypeEnums.errEndOfMibViewTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.endOfMibView;
            break;
        case SnmpDataTypeEnums.errNoSuchObjectTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchObject;
            break;
        case SnmpDataTypeEnums.errNoSuchInstanceTag:
            for (int i=0 ; i<length ; i++)
                vblist[i].value = SnmpVarBind.noSuchInstance;
            break;
        default:
            return newErrorResponsePdu(req,snmpRspGenErr,1);
        }
        return newValidResponsePdu(req,vblist);
    }
 
Example 10
Source File: SnmpRequestTree.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 11
Source File: SnmpRequestTree.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 12
Source File: SnmpRequestTree.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 13
Source File: SnmpRequestTree.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 14
Source File: SnmpRequestTree.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 15
Source File: SnmpRequestTree.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 16
Source File: SnmpRequestTree.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 17
Source File: SnmpRequestTree.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 18
Source File: SnmpRequestTree.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 19
Source File: SnmpRequestTree.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}
 
Example 20
Source File: SnmpRequestTree.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
@Override
public void registerGetException(SnmpVarBind var,
                                 SnmpStatusException exception)
    throws SnmpStatusException {
    // The index in the exception must correspond to
    // the SNMP index ...
    //
    if (version == SnmpDefinitions.snmpVersionOne)
        throw new SnmpStatusException(exception, getVarIndex(var)+1);

    if (var == null)
        throw exception;

    // If we're doing a getnext ==> endOfMibView
    if (getnextflag) {
        var.value = SnmpVarBind.endOfMibView;
        return;
    }

    final int errorCode = mapGetException(exception.getStatus(),
                                          version);

    // Now take care of V2 errorCodes that can be stored
    // in the varbind itself:
    if (errorCode ==
        SnmpStatusException.noSuchObject)
        // noSuchObject => noSuchObject
        var.value= SnmpVarBind.noSuchObject;

    else if (errorCode ==
             SnmpStatusException.noSuchInstance)
        // noSuchInstance => noSuchInstance
        var.value= SnmpVarBind.noSuchInstance;

    else
        throw new SnmpStatusException(errorCode, getVarIndex(var)+1);

}