Search in sources :

Example 1 with AbstractBranchEndRequestProto

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

the class BranchRollbackRequestConvertor method convert2Proto.

@Override
public BranchRollbackRequestProto convert2Proto(BranchRollbackRequest branchRollbackRequest) {
    final short typeCode = branchRollbackRequest.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
    final String applicationData = branchRollbackRequest.getApplicationData();
    final String resourceId = branchRollbackRequest.getResourceId();
    final AbstractBranchEndRequestProto abstractBranchEndRequestProto = AbstractBranchEndRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setXid(branchRollbackRequest.getXid()).setBranchId(branchRollbackRequest.getBranchId()).setBranchType(BranchTypeProto.valueOf(branchRollbackRequest.getBranchType().name())).setApplicationData(applicationData == null ? "" : applicationData).setResourceId(resourceId == null ? "" : resourceId).build();
    BranchRollbackRequestProto result = BranchRollbackRequestProto.newBuilder().setAbstractBranchEndRequest(abstractBranchEndRequestProto).build();
    return result;
}
Also used : AbstractBranchEndRequestProto(io.seata.serializer.protobuf.generated.AbstractBranchEndRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) AbstractTransactionRequestProto(io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto) BranchRollbackRequestProto(io.seata.serializer.protobuf.generated.BranchRollbackRequestProto)

Example 2 with AbstractBranchEndRequestProto

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

the class BranchCommitRequestConvertor method convert2Proto.

@Override
public BranchCommitRequestProto convert2Proto(BranchCommitRequest branchCommitRequest) {
    final short typeCode = branchCommitRequest.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
    final String applicationData = branchCommitRequest.getApplicationData();
    final AbstractBranchEndRequestProto abstractBranchEndRequestProto = AbstractBranchEndRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setXid(branchCommitRequest.getXid()).setBranchId(branchCommitRequest.getBranchId()).setBranchType(BranchTypeProto.valueOf(branchCommitRequest.getBranchType().name())).setApplicationData(applicationData == null ? "" : applicationData).setResourceId(branchCommitRequest.getResourceId()).build();
    BranchCommitRequestProto result = BranchCommitRequestProto.newBuilder().setAbstractBranchEndRequest(abstractBranchEndRequestProto).build();
    return result;
}
Also used : AbstractBranchEndRequestProto(io.seata.serializer.protobuf.generated.AbstractBranchEndRequestProto) BranchCommitRequestProto(io.seata.serializer.protobuf.generated.BranchCommitRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) AbstractTransactionRequestProto(io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)

Aggregations

AbstractBranchEndRequestProto (io.seata.serializer.protobuf.generated.AbstractBranchEndRequestProto)2 AbstractMessageProto (io.seata.serializer.protobuf.generated.AbstractMessageProto)2 AbstractTransactionRequestProto (io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)2 BranchCommitRequestProto (io.seata.serializer.protobuf.generated.BranchCommitRequestProto)1 BranchRollbackRequestProto (io.seata.serializer.protobuf.generated.BranchRollbackRequestProto)1