Search in sources :

Example 1 with AbstractMessageProto

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

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

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

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

use of io.seata.serializer.protobuf.generated.AbstractMessageProto 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)27 AbstractResultMessageProto (io.seata.serializer.protobuf.generated.AbstractResultMessageProto)12 AbstractTransactionRequestProto (io.seata.serializer.protobuf.generated.AbstractTransactionRequestProto)11 AbstractTransactionResponseProto (io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto)10 AbstractGlobalEndRequestProto (io.seata.serializer.protobuf.generated.AbstractGlobalEndRequestProto)4 AbstractGlobalEndResponseProto (io.seata.serializer.protobuf.generated.AbstractGlobalEndResponseProto)4 Any (com.google.protobuf.Any)2 Message (com.google.protobuf.Message)2 AbstractMessage (io.seata.core.protocol.AbstractMessage)2 AbstractBranchEndRequestProto (io.seata.serializer.protobuf.generated.AbstractBranchEndRequestProto)2 AbstractBranchEndResponseProto (io.seata.serializer.protobuf.generated.AbstractBranchEndResponseProto)2 AbstractIdentifyRequestProto (io.seata.serializer.protobuf.generated.AbstractIdentifyRequestProto)2 AbstractIdentifyResponseProto (io.seata.serializer.protobuf.generated.AbstractIdentifyResponseProto)2 BranchRegisterRequestProto (io.seata.serializer.protobuf.generated.BranchRegisterRequestProto)2 ArrayList (java.util.ArrayList)2 AbstractResultMessage (io.seata.core.protocol.AbstractResultMessage)1 MergeResultMessage (io.seata.core.protocol.MergeResultMessage)1 MergedWarpMessage (io.seata.core.protocol.MergedWarpMessage)1 BranchCommitRequestProto (io.seata.serializer.protobuf.generated.BranchCommitRequestProto)1 BranchCommitResponseProto (io.seata.serializer.protobuf.generated.BranchCommitResponseProto)1