use of io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto in project seata by seata.
the class GlobalCommitRequestConvertor method convert2Proto.
@Override
public GlobalCommitRequestProto convert2Proto(GlobalCommitRequest globalCommitRequest) {
final short typeCode = globalCommitRequest.getTypeCode();
final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
final String extraData = globalCommitRequest.getExtraData();
AbstractGlobalEndRequestProto abstractGlobalEndRequestProto = AbstractGlobalEndRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setXid(globalCommitRequest.getXid()).setExtraData(extraData == null ? "" : extraData).build();
GlobalCommitRequestProto result = GlobalCommitRequestProto.newBuilder().setAbstractGlobalEndRequest(abstractGlobalEndRequestProto).build();
return result;
}
use of io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto in project seata by seata.
the class GlobalRollbackRequestConvertor method convert2Proto.
@Override
public GlobalRollbackRequestProto convert2Proto(GlobalRollbackRequest globalRollbackRequest) {
final short typeCode = globalRollbackRequest.getTypeCode();
final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
final String extraData = globalRollbackRequest.getExtraData();
AbstractGlobalEndRequestProto abstractGlobalEndRequestProto = AbstractGlobalEndRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setXid(globalRollbackRequest.getXid()).setExtraData(extraData == null ? "" : extraData).build();
GlobalRollbackRequestProto result = GlobalRollbackRequestProto.newBuilder().setAbstractGlobalEndRequest(abstractGlobalEndRequestProto).build();
return result;
}
use of io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto 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;
}
use of io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto in project seata by seata.
the class GlobalStatusRequestConvertor method convert2Proto.
@Override
public GlobalStatusRequestProto convert2Proto(GlobalStatusRequest globalStatusRequest) {
final short typeCode = globalStatusRequest.getTypeCode();
final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
final String extraData = globalStatusRequest.getExtraData();
AbstractGlobalEndRequestProto abstractGlobalEndRequestProto = AbstractGlobalEndRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setXid(globalStatusRequest.getXid()).setExtraData(extraData == null ? "" : extraData).build();
GlobalStatusRequestProto result = GlobalStatusRequestProto.newBuilder().setAbstractGlobalEndRequest(abstractGlobalEndRequestProto).build();
return result;
}
Aggregations