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

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

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

PDU.toErrorStatusText介绍

[英]Returns textual description for the supplied error status value.
[中]返回提供的错误状态值的文本描述。

代码示例

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

/**
 * Gets a textual description of the error status.
 *
 * @return a String containing an element of the
 * {@link SnmpConstants#SNMP_ERROR_MESSAGES} array for a valid error status.
 * "Unknown error: <errorStatusNumber>" is returned for any other value.
 */
public String getErrorStatusText() {
  return toErrorStatusText(errorStatus.getValue());
}

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

/**
 * Gets a textual description of the error status.
 * @return
 *    a String containing an element of the
 *    {@link SnmpConstants#SNMP_ERROR_MESSAGES} array for a valid error status.
 *    "Unknown error: <errorStatusNumber>" is returned for any other value.
 */
public String getErrorStatusText() {
 return toErrorStatusText(errorStatus.getValue());
}

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

/**
 * Gets a textual description of the error status.
 * @return
 *    a String containing an element of the
 *    {@link SnmpConstants#SNMP_ERROR_MESSAGES} array for a valid error status.
 *    "Unknown error: <errorStatusNumber>" is returned for any other value.
 */
public String getErrorStatusText() {
 return toErrorStatusText(errorStatus.getValue());
}

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

/**
 * Returns a textual error message for the error.
 * @return
 *    an error message or an empty string if no error occurred.
 */
public String getErrorMessage() {
 switch (status) {
  case STATUS_EXCEPTION: {
   return exception.getMessage();
  }
  case STATUS_REPORT: {
   return "Report: "+reportPDU.get(0);
  }
  case STATUS_TIMEOUT: {
   return "Request timed out.";
  }
  case STATUS_WRONG_ORDER: {
   return "Agent did not return variable bindings in lexicographic order.";
  }
  default: {
   return PDU.toErrorStatusText(status);
  }
 }
}

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

/**
 * Returns a textual error message for the error.
 * @return
 *    an error message or an empty string if no error occurred.
 */
public String getErrorMessage() {
 switch (status) {
  case STATUS_EXCEPTION: {
   return exception.getMessage();
  }
  case STATUS_REPORT: {
   return "Report: "+reportPDU.get(0);
  }
  case STATUS_TIMEOUT: {
   return "Request timed out.";
  }
  case STATUS_WRONG_ORDER: {
   return "Agent did not return variable bindings in lexicographic order.";
  }
  default: {
   return PDU.toErrorStatusText(status);
  }
 }
}

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

/**
 * Returns a textual error message for the error.
 * @return
 *    an error message or an empty string if no error occurred.
 */
public String getErrorMessage() {
 switch (status) {
  case STATUS_EXCEPTION: {
   return exception.getMessage();
  }
  case STATUS_REPORT: {
   return "Report: "+reportPDU.get(0);
  }
  case STATUS_TIMEOUT: {
   return "Request timed out.";
  }
  case STATUS_WRONG_ORDER: {
   return "Agent did not return variable bindings in lexicographic order.";
  }
  default: {
   return PDU.toErrorStatusText(status);
  }
 }
}

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

public void requestStatusChanged(RequestStatusEvent event) {
 int newStatus = event.getStatus().getErrorStatus();
 setErrorStatus(newStatus);
 if (logger.isDebugEnabled() &&
   (newStatus != SnmpConstants.SNMP_ERROR_SUCCESS)) {
  new Exception("Error '"+
         PDU.toErrorStatusText(event.getStatus().getErrorStatus())+
         "' generated at: "+vb).printStackTrace();
 }
}

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

public void requestStatusChanged(RequestStatusEvent event) {
 int newStatus = event.getStatus().getErrorStatus();
 setErrorStatus(newStatus);
 if (logger.isDebugEnabled() &&
   (newStatus != SnmpConstants.SNMP_ERROR_SUCCESS)) {
  new Exception("Error '"+
         PDU.toErrorStatusText(event.getStatus().getErrorStatus())+
         "' generated at: "+vb).printStackTrace();
 }
}

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

System.out.println(PDU.toErrorStatusText(respPDU.getErrorStatus()));

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

System.out.println(PDU.toErrorStatusText(respPDU.getErrorStatus()));

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

System.out.println(PDU.toErrorStatusText(respPDU.getErrorStatus()));

相关文章