use of io.seata.serializer.protobuf.generated.AbstractBranchEndResponseProto in project seata by seata.
the class BranchRollbackResponseConvertor method convert2Proto.
@Override
public BranchRollbackResponseProto convert2Proto(BranchRollbackResponse branchRollbackResponse) {
final short typeCode = branchRollbackResponse.getTypeCode();
final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
final String msg = branchRollbackResponse.getMsg();
final AbstractResultMessageProto abstractResultMessageProto = AbstractResultMessageProto.newBuilder().setMsg(msg == null ? "" : msg).setResultCode(ResultCodeProto.valueOf(branchRollbackResponse.getResultCode().name())).setAbstractMessage(abstractMessage).build();
final AbstractTransactionResponseProto abstractTransactionRequestProto = AbstractTransactionResponseProto.newBuilder().setAbstractResultMessage(abstractResultMessageProto).setTransactionExceptionCode(TransactionExceptionCodeProto.valueOf(branchRollbackResponse.getTransactionExceptionCode().name())).build();
final AbstractBranchEndResponseProto abstractBranchEndResponse = AbstractBranchEndResponseProto.newBuilder().setAbstractTransactionResponse(abstractTransactionRequestProto).setXid(branchRollbackResponse.getXid()).setBranchId(branchRollbackResponse.getBranchId()).setBranchStatus(BranchStatusProto.forNumber(branchRollbackResponse.getBranchStatus().getCode())).build();
BranchRollbackResponseProto result = BranchRollbackResponseProto.newBuilder().setAbstractBranchEndResponse(abstractBranchEndResponse).build();
return result;
}
use of io.seata.serializer.protobuf.generated.AbstractBranchEndResponseProto in project seata by seata.
the class BranchCommitResponseConvertor method convert2Proto.
@Override
public BranchCommitResponseProto convert2Proto(BranchCommitResponse branchCommitResponse) {
final short typeCode = branchCommitResponse.getTypeCode();
final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
final String msg = branchCommitResponse.getMsg();
final AbstractResultMessageProto abstractResultMessageProto = AbstractResultMessageProto.newBuilder().setMsg(msg == null ? "" : msg).setResultCode(ResultCodeProto.valueOf(branchCommitResponse.getResultCode().name())).setAbstractMessage(abstractMessage).build();
final AbstractTransactionResponseProto abstractTransactionRequestProto = AbstractTransactionResponseProto.newBuilder().setAbstractResultMessage(abstractResultMessageProto).setTransactionExceptionCode(TransactionExceptionCodeProto.valueOf(branchCommitResponse.getTransactionExceptionCode().name())).build();
final AbstractBranchEndResponseProto abstractBranchEndResponse = AbstractBranchEndResponseProto.newBuilder().setAbstractTransactionResponse(abstractTransactionRequestProto).setXid(branchCommitResponse.getXid()).setBranchId(branchCommitResponse.getBranchId()).setBranchStatus(BranchStatusProto.forNumber(branchCommitResponse.getBranchStatus().getCode())).build();
BranchCommitResponseProto result = BranchCommitResponseProto.newBuilder().setAbstractBranchEndResponse(abstractBranchEndResponse).build();
return result;
}
Aggregations