use of io.seata.core.protocol.transaction.GlobalReportResponse in project seata by seata.
the class GlobalReportResponseConvertor method convert2Model.
@Override
public GlobalReportResponse convert2Model(GlobalReportResponseProto globalStatusResponseProto) {
GlobalReportResponse branchRegisterResponse = new GlobalReportResponse();
final AbstractGlobalEndResponseProto abstractGlobalEndResponse = globalStatusResponseProto.getAbstractGlobalEndResponse();
AbstractTransactionResponseProto abstractResultMessage = abstractGlobalEndResponse.getAbstractTransactionResponse();
branchRegisterResponse.setMsg(abstractResultMessage.getAbstractResultMessage().getMsg());
branchRegisterResponse.setResultCode(ResultCode.valueOf(abstractResultMessage.getAbstractResultMessage().getResultCode().name()));
branchRegisterResponse.setTransactionExceptionCode(TransactionExceptionCode.valueOf(abstractResultMessage.getTransactionExceptionCode().name()));
branchRegisterResponse.setGlobalStatus(GlobalStatus.valueOf(abstractGlobalEndResponse.getGlobalStatus().name()));
return branchRegisterResponse;
}
use of io.seata.core.protocol.transaction.GlobalReportResponse in project seata by seata.
the class DefaultTransactionManager method globalReport.
@Override
public GlobalStatus globalReport(String xid, GlobalStatus globalStatus) throws TransactionException {
GlobalReportRequest globalReport = new GlobalReportRequest();
globalReport.setXid(xid);
globalReport.setGlobalStatus(globalStatus);
GlobalReportResponse response = (GlobalReportResponse) syncCall(globalReport);
return response.getGlobalStatus();
}
use of io.seata.core.protocol.transaction.GlobalReportResponse in project seata by seata.
the class AbstractTCInboundHandler method handle.
@Override
public GlobalReportResponse handle(GlobalReportRequest request, final RpcContext rpcContext) {
GlobalReportResponse response = new GlobalReportResponse();
response.setGlobalStatus(request.getGlobalStatus());
exceptionHandleTemplate(new AbstractCallback<GlobalReportRequest, GlobalReportResponse>() {
@Override
public void execute(GlobalReportRequest request, GlobalReportResponse response) throws TransactionException {
doGlobalReport(request, response, rpcContext);
}
}, request, response);
return response;
}
Aggregations