Search in sources :

Example 1 with AbstractIdentifyRequestProto

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

the class RegisterTMRequestConvertor method convert2Proto.

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

Example 2 with AbstractIdentifyRequestProto

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

the class RegisterRMRequestConvertor method convert2Model.

@Override
public RegisterRMRequest convert2Model(RegisterRMRequestProto registerRMRequestProto) {
    RegisterRMRequest registerRMRequest = new RegisterRMRequest();
    AbstractIdentifyRequestProto abstractIdentifyRequest = registerRMRequestProto.getAbstractIdentifyRequest();
    registerRMRequest.setResourceIds(registerRMRequestProto.getResourceIds());
    registerRMRequest.setApplicationId(abstractIdentifyRequest.getApplicationId());
    registerRMRequest.setExtraData(abstractIdentifyRequest.getExtraData());
    registerRMRequest.setTransactionServiceGroup(abstractIdentifyRequest.getTransactionServiceGroup());
    registerRMRequest.setVersion(abstractIdentifyRequest.getVersion());
    return registerRMRequest;
}
Also used : RegisterRMRequest(io.seata.core.protocol.RegisterRMRequest) AbstractIdentifyRequestProto(io.seata.serializer.protobuf.generated.AbstractIdentifyRequestProto)

Example 3 with AbstractIdentifyRequestProto

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

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

the class RegisterTMRequestConvertor method convert2Model.

@Override
public RegisterTMRequest convert2Model(RegisterTMRequestProto registerTMRequestProto) {
    RegisterTMRequest registerRMRequest = new RegisterTMRequest();
    AbstractIdentifyRequestProto abstractIdentifyRequest = registerTMRequestProto.getAbstractIdentifyRequest();
    registerRMRequest.setApplicationId(abstractIdentifyRequest.getApplicationId());
    registerRMRequest.setExtraData(abstractIdentifyRequest.getExtraData());
    registerRMRequest.setTransactionServiceGroup(abstractIdentifyRequest.getTransactionServiceGroup());
    registerRMRequest.setVersion(abstractIdentifyRequest.getVersion());
    return registerRMRequest;
}
Also used : RegisterTMRequest(io.seata.core.protocol.RegisterTMRequest) AbstractIdentifyRequestProto(io.seata.serializer.protobuf.generated.AbstractIdentifyRequestProto)

Aggregations

AbstractIdentifyRequestProto (io.seata.serializer.protobuf.generated.AbstractIdentifyRequestProto)4 AbstractMessageProto (io.seata.serializer.protobuf.generated.AbstractMessageProto)2 RegisterRMRequest (io.seata.core.protocol.RegisterRMRequest)1 RegisterTMRequest (io.seata.core.protocol.RegisterTMRequest)1 RegisterRMRequestProto (io.seata.serializer.protobuf.generated.RegisterRMRequestProto)1 RegisterTMRequestProto (io.seata.serializer.protobuf.generated.RegisterTMRequestProto)1