Search in sources :

Example 1 with GlobalReportRequestProto

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

the class GlobalReportRequestConvertor method convert2Proto.

@Override
public GlobalReportRequestProto convert2Proto(GlobalReportRequest globalReportRequest) {
    final short typeCode = globalReportRequest.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
    final String extraData = globalReportRequest.getExtraData();
    AbstractGlobalEndRequestProto abstractGlobalEndRequestProto = AbstractGlobalEndRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setXid(globalReportRequest.getXid()).setExtraData(extraData == null ? "" : extraData).build();
    GlobalReportRequestProto result = GlobalReportRequestProto.newBuilder().setAbstractGlobalEndRequest(abstractGlobalEndRequestProto).setGlobalStatus(GlobalStatusProto.valueOf(globalReportRequest.getGlobalStatus().name())).build();
    return result;
}
Also used : GlobalReportRequestProto(io.seata.serializer.protobuf.generated.GlobalReportRequestProto) AbstractGlobalEndRequestProto(io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) AbstractTransactionRequestProto(io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)

Aggregations

AbstractGlobalEndRequestProto (io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto)1 AbstractMessageProto (io.seata.serializer.protobuf.generated.AbstractMessageProto)1 AbstractTransactionRequestProto (io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)1 GlobalReportRequestProto (io.seata.serializer.protobuf.generated.GlobalReportRequestProto)1