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