org.snmp4j.PDU.getRequestID()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.snmp4j.PDU.getRequestID()方法的一些代码示例,展示了PDU.getRequestID()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PDU.getRequestID()方法的具体详情如下:
包路径:org.snmp4j.PDU
类名称:PDU
方法名:getRequestID

PDU.getRequestID介绍

[英]Gets the request ID associated with this PDU.
[中]获取与此PDU关联的请求ID。

代码示例

代码示例来源:origin: OpenNMS/opennms

@Override
protected Integer getRequestId() {
  return m_pdu.getRequestID().toInt();
}

代码示例来源:origin: org.opennms.core.snmp/org.opennms.core.snmp.implementations.snmp4j

@Override
protected Integer getRequestId() {
  return m_pdu.getRequestID().toInt();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * TODO: Merge this logic with {@link Snmp4JWalker.Snmp4JResponseListener} #processResponse(PDU response)
 */
private static SnmpValue[] processResponse(Snmp4JAgentConfig agentConfig, ResponseEvent responseEvent) throws IOException {
  SnmpValue[] retvalues = { null };
  if (responseEvent.getResponse() == null) {
    LOG.warn("processResponse: Timeout.  Agent: {}, requestID={}", agentConfig, responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getError() != null) {
    LOG.warn("processResponse: Error during get operation.  Error: {}, requestID={}", responseEvent.getError().getLocalizedMessage(), responseEvent.getError(), responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getResponse().getType() == PDU.REPORT) {
    LOG.warn("processResponse: Error during get operation.  Report returned with varbinds: {}, requestID={}", responseEvent.getResponse().getVariableBindings(), responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getResponse().getVariableBindings().size() < 1) {
    LOG.warn("processResponse: Received PDU with 0 varbinds. Agent: {}, requestID={}", agentConfig, responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getResponse().get(0).getSyntax() == SMIConstants.SYNTAX_NULL) {
    LOG.info("processResponse: Null value returned in varbind: {}. Agent: {}, requestID={}", responseEvent.getResponse().get(0), agentConfig, responseEvent.getRequest().getRequestID());
  } else {
    retvalues = convertResponseToValues(responseEvent);
    LOG.debug("processResponse: SNMP operation successful, value: {}", (Object)retvalues);
  }
  return retvalues;
}

代码示例来源:origin: org.opennms.core.snmp/org.opennms.core.snmp.implementations.snmp4j

/**
 * TODO: Merge this logic with {@link Snmp4JWalker.Snmp4JResponseListener} #processResponse(PDU response)
 */
private static SnmpValue[] processResponse(Snmp4JAgentConfig agentConfig, ResponseEvent responseEvent) throws IOException {
  SnmpValue[] retvalues = { null };
  if (responseEvent.getResponse() == null) {
    LOG.warn("processResponse: Timeout.  Agent: {}, requestID={}", agentConfig, responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getError() != null) {
    LOG.warn("processResponse: Error during get operation.  Error: {}, requestID={}", responseEvent.getError().getLocalizedMessage(), responseEvent.getError(), responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getResponse().getType() == PDU.REPORT) {
    LOG.warn("processResponse: Error during get operation.  Report returned with varbinds: {}, requestID={}", responseEvent.getResponse().getVariableBindings(), responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getResponse().getVariableBindings().size() < 1) {
    LOG.warn("processResponse: Received PDU with 0 varbinds. Agent: {}, requestID={}", agentConfig, responseEvent.getRequest().getRequestID());
  } else if (responseEvent.getResponse().get(0).getSyntax() == SMIConstants.SYNTAX_NULL) {
    LOG.info("processResponse: Null value returned in varbind: {}. Agent: {}, requestID={}", responseEvent.getResponse().get(0), agentConfig, responseEvent.getRequest().getRequestID());
  } else {
    retvalues = convertResponseToValues(responseEvent);
    LOG.debug("processResponse: SNMP operation successful, value: {}", (Object)retvalues);
  }
  return retvalues;
}

代码示例来源:origin: org.kaazing/snmp4j-agent

private PDU createResponse() {
 PDU resp = (PDU) requestEvent.getPDU().clone();
 resp.clear();
 resp.setType(PDU.RESPONSE);
 resp.setRequestID(requestEvent.getPDU().getRequestID());
 resp.setErrorIndex(0);
 resp.setErrorStatus(PDU.noError);
 return resp;
}

代码示例来源:origin: org.snmp4j/snmp4j-agent

private PDU createResponse() {
 PDU resp = (PDU) source.getPDU().clone();
 resp.clear();
 resp.setType(PDU.RESPONSE);
 resp.setRequestID(source.getPDU().getRequestID());
 resp.setErrorIndex(0);
 resp.setErrorStatus(PDU.noError);
 return resp;
}

代码示例来源:origin: org.jboss.jbossas/jboss-snmp

response.setRequestID(event.getPDU().getRequestID());
try {
  sendResponse(event, response);

代码示例来源:origin: org.mobicents.tools.snmp.adaptor/core

response.setRequestID(event.getPDU().getRequestID());
try {
  sendResponse(event, response);

代码示例来源:origin: OpenNMS/opennms

ref,
                        statusInformation);
  LOG.debug("Sent RESPONSE PDU to peer {} acknowledging receipt of INFORM (reqId={})", addr, command.getRequestID());
} catch (MessageException ex) {
  LOG.error("Error while sending RESPONSE PDU to peer {}: {} acknowledging receipt of INFORM (reqId={})", addr, ex.getMessage(), command.getRequestID());
} finally {

代码示例来源:origin: org.opennms.core.snmp/org.opennms.core.snmp.implementations.snmp4j

ref,
                        statusInformation);
  LOG.debug("Sent RESPONSE PDU to peer {} acknowledging receipt of INFORM (reqId={})", addr, command.getRequestID());
} catch (MessageException ex) {
  LOG.error("Error while sending RESPONSE PDU to peer {}: {} acknowledging receipt of INFORM (reqId={})", addr, ex.getMessage(), command.getRequestID());
} finally {

代码示例来源:origin: org.opennms.lib.snmp/org.opennms.lib.snmp.snmp4j

statusInformation);
if (log().isDebugEnabled()) {
  log().debug("Sent RESPONSE PDU to peer " + addr + " acknowledging receipt of INFORM (reqId=" + command.getRequestID() + ")");
log().error("Error while sending RESPONSE PDU to peer " + addr + ": " + ex.getMessage() + "acknowledging receipt of INFORM (reqId=" + command.getRequestID() + ")");

代码示例来源:origin: org.snmp4j/snmp4j-agent

request.getCommandEvent().getPDU().getRequestID());
if ((translatedResponse instanceof ScopedPDU) &&
    (request.getCommandEvent().getPDU() instanceof ScopedPDU)) {

代码示例来源:origin: org.kaazing/snmp4j

v2cPDU);
sendPduHandle.setTransactionID(v2cPDU.getRequestID().getValue());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

v2cPDU);
sendPduHandle.setTransactionID(v2cPDU.getRequestID().getValue());

代码示例来源:origin: org.snmp4j/snmp4j

v1PDU);
sendPduHandle.setTransactionID(v1PDU.getRequestID().getValue());

代码示例来源:origin: org.snmp4j/snmp4j

v2cPDU);
sendPduHandle.setTransactionID(v2cPDU.getRequestID().getValue());

代码示例来源:origin: org.kaazing/snmp4j

v1PDU);
sendPduHandle.setTransactionID(v1PDU.getRequestID().getValue());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

v1PDU);
sendPduHandle.setTransactionID(v1PDU.getRequestID().getValue());

代码示例来源:origin: org.snmp4j/snmp4j-agent

response.setRequestID(requestEvent.getPDU().getRequestID());
response.setErrorStatus(PDU.tooBig);

代码示例来源:origin: org.kaazing/snmp4j-agent

response.setRequestID(requestEvent.getPDU().getRequestID());
response.setErrorStatus(PDU.tooBig);

相关文章