本文整理汇总了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 ;
}
示例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 ;
}
示例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);
}
}
}
示例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);
}
}
}