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