org.snmp4j.Snmp.getMPv3()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(119)

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

Snmp.getMPv3介绍

暂无

代码示例

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

/**
 * Gets the local engine ID if the MPv3 is available, otherwise a runtime
 * exception is thrown.
 *
 * @return byte[]
 * the local engine ID.
 */
@Override
public byte[] getLocalEngineID() {
  return getMPv3().getLocalEngineID();
}

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

/**
 * Gets the local engine ID if the MPv3 is available, otherwise a runtime
 * exception is thrown.
 * @return byte[]
 *    the local engine ID.
 */
public byte[] getLocalEngineID() {
 return getMPv3().getLocalEngineID();
}

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

/**
 * Gets the local engine ID if the MPv3 is available, otherwise a runtime
 * exception is thrown.
 * @return byte[]
 *    the local engine ID.
 */
public byte[] getLocalEngineID() {
 return getMPv3().getLocalEngineID();
}

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

/**
 * Sets the local engine ID for the SNMP entity represented by this
 * <code>Snmp</code> instance. This is a convenience method that sets
 * the local engine ID in the associated <code>MPv3</code> and
 * <code>USM</code>.
 * @param engineID
 *    a byte array containing the local engine ID. The length and content
 *    has to comply with the constraints defined in the SNMP-FRAMEWORK-MIB.
 * @param engineBoots
 *    the number of boots of this SNMP engine (zero based).
 * @param engineTime
 *    the number of seconds since the value of engineBoots last changed.
 * @see MPv3
 * @see USM
 */
public void setLocalEngine(byte[] engineID,
              int engineBoots,
              int engineTime) {
 MPv3 mpv3 = getMPv3();
 mpv3.setLocalEngineID(engineID);
 USM usm = (USM) mpv3.getSecurityModel(SecurityModel.SECURITY_MODEL_USM);
 usm.setLocalEngine(new OctetString(engineID), engineBoots, engineTime);
}

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

/**
 * Sets the local engine ID for the SNMP entity represented by this
 * <code>Snmp</code> instance. This is a convenience method that sets
 * the local engine ID in the associated <code>MPv3</code> and
 * <code>USM</code>.
 *
 * @param engineID
 *         a byte array containing the local engine ID. The length and content
 *         has to comply with the constraints defined in the SNMP-FRAMEWORK-MIB.
 * @param engineBoots
 *         the number of boots of this SNMP engine (zero based).
 * @param engineTime
 *         the number of seconds since the value of engineBoots last changed.
 *
 * @see MPv3
 * @see USM
 */
@Override
public void setLocalEngine(byte[] engineID,
              int engineBoots,
              int engineTime) {
  MPv3 mpv3 = getMPv3();
  mpv3.setLocalEngineID(engineID);
  mpv3.setCurrentMsgID(MPv3.randomMsgID(engineBoots));
  USM usm = (USM) mpv3.getSecurityModel(SecurityModel.SECURITY_MODEL_USM);
  if (usm != null) {
    usm.setLocalEngine(new OctetString(engineID), engineBoots, engineTime);
  }
}

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

/**
 * Sets the local engine ID for the SNMP entity represented by this
 * <code>Snmp</code> instance. This is a convenience method that sets
 * the local engine ID in the associated <code>MPv3</code> and
 * <code>USM</code>.
 * @param engineID
 *    a byte array containing the local engine ID. The length and content
 *    has to comply with the constraints defined in the SNMP-FRAMEWORK-MIB.
 * @param engineBoots
 *    the number of boots of this SNMP engine (zero based).
 * @param engineTime
 *    the number of seconds since the value of engineBoots last changed.
 * @see MPv3
 * @see USM
 */
public void setLocalEngine(byte[] engineID,
              int engineBoots,
              int engineTime) {
 MPv3 mpv3 = getMPv3();
 mpv3.setLocalEngineID(engineID);
 mpv3.setCurrentMsgID(MPv3.randomMsgID(engineBoots));
 USM usm = (USM) mpv3.getSecurityModel(SecurityModel.SECURITY_MODEL_USM);
 usm.setLocalEngine(new OctetString(engineID), engineBoots, engineTime);
}

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

MPv3 mpv3 = getMPv3();

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

MPv3 mpv3 = getMPv3();

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

MPv3 mpv3 = getMPv3();

相关文章