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


Java SnmpDefinitions.pduGetRequestPdu方法代码示例

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


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

示例1: checkPduType

import com.sun.jmx.snmp.SnmpDefinitions; //导入方法依赖的package包/类
/**
 * Check the type of the pdu: only the get/set/bulk request
 * are accepted.
 */
private boolean checkPduType(SnmpPduPacket pdu) {

    boolean result;

    switch(pdu.type) {

    case SnmpDefinitions.pduGetRequestPdu:
    case SnmpDefinitions.pduGetNextRequestPdu:
    case SnmpDefinitions.pduSetRequestPdu:
    case SnmpDefinitions.pduGetBulkRequestPdu:
        result = true ;
        break;

    default:
        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
               "checkPduType", "cannot respond to this kind of PDU");
        }
        result = false ;
        break;
    }

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

示例2: checkPduType

import com.sun.jmx.snmp.SnmpDefinitions; //导入方法依赖的package包/类
/**
 * Check the type of the pdu: only the get/set/bulk request
 * are accepted.
 */
private boolean checkPduType(SnmpPduPacket pdu) {

    boolean result = true ;

    switch(pdu.type) {

    case SnmpDefinitions.pduGetRequestPdu:
    case SnmpDefinitions.pduGetNextRequestPdu:
    case SnmpDefinitions.pduSetRequestPdu:
    case SnmpDefinitions.pduGetBulkRequestPdu:
        result = true ;
        break;

    default:
        if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
            SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
               "checkPduType", "cannot respond to this kind of PDU");
        }
        result = false ;
        break;
    }

    return result ;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:29,代码来源:SnmpRequestHandler.java

示例3: get

import com.sun.jmx.snmp.SnmpDefinitions; //导入方法依赖的package包/类
/**
 * Processes a <CODE>get</CODE> operation.
 *
 **/
// Implements the method defined in SnmpMibAgent. See SnmpMibAgent
// for java-doc
//
@Override
public void get(SnmpMibRequest req) throws SnmpStatusException {

    // Builds the request tree: creation is not allowed, operation
    // is not atomic.

    final int reqType = SnmpDefinitions.pduGetRequestPdu;
    SnmpRequestTree handlers = getHandlers(req,false,false,reqType);

    SnmpRequestTree.Handler h = null;
    SnmpMibNode meta = null;

    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
                "get", "Processing handlers for GET... ");
    }

    // For each sub-request stored in the request-tree, invoke the
    // get() method.
    for (Enumeration<SnmpRequestTree.Handler> eh=handlers.getHandlers();eh.hasMoreElements();) {
        h = eh.nextElement();

        // Gets the Meta node. It can be either a Group Meta or a
        // Table Meta.
        //
        meta = handlers.getMetaNode(h);

        // Gets the depth of the Meta node in the OID tree
        final int depth = handlers.getOidDepth(h);

        for (Enumeration<SnmpMibSubRequest> rqs=handlers.getSubRequests(h);
             rqs.hasMoreElements();) {

            // Invoke the get() operation.
            meta.get(rqs.nextElement(),depth);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:SnmpMib.java

示例4: get

import com.sun.jmx.snmp.SnmpDefinitions; //导入方法依赖的package包/类
/**
 * Processes a <CODE>get</CODE> operation.
 *
 **/
// Implements the method defined in SnmpMibAgent. See SnmpMibAgent
// for java-doc
//
public void get(SnmpMibRequest req) throws SnmpStatusException {

    // Builds the request tree: creation is not allowed, operation
    // is not atomic.

    final int reqType = SnmpDefinitions.pduGetRequestPdu;
    SnmpRequestTree handlers = getHandlers(req,false,false,reqType);

    SnmpRequestTree.Handler h = null;
    SnmpMibNode meta = null;

    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpMib.class.getName(),
                "get", "Processing handlers for GET... ");
    }

    // For each sub-request stored in the request-tree, invoke the
    // get() method.
    for (Enumeration eh=handlers.getHandlers();eh.hasMoreElements();) {
        h = (SnmpRequestTree.Handler) eh.nextElement();

        // Gets the Meta node. It can be either a Group Meta or a
        // Table Meta.
        //
        meta = handlers.getMetaNode(h);

        // Gets the depth of the Meta node in the OID tree
        final int depth = handlers.getOidDepth(h);

        for (Enumeration rqs=handlers.getSubRequests(h);
             rqs.hasMoreElements();) {

            // Invoke the get() operation.
            meta.get((SnmpMibSubRequest)rqs.nextElement(),depth);
        }
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:45,代码来源:SnmpMib.java


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