Search in sources :

Example 11 with GlobalBeginResponse

use of io.seata.core.protocol.transaction.GlobalBeginResponse in project seata by seata.

the class MergeResultMessageTest method buildGlobalBeginResponse.

private GlobalBeginResponse buildGlobalBeginResponse() {
    final GlobalBeginResponse globalBeginResponse = new GlobalBeginResponse();
    globalBeginResponse.setXid("xid");
    globalBeginResponse.setExtraData("data");
    globalBeginResponse.setMsg("success");
    globalBeginResponse.setResultCode(ResultCode.Success);
    return globalBeginResponse;
}
Also used : GlobalBeginResponse(io.seata.core.protocol.transaction.GlobalBeginResponse)

Example 12 with GlobalBeginResponse

use of io.seata.core.protocol.transaction.GlobalBeginResponse in project seata by seata.

the class GlobalBeginResponseConvertor method convert2Model.

@Override
public GlobalBeginResponse convert2Model(GlobalBeginResponseProto globalBeginResponseProto) {
    GlobalBeginResponse branchCommitResponse = new GlobalBeginResponse();
    branchCommitResponse.setXid(globalBeginResponseProto.getXid());
    branchCommitResponse.setExtraData(globalBeginResponseProto.getExtraData());
    branchCommitResponse.setMsg(globalBeginResponseProto.getAbstractTransactionResponse().getAbstractResultMessage().getMsg());
    branchCommitResponse.setResultCode(ResultCode.valueOf(globalBeginResponseProto.getAbstractTransactionResponse().getAbstractResultMessage().getResultCode().name()));
    branchCommitResponse.setTransactionExceptionCode(TransactionExceptionCode.valueOf(globalBeginResponseProto.getAbstractTransactionResponse().getTransactionExceptionCode().name()));
    return branchCommitResponse;
}
Also used : GlobalBeginResponse(io.seata.core.protocol.transaction.GlobalBeginResponse)

Aggregations

GlobalBeginResponse (io.seata.core.protocol.transaction.GlobalBeginResponse)12 Test (org.junit.jupiter.api.Test)5 GlobalBeginRequest (io.seata.core.protocol.transaction.GlobalBeginRequest)3 StoreException (io.seata.common.exception.StoreException)1 TmTransactionException (io.seata.core.exception.TmTransactionException)1 TransactionException (io.seata.core.exception.TransactionException)1 AbstractResultMessage (io.seata.core.protocol.AbstractResultMessage)1 MergeResultMessage (io.seata.core.protocol.MergeResultMessage)1 GlobalCommitRequest (io.seata.core.protocol.transaction.GlobalCommitRequest)1 GlobalCommitResponse (io.seata.core.protocol.transaction.GlobalCommitResponse)1 GlobalRollbackRequest (io.seata.core.protocol.transaction.GlobalRollbackRequest)1 GlobalRollbackResponse (io.seata.core.protocol.transaction.GlobalRollbackResponse)1 RpcContext (io.seata.core.rpc.RpcContext)1 Measurement (io.seata.metrics.Measurement)1 GlobalBeginResponseProto (io.seata.serializer.protobuf.generated.GlobalBeginResponseProto)1 MockServerMessageSender (io.seata.server.coordinator.DefaultCoordinatorTest.MockServerMessageSender)1 HashMap (java.util.HashMap)1