Search in sources :

Example 1 with GlobalReportResponseProto

use of io.seata.serializer.protobuf.generated.GlobalReportResponseProto in project seata by seata.

the class GlobalReportResponseConvertor method convert2Proto.

@Override
public GlobalReportResponseProto convert2Proto(GlobalReportResponse globalStatusResponse) {
    final short typeCode = globalStatusResponse.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final String msg = globalStatusResponse.getMsg();
    final AbstractResultMessageProto abstractResultMessageProto = AbstractResultMessageProto.newBuilder().setMsg(msg == null ? "" : msg).setResultCode(ResultCodeProto.valueOf(globalStatusResponse.getResultCode().name())).setAbstractMessage(abstractMessage).build();
    AbstractTransactionResponseProto abstractTransactionResponseProto = AbstractTransactionResponseProto.newBuilder().setAbstractResultMessage(abstractResultMessageProto).setTransactionExceptionCode(TransactionExceptionCodeProto.valueOf(globalStatusResponse.getTransactionExceptionCode().name())).build();
    AbstractGlobalEndResponseProto abstractGlobalEndResponseProto = AbstractGlobalEndResponseProto.newBuilder().setAbstractTransactionResponse(abstractTransactionResponseProto).setGlobalStatus(GlobalStatusProto.valueOf(globalStatusResponse.getGlobalStatus().name())).build();
    GlobalReportResponseProto result = GlobalReportResponseProto.newBuilder().setAbstractGlobalEndResponse(abstractGlobalEndResponseProto).build();
    return result;
}
Also used : AbstractResultMessageProto(io.seata.serializer.protobuf.generated.AbstractResultMessageProto) AbstractGlobalEndResponseProto(io.seata.serializer.protobuf.generated.AbstractGlobalEndResponseProto) AbstractTransactionResponseProto(io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) GlobalReportResponseProto(io.seata.serializer.protobuf.generated.GlobalReportResponseProto)

Aggregations

AbstractGlobalEndResponseProto (io.seata.serializer.protobuf.generated.AbstractGlobalEndResponseProto)1 AbstractMessageProto (io.seata.serializer.protobuf.generated.AbstractMessageProto)1 AbstractResultMessageProto (io.seata.serializer.protobuf.generated.AbstractResultMessageProto)1 AbstractTransactionResponseProto (io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto)1 GlobalReportResponseProto (io.seata.serializer.protobuf.generated.GlobalReportResponseProto)1