Search in sources :

Example 1 with RequestStatus

use of org.snmp4j.agent.request.RequestStatus in project opennms by OpenNMS.

the class PropertiesBackedManagedObject method cleanup.

/** {@inheritDoc} */
@Override
public void cleanup(final SubRequest request) {
    m_oldValue = null;
    final RequestStatus status = request.getStatus();
    status.setPhaseComplete(true);
}
Also used : RequestStatus(org.snmp4j.agent.request.RequestStatus)

Example 2 with RequestStatus

use of org.snmp4j.agent.request.RequestStatus in project opennms by OpenNMS.

the class PropertiesBackedManagedObject method undo.

/** {@inheritDoc} */
@Override
public void undo(final SubRequest request) {
    m_vars.put(request.getVariableBinding().getOid(), m_oldValue);
    m_oldValue = null;
    final RequestStatus status = request.getStatus();
    status.setErrorStatus(SnmpConstants.SNMP_ERROR_SUCCESS);
    status.setPhaseComplete(true);
}
Also used : RequestStatus(org.snmp4j.agent.request.RequestStatus)

Example 3 with RequestStatus

use of org.snmp4j.agent.request.RequestStatus in project opennms by OpenNMS.

the class PropertiesBackedManagedObject method commit.

/** {@inheritDoc} */
@Override
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);
}
Also used : DynamicVariable(org.opennms.mock.snmp.responder.DynamicVariable) Variable(org.snmp4j.smi.Variable) VariableBinding(org.snmp4j.smi.VariableBinding) RequestStatus(org.snmp4j.agent.request.RequestStatus)

Example 4 with RequestStatus

use of org.snmp4j.agent.request.RequestStatus in project opennms by OpenNMS.

the class PropertiesBackedManagedObject method prepare.

/** {@inheritDoc} */
@Override
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);
}
Also used : VariableBinding(org.snmp4j.smi.VariableBinding) RequestStatus(org.snmp4j.agent.request.RequestStatus)

Aggregations

RequestStatus (org.snmp4j.agent.request.RequestStatus)4 VariableBinding (org.snmp4j.smi.VariableBinding)2 DynamicVariable (org.opennms.mock.snmp.responder.DynamicVariable)1 Variable (org.snmp4j.smi.Variable)1