当前位置: 首页>>代码示例>>Java>>正文


Java SnmpVarBind.endOfMibView方法代码示例

本文整理汇总了Java中com.sun.jmx.snmp.SnmpVarBind.endOfMibView方法的典型用法代码示例。如果您正苦于以下问题:Java SnmpVarBind.endOfMibView方法的具体用法?Java SnmpVarBind.endOfMibView怎么用?Java SnmpVarBind.endOfMibView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jmx.snmp.SnmpVarBind的用法示例。


在下文中一共展示了SnmpVarBind.endOfMibView方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeErrorVarbindPdu

import com.sun.jmx.snmp.SnmpVarBind; //导入方法依赖的package包/类
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);
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:SnmpRequestHandler.java

示例2: mergeBulkResponses

import com.sun.jmx.snmp.SnmpVarBind; //导入方法依赖的package包/类
private SnmpVarBind[] mergeBulkResponses(int size) {
    // Let's allocate the array for storing the result
    //
    SnmpVarBind[] result= new SnmpVarBind[size];
    for(int i= size-1; i >=0; --i) {
        result[i]= new SnmpVarBind();
        result[i].value= SnmpVarBind.endOfMibView;
    }

    // Go through the list of subrequests and concatenate.
    // Hopefully, by now all the sub-requests should be finished
    //
    for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
        SnmpSubRequestHandler sub= e.nextElement();
        sub.updateResult(result);
    }

    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:SnmpRequestHandler.java

示例3: registerGetException

import com.sun.jmx.snmp.SnmpVarBind; //导入方法依赖的package包/类
@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);

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:SnmpRequestTree.java

示例4: mergeNextResponses

import com.sun.jmx.snmp.SnmpVarBind; //导入方法依赖的package包/类
private SnmpPduPacket mergeNextResponses(SnmpPduRequest req) {
    int max= req.varBindList.length;
    SnmpVarBind[] result= new SnmpVarBind[max];

    // Go through the list of subrequests and concatenate.
    // Hopefully, by now all the sub-requests should be finished
    //
    for(Enumeration<SnmpSubRequestHandler> e= subs.elements(); e.hasMoreElements();) {
        SnmpSubRequestHandler sub= e.nextElement();
        sub.updateResult(result);
    }

    if (req.version == snmpVersionTwo) {
        return newValidResponsePdu(req,result);
    }

    // In v1 make sure there is no endOfMibView ...
    //
    for(int i=0; i < max; i++) {
        SnmpValue val= result[i].value;
        if (val == SnmpVarBind.endOfMibView)
            return newErrorResponsePdu(req,
                               SnmpDefinitions.snmpRspNoSuchName, i+1);
    }

    // So far so good ...
    //
    return newValidResponsePdu(req,result);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:SnmpRequestHandler.java


注:本文中的com.sun.jmx.snmp.SnmpVarBind.endOfMibView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。