use of org.openkilda.wfm.topology.nbworker.fsm.FlowMeterModifyFsm in project open-kilda by telstra.
the class FlowMeterModifyHubService method handleRequest.
/**
* Handle flow meter modify request.
*/
public void handleRequest(String key, MeterModifyRequest request, FlowHubCarrier carrier) {
FlowMeterModifyFsm fsm = builder.newStateMachine(FlowMeterModifyState.INITIALIZED, carrier, key, request, persistenceManager);
process(fsm);
}
use of org.openkilda.wfm.topology.nbworker.fsm.FlowMeterModifyFsm in project open-kilda by telstra.
the class FlowMeterModifyHubService method handleTaskTimeout.
/**
* Handle timeout event.
*/
public void handleTaskTimeout(String key) {
FlowMeterModifyFsm fsm = fsms.get(key);
ErrorData errorData = new ErrorData(ErrorType.OPERATION_TIMED_OUT, "Flow meter modify failed by timeout", "Error in FlowMeterModifyHubService");
ErrorMessage errorMessage = new ErrorMessage(errorData, System.currentTimeMillis(), key);
fsm.fire(FlowMeterModifyEvent.ERROR, errorMessage);
process(fsm);
}
use of org.openkilda.wfm.topology.nbworker.fsm.FlowMeterModifyFsm in project open-kilda by telstra.
the class FlowMeterModifyHubService method handleAsyncResponse.
/**
* Handle response from speaker worker.
*/
public void handleAsyncResponse(String key, Message message) {
FlowMeterModifyFsm fsm = fsms.get(key);
if (message instanceof InfoMessage) {
InfoData data = ((InfoMessage) message).getData();
if (data instanceof SwitchMeterEntries) {
fsm.fire(FlowMeterModifyEvent.RESPONSE_RECEIVED, data);
} else {
log.warn("Key: {}; Unhandled message {}", key, message);
}
} else if (message instanceof ErrorMessage) {
fsm.fire(FlowMeterModifyEvent.ERROR, message);
}
process(fsm);
}
Aggregations