Search in sources :

Example 1 with GlobalReportResponse

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;
}
Also used : AbstractGlobalEndResponseProto(io.seata.serializer.protobuf.generated.AbstractGlobalEndResponseProto) AbstractTransactionResponseProto(io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto) GlobalReportResponse(io.seata.core.protocol.transaction.GlobalReportResponse)

Example 2 with GlobalReportResponse

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();
}
Also used : GlobalReportRequest(io.seata.core.protocol.transaction.GlobalReportRequest) GlobalReportResponse(io.seata.core.protocol.transaction.GlobalReportResponse)

Example 3 with GlobalReportResponse

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;
}
Also used : TransactionException(io.seata.core.exception.TransactionException) GlobalReportRequest(io.seata.core.protocol.transaction.GlobalReportRequest) GlobalReportResponse(io.seata.core.protocol.transaction.GlobalReportResponse)

Aggregations

GlobalReportResponse (io.seata.core.protocol.transaction.GlobalReportResponse)3 GlobalReportRequest (io.seata.core.protocol.transaction.GlobalReportRequest)2 TransactionException (io.seata.core.exception.TransactionException)1 AbstractGlobalEndResponseProto (io.seata.serializer.protobuf.generated.AbstractGlobalEndResponseProto)1 AbstractTransactionResponseProto (io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto)1