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


Java VariableBinding.getVariable方法代码示例

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


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

示例1: processResponse

import org.snmp4j.smi.VariableBinding; //导入方法依赖的package包/类
private void processResponse(PDU response) {
    try {
        if (log().isDebugEnabled()) {
            log().debug("Received a tracker PDU of type "+PDU.getTypeString(response.getType())+" from "+getAddress()+" of size "+response.size()+", errorStatus = "+response.getErrorStatus()+", errorStatusText = "+response.getErrorStatusText()+", errorIndex = "+response.getErrorIndex());
        }
        if (response.getType() == PDU.REPORT) {
            handleAuthError("A REPORT PDU was returned from the agent.  This is most likely an authentication problem.  Please check the config");
        } else {
            if (!processErrors(response.getErrorStatus(), response.getErrorIndex())) {
                if (response.size() == 0) { // NMS-6484
                    handleError("A PDU with no errors and 0 varbinds was returned from the agent at " + getAddress() + ". This seems to be related with a broken SNMP agent.");
                } else {
                    for (int i = 0; i < response.size(); i++) {
                        VariableBinding vb = response.get(i);
                        SnmpObjId receivedOid = SnmpObjId.get(vb.getOid().getValue());
                        SnmpValue val = new Snmp4JValue(vb.getVariable());
                        Snmp4JWalker.this.processResponse(receivedOid, val);
                    }
                }
            }
            buildAndSendNextPdu();
        }
    } catch (Throwable e) {
        handleFatalError(e);
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:27,代码来源:Snmp4JWalker.java

示例2: splitBody

import org.snmp4j.smi.VariableBinding; //导入方法依赖的package包/类
/**
   * The split body method returns something that is iteratable such as a java.util.List.
   *
   * @param body the payload of the incoming message
   * @return a list containing each part splitted
   */
  public List<VariableBinding> splitBody(Vector<? extends VariableBinding> body) {

      List<VariableBinding> answer = new ArrayList<VariableBinding>();
for (VariableBinding var : body) {
	OID oid = var.getOid();
	Variable variable = var.getVariable();
	LOG.debug("oid: {}, value: {}, syntax: {}",oid,variable.toLong(),variable.getSyntaxString());
	answer.add(var);
}
      return answer;
  }
 
开发者ID:boundary,项目名称:boundary-event-sdk,代码行数:18,代码来源:SplitVarBinds.java

示例3: splitMessage

import org.snmp4j.smi.VariableBinding; //导入方法依赖的package包/类
/**
   * The split message method returns something that is iteratable such as a java.util.List.
   *
   * @param body the payload of the incoming message
   * @return a list containing each part splitted
   */
  public List<VariableBinding> splitMessage(@Body Vector<? extends VariableBinding> body) {

      List<VariableBinding> answer = new ArrayList<VariableBinding>();
for (VariableBinding var : body) {
	OID oid = var.getOid();
	Variable variable = var.getVariable();
	LOG.debug("oid: {}, value: {}, syntax: {}",oid,variable.toLong(),variable.getSyntaxString());
	answer.add(var);
}
      return answer;
  }
 
开发者ID:boundary,项目名称:boundary-event-sdk,代码行数:18,代码来源:SplitVarBinds.java

示例4: decode

import org.snmp4j.smi.VariableBinding; //导入方法依赖的package包/类
/**
 * Decode a table event for a table, assuming the columns are as ordered in the
 * call to {@link #getTable(String)}.
 *
 * @param tableName
 * @param te
 * @return
 */
public Map<String, Variable> decode(String tableName, TableEvent te) {
    HashMap<String, Variable> hm = new HashMap<String, Variable>();
    log.debug(te);
    for (VariableBinding vb : te.getColumns()) {
        String key = oids.get(vb.getOid());
        Variable var = vb.getVariable();
        hm.put(key, var);
    }
    return hm;
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:19,代码来源:MibIndex.java

示例5: commit

import org.snmp4j.smi.VariableBinding; //导入方法依赖的package包/类
/** {@inheritDoc} */
  public void commit(final SubRequest request) {
  	final VariableBinding vb = request.getVariableBinding();
  	final Variable v = vb.getVariable();
  	m_vars.put(vb.getOid(), v);
  	final RequestStatus status = request.getStatus();
status.setPhaseComplete(true);
  }
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:9,代码来源:PropertiesBackedManagedObject.java

示例6: verify

import org.snmp4j.smi.VariableBinding; //导入方法依赖的package包/类
public void verify(VariableBinding vb) {
       assertNotNull("variable binding should not be null", vb);
       Variable val = vb.getVariable();
       assertNotNull("variable should not be null", val);
       assertEquals("OID (value: " + val + ")", new OID(m_expectedOid), vb.getOid());
       assertEquals("syntax", m_expectedSyntax, vb.getSyntax());
       assertEquals("value", m_expectedValue, val);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:9,代码来源:BrocadeMibTest.java

示例7: verify

import org.snmp4j.smi.VariableBinding; //导入方法依赖的package包/类
public void verify(VariableBinding vb) {
    assertNotNull("variable binding should not be null", vb);
    Variable val = vb.getVariable();
    assertNotNull("variable should not be null", val);
    assertEquals("OID (value: " + val + ")", new OID(m_expectedOid), vb.getOid());
    assertEquals("syntax", m_expectedSyntax, vb.getSyntax());
    assertEquals("value", m_expectedValue, val);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:9,代码来源:MockSnmpAgentTest.java


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