/** * Create an instance of {@link NotifyRequestResultResponse } * */ public NotifyRequestResultResponse createNotifyRequestResultResponse() { return new NotifyRequestResultResponse(); }
public DestinationNotifyRequestResultResponse(NotifyRequestResultResponse notifyRequestResultResponse) { checkNotNull(notifyRequestResultResponse); this.responseError = notifyRequestResultResponse.getResponseError(); }
@Override public NotifyRequestResultResponse notifyRequestResult(NotifyRequestResultRequest notifyRequestResultRequest) { SessionInfo sessionInfo = sourceSessionRepository.findSessionInfoByRequestId(notifyRequestResultRequest.getRequestIdentifier()); NotifyRequestResultResponse notifyRequestResultResponse = new NotifyRequestResultResponse(); if (notifyRequestResultRequest.isRequestSuccess()) { if (sessionInfo.getSessionStateMachine().hasStateStartTransactionRequested()) { sessionInfo.getSessionStateMachine().eventStartOk(); sourceSessionRepository.insertOrUpdateSessionInfo(sessionInfo); } else if (sessionInfo.getSessionStateMachine().hasStateStopTransactionRequested()) { sessionInfo.getSessionStateMachine().eventStopOk(); sourceSessionRepository.insertOrUpdateSessionInfo(sessionInfo); } else { ResponseError responseError = new ResponseError(); responseError.setErrorCode("400"); responseError.setErrorMsg("Unexpected event in current state"); notifyRequestResultResponse.setResponseError(responseError); } } return notifyRequestResultResponse; }
/** * Create an instance of {@link NotifyRequestResultResponse } * */ public NotifyRequestResultResponse createNotifyRequestResultResponse() { return new NotifyRequestResultResponse(); }