use of io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto in project seata by seata.
the class GlobalLockQueryResponseConvertor method convert2Model.
@Override
public GlobalLockQueryResponse convert2Model(GlobalLockQueryResponseProto globalLockQueryResponseProto) {
GlobalLockQueryResponse branchRegisterResponse = new GlobalLockQueryResponse();
AbstractTransactionResponseProto branchRegisterResponseProto = globalLockQueryResponseProto.getAbstractTransactionResponse();
final AbstractResultMessageProto abstractResultMessage = branchRegisterResponseProto.getAbstractResultMessage();
branchRegisterResponse.setMsg(abstractResultMessage.getMsg());
branchRegisterResponse.setResultCode(ResultCode.valueOf(abstractResultMessage.getResultCode().name()));
branchRegisterResponse.setTransactionExceptionCode(TransactionExceptionCode.valueOf(branchRegisterResponseProto.getTransactionExceptionCode().name()));
branchRegisterResponse.setLockable(globalLockQueryResponseProto.getLockable());
return branchRegisterResponse;
}
use of io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto in project seata by seata.
the class GlobalReportResponseConvertor method convert2Model.
@Override
public GlobalReportResponse convert2Model(GlobalReportResponseProto globalStatusResponseProto) {
GlobalReportResponse branchRegisterResponse = new GlobalReportResponse();
final AbstractGlobalEndResponseProto abstractGlobalEndResponse = globalStatusResponseProto.getAbstractGlobalEndResponse();
AbstractTransactionResponseProto abstractResultMessage = abstractGlobalEndResponse.getAbstractTransactionResponse();
branchRegisterResponse.setMsg(abstractResultMessage.getAbstractResultMessage().getMsg());
branchRegisterResponse.setResultCode(ResultCode.valueOf(abstractResultMessage.getAbstractResultMessage().getResultCode().name()));
branchRegisterResponse.setTransactionExceptionCode(TransactionExceptionCode.valueOf(abstractResultMessage.getTransactionExceptionCode().name()));
branchRegisterResponse.setGlobalStatus(GlobalStatus.valueOf(abstractGlobalEndResponse.getGlobalStatus().name()));
return branchRegisterResponse;
}
use of io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto in project seata by seata.
the class GlobalReportResponseConvertor method convert2Proto.
@Override
public GlobalReportResponseProto convert2Proto(GlobalReportResponse 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();
GlobalReportResponseProto result = GlobalReportResponseProto.newBuilder().setAbstractGlobalEndResponse(abstractGlobalEndResponseProto).build();
return result;
}
use of io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto in project seata by seata.
the class GlobalRollbackResponseConvertor method convert2Model.
@Override
public GlobalRollbackResponse convert2Model(GlobalRollbackResponseProto globalRollbackResponseProto) {
GlobalRollbackResponse branchRegisterResponse = new GlobalRollbackResponse();
final AbstractGlobalEndResponseProto abstractGlobalEndResponse = globalRollbackResponseProto.getAbstractGlobalEndResponse();
AbstractTransactionResponseProto abstractResultMessage = abstractGlobalEndResponse.getAbstractTransactionResponse();
branchRegisterResponse.setMsg(abstractResultMessage.getAbstractResultMessage().getMsg());
branchRegisterResponse.setResultCode(ResultCode.valueOf(abstractResultMessage.getAbstractResultMessage().getResultCode().name()));
branchRegisterResponse.setTransactionExceptionCode(TransactionExceptionCode.valueOf(abstractResultMessage.getTransactionExceptionCode().name()));
branchRegisterResponse.setGlobalStatus(GlobalStatus.valueOf(abstractGlobalEndResponse.getGlobalStatus().name()));
return branchRegisterResponse;
}
use of io.seata.serializer.protobuf.generated.AbstractTransactionResponseProto in project seata by seata.
the class GlobalRollbackResponseConvertor method convert2Proto.
@Override
public GlobalRollbackResponseProto convert2Proto(GlobalRollbackResponse globalRollbackResponse) {
final short typeCode = globalRollbackResponse.getTypeCode();
final AbstractMessageProto abstractMessage = AbstractMessageProto.newBuilder().setMessageType(MessageTypeProto.forNumber(typeCode)).build();
final String msg = globalRollbackResponse.getMsg();
final AbstractResultMessageProto abstractResultMessageProto = AbstractResultMessageProto.newBuilder().setMsg(msg == null ? "" : msg).setResultCode(ResultCodeProto.valueOf(globalRollbackResponse.getResultCode().name())).setAbstractMessage(abstractMessage).build();
AbstractTransactionResponseProto abstractTransactionResponseProto = AbstractTransactionResponseProto.newBuilder().setAbstractResultMessage(abstractResultMessageProto).setTransactionExceptionCode(TransactionExceptionCodeProto.valueOf(globalRollbackResponse.getTransactionExceptionCode().name())).build();
AbstractGlobalEndResponseProto abstractGlobalEndResponseProto = AbstractGlobalEndResponseProto.newBuilder().setAbstractTransactionResponse(abstractTransactionResponseProto).setGlobalStatus(GlobalStatusProto.valueOf(globalRollbackResponse.getGlobalStatus().name())).build();
GlobalRollbackResponseProto result = GlobalRollbackResponseProto.newBuilder().setAbstractGlobalEndResponse(abstractGlobalEndResponseProto).build();
return result;
}
Aggregations