Search in sources :

Example 1 with AbstractGlobalEndRequestProto

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;
}
Also used : GlobalCommitRequestProto(io.seata.serializer.protobuf.generated.GlobalCommitRequestProto) AbstractGlobalEndRequestProto(io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) AbstractTransactionRequestProto(io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)

Example 2 with AbstractGlobalEndRequestProto

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;
}
Also used : AbstractGlobalEndRequestProto(io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto) GlobalRollbackRequestProto(io.seata.serializer.protobuf.generated.GlobalRollbackRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) AbstractTransactionRequestProto(io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)

Example 3 with AbstractGlobalEndRequestProto

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;
}
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)

Example 4 with AbstractGlobalEndRequestProto

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;
}
Also used : GlobalStatusRequestProto(io.seata.serializer.protobuf.generated.GlobalStatusRequestProto) 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)4 AbstractMessageProto (io.seata.serializer.protobuf.generated.AbstractMessageProto)4 AbstractTransactionRequestProto (io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)4 GlobalCommitRequestProto (io.seata.serializer.protobuf.generated.GlobalCommitRequestProto)1 GlobalReportRequestProto (io.seata.serializer.protobuf.generated.GlobalReportRequestProto)1 GlobalRollbackRequestProto (io.seata.serializer.protobuf.generated.GlobalRollbackRequestProto)1 GlobalStatusRequestProto (io.seata.serializer.protobuf.generated.GlobalStatusRequestProto)1