本文整理汇总了Java中org.snmp4j.agent.request.SubRequest.getVariableBinding方法的典型用法代码示例。如果您正苦于以下问题:Java SubRequest.getVariableBinding方法的具体用法?Java SubRequest.getVariableBinding怎么用?Java SubRequest.getVariableBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.snmp4j.agent.request.SubRequest
的用法示例。
在下文中一共展示了SubRequest.getVariableBinding方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVariable
import org.snmp4j.agent.request.SubRequest; //导入方法依赖的package包/类
private void getVariable(final SubRequest request, final OID oid) {
Variable value = findValueForOID(oid);
VariableBinding vb = request.getVariableBinding();
vb.setOid(oid);
vb.setVariable(value == null ? Null.noSuchObject : value);
request.completed();
}
示例2: prepare
import org.snmp4j.agent.request.SubRequest; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void prepare(final SubRequest request) {
// store the old value, in case we undo it
final VariableBinding vb = request.getVariableBinding();
m_oldValue = m_vars.get(vb.getOid());
final RequestStatus status = request.getStatus();
status.setErrorStatus(SnmpConstants.SNMP_ERROR_SUCCESS);
status.setPhaseComplete(true);
}
示例3: commit
import org.snmp4j.agent.request.SubRequest; //导入方法依赖的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);
}