Search in sources :

Example 1 with AbstractTransactionRequestProto

use of io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto 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 AbstractTransactionRequestProto

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

the class GlobalBeginRequestConvertor method convert2Proto.

@Override
public GlobalBeginRequestProto convert2Proto(GlobalBeginRequest globalBeginRequest) {
    final short typeCode = globalBeginRequest.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
    GlobalBeginRequestProto result = GlobalBeginRequestProto.newBuilder().setTimeout(globalBeginRequest.getTimeout()).setTransactionName(globalBeginRequest.getTransactionName()).setAbstractTransactionRequest(abstractTransactionRequestProto).build();
    return result;
}
Also used : GlobalBeginRequestProto(io.seata.serializer.protobuf.generated.GlobalBeginRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) AbstractTransactionRequestProto(io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)

Example 3 with AbstractTransactionRequestProto

use of io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto 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 4 with AbstractTransactionRequestProto

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

the class GlobalLockQueryRequestConvertor method convert2Proto.

@Override
public GlobalLockQueryRequestProto convert2Proto(GlobalLockQueryRequest globalLockQueryRequest) {
    final short typeCode = globalLockQueryRequest.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
    final String applicationData = globalLockQueryRequest.getApplicationData();
    final String lockKey = globalLockQueryRequest.getLockKey();
    BranchRegisterRequestProto branchRegisterRequestProto = BranchRegisterRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setApplicationData(applicationData == null ? "" : applicationData).setBranchType(BranchTypeProto.valueOf(globalLockQueryRequest.getBranchType().name())).setLockKey(lockKey == null ? "" : lockKey).setResourceId(globalLockQueryRequest.getResourceId()).setXid(globalLockQueryRequest.getXid()).build();
    GlobalLockQueryRequestProto result = GlobalLockQueryRequestProto.newBuilder().setBranchRegisterRequest(branchRegisterRequestProto).build();
    return result;
}
Also used : BranchRegisterRequestProto(io.seata.serializer.protobuf.generated.BranchRegisterRequestProto) GlobalLockQueryRequestProto(io.seata.serializer.protobuf.generated.GlobalLockQueryRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto) AbstractTransactionRequestProto(io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)

Example 5 with AbstractTransactionRequestProto

use of io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto 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)

Aggregations

AbstractMessageProto (io.seata.serializer.protobuf.generated.AbstractMessageProto)11 AbstractTransactionRequestProto (io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)11 AbstractGlobalEndRequestProto (io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto)4 AbstractBranchEndRequestProto (io.seata.serializer.protobuf.generated.AbstractBranchEndRequestProto)2 BranchRegisterRequestProto (io.seata.serializer.protobuf.generated.BranchRegisterRequestProto)2 BranchCommitRequestProto (io.seata.serializer.protobuf.generated.BranchCommitRequestProto)1 BranchReportRequestProto (io.seata.serializer.protobuf.generated.BranchReportRequestProto)1 BranchRollbackRequestProto (io.seata.serializer.protobuf.generated.BranchRollbackRequestProto)1 GlobalBeginRequestProto (io.seata.serializer.protobuf.generated.GlobalBeginRequestProto)1 GlobalCommitRequestProto (io.seata.serializer.protobuf.generated.GlobalCommitRequestProto)1 GlobalLockQueryRequestProto (io.seata.serializer.protobuf.generated.GlobalLockQueryRequestProto)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 UndoLogDeleteRequestProto (io.seata.serializer.protobuf.generated.UndoLogDeleteRequestProto)1