Search in sources :

Example 16 with AbstractMessageProto

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

the class GlobalLockQueryResponseConvertor method convert2Proto.

@Override
public GlobalLockQueryResponseProto convert2Proto(GlobalLockQueryResponse globalLockQueryResponse) {
    final short typeCode = globalLockQueryResponse.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final String msg = globalLockQueryResponse.getMsg();
    final AbstractResultMessageProto abstractResultMessageProto = AbstractResultMessageProto.newBuilder().setMsg(msg == null ? "" : msg).setResultCode(ResultCodeProto.valueOf(globalLockQueryResponse.getResultCode().name())).setAbstractMessage(abstractMessage).build();
    AbstractTransactionResponseProto abstractTransactionResponseProto = AbstractTransactionResponseProto.newBuilder().setAbstractResultMessage(abstractResultMessageProto).setTransactionExceptionCode(TransactionExceptionCodeProto.valueOf(globalLockQueryResponse.getTransactionExceptionCode().name())).build();
    GlobalLockQueryResponseProto result = GlobalLockQueryResponseProto.newBuilder().setLockable(globalLockQueryResponse.isLockable()).setAbstractTransactionResponse(abstractTransactionResponseProto).build();
    return result;
}
Also used : AbstractResultMessageProto(io.seata.serializer.protobuf.generated.AbstractResultMessageProto) GlobalLockQueryResponseProto(io.seata.serializer.protobuf.generated.GlobalLockQueryResponseProto) AbstractTransactionResponseProto(io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto)

Example 17 with AbstractMessageProto

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

the class GlobalStatusResponseConvertor method convert2Proto.

@Override
public GlobalStatusResponseProto convert2Proto(GlobalStatusResponse globalStatusResponse) {
    final short typeCode = globalStatusResponse.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final String msg = globalStatusResponse.getMsg();
    final AbstractResultMessageProto abstractResultMessageProto = AbstractResultMessageProto.newBuilder().setMsg(msg == null ? "" : msg).setResultCode(ResultCodeProto.valueOf(globalStatusResponse.getResultCode().name())).setAbstractMessage(abstractMessage).build();
    AbstractTransactionResponseProto abstractTransactionResponseProto = AbstractTransactionResponseProto.newBuilder().setAbstractResultMessage(abstractResultMessageProto).setTransactionExceptionCode(TransactionExceptionCodeProto.valueOf(globalStatusResponse.getTransactionExceptionCode().name())).build();
    AbstractGlobalEndResponseProto abstractGlobalEndResponseProto = AbstractGlobalEndResponseProto.newBuilder().setAbstractTransactionResponse(abstractTransactionResponseProto).setGlobalStatus(GlobalStatusProto.valueOf(globalStatusResponse.getGlobalStatus().name())).build();
    GlobalStatusResponseProto result = GlobalStatusResponseProto.newBuilder().setAbstractGlobalEndResponse(abstractGlobalEndResponseProto).build();
    return result;
}
Also used : AbstractResultMessageProto(io.seata.serializer.protobuf.generated.AbstractResultMessageProto) AbstractGlobalEndResponseProto(io.seata.serializer.protobuf.generated.AbstractGlobalEndResponseProto) AbstractTransactionResponseProto(io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto) GlobalStatusResponseProto(io.seata.serializer.protobuf.generated.GlobalStatusResponseProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto)

Example 18 with AbstractMessageProto

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

the class RegisterRMRequestConvertor method convert2Proto.

@Override
public RegisterRMRequestProto convert2Proto(RegisterRMRequest registerRMRequest) {
    final short typeCode = registerRMRequest.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final String extraData = registerRMRequest.getExtraData();
    AbstractIdentifyRequestProto abstractIdentifyRequestProto = AbstractIdentifyRequestProto.newBuilder().setAbstractMessage(abstractMessage).setApplicationId(registerRMRequest.getApplicationId()).setExtraData(extraData == null ? "" : extraData).setTransactionServiceGroup(registerRMRequest.getTransactionServiceGroup()).setVersion(registerRMRequest.getVersion()).build();
    RegisterRMRequestProto result = RegisterRMRequestProto.newBuilder().setAbstractIdentifyRequest(abstractIdentifyRequestProto).setResourceIds(registerRMRequest.getResourceIds() == null ? "" : registerRMRequest.getResourceIds()).build();
    return result;
}
Also used : AbstractIdentifyRequestProto(io.seata.serializer.protobuf.generated.AbstractIdentifyRequestProto) RegisterRMRequestProto(io.seata.serializer.protobuf.generated.RegisterRMRequestProto) AbstractMessageProto(io.seata.serializer.protobuf.generated.AbstractMessageProto)

Example 19 with AbstractMessageProto

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

Example 20 with AbstractMessageProto

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

the class BranchRegisterRequestConvertor method convert2Proto.

@Override
public BranchRegisterRequestProto convert2Proto(BranchRegisterRequest branchRegisterRequest) {
    final short typeCode = branchRegisterRequest.getTypeCode();
    final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
    final AbstractTransactionRequestProto abstractTransactionRequestProto = AbstractTransactionRequestProto.newBuilder().setAbstractMessage(abstractMessage).build();
    final String applicationData = branchRegisterRequest.getApplicationData();
    final String resourceId = branchRegisterRequest.getResourceId();
    final String lockKey = branchRegisterRequest.getLockKey();
    BranchRegisterRequestProto result = BranchRegisterRequestProto.newBuilder().setAbstractTransactionRequest(abstractTransactionRequestProto).setApplicationData(applicationData == null ? "" : applicationData).setBranchType(BranchTypeProto.valueOf(branchRegisterRequest.getBranchType().name())).setLockKey(lockKey == null ? "" : lockKey).setResourceId(resourceId == null ? "" : resourceId).setXid(branchRegisterRequest.getXid()).build();
    return result;
}
Also used : BranchRegisterRequestProto(io.seata.serializer.protobuf.generated.BranchRegisterRequestProto) 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