lib/src/main/java/edu/utexas/tacc/tapis/files/lib/services/ParentTaskTransferService.java
private Mono<TransferTaskParent> doErrorParentChevronOne(AcknowledgableDelivery m, Throwable e, TransferTaskParent parent) {
        log.error(Utils.getMsg("FILES_TXFR_SVC_ERR7", parent.toString()));
        log.error(Utils.getMsg("FILES_TXFR_SVC_ERR7", e));
        m.nack(false);

        //TODO: UPDATE this when the Optional stuff gets integrated
        try {
            TransferTask task = dao.getTransferTaskByID(parent.getTaskId());
            if (task == null) {
                return Mono.empty();
            }
            task.setStatus(TransferTaskStatus.FAILED);
            task.setEndTime(Instant.now());
            task.setErrorMessage(e.getMessage());
            dao.updateTransferTask(task);
        } catch (DAOException ex) {
            log.error(Utils.getMsg("FILES_TXFR_SVC_ERR8", parent.getTaskId(), parent.getUuid()));
        }

        parent.setStatus(TransferTaskStatus.FAILED);
        parent.setEndTime(Instant.now());
        parent.setErrorMessage(e.getMessage());
        try {
            parent = dao.updateTransferTaskParent(parent);
            // This should really never happen, it means that the parent with that ID
            // was not even in the database.
            if (parent == null) {
                return Mono.empty();
            }
            return Mono.just(parent);
        } catch (DAOException ex) {
            log.error(Utils.getMsg("FILES_TXFR_SVC_ERR9", parent.getTaskId(), parent.getUuid()));
        }
        return Mono.empty();
    }
/**
     * This method handles exceptions/errors if the parent task failed.
     *
     * @param m      message from rabbitmq
     * @param e      Throwable
     * @param parent TransferTaskParent
     * @return Mono TransferTaskParent
     */
This method handles exceptions/errors if the parent task failed.
@param m      message from rabbitmq
@param e      Throwable
@param parent TransferTaskParent
@return Mono TransferTaskParent
This method handles exceptions / errors if the parent task failed . @param m message from rabbitmq @param e Throwable @param parent TransferTaskParent @return Mono TransferTaskParent
private Mono<TransferTaskParent> doErrorParentChevronOne(AcknowledgableDelivery m, Throwable e, TransferTaskParent parent) {
        log.error(Utils.getMsg("FILES_TXFR_SVC_ERR7", parent.toString()));
        log.error(Utils.getMsg("FILES_TXFR_SVC_ERR7", e));
        m.nack(false);
        try {
            TransferTask task = dao.getTransferTaskByID(parent.getTaskId());
            if (task == null) {
                return Mono.empty();
            }
            task.setStatus(TransferTaskStatus.FAILED);
            task.setEndTime(Instant.now());
            task.setErrorMessage(e.getMessage());
            dao.updateTransferTask(task);
        } catch (DAOException ex) {
            log.error(Utils.getMsg("FILES_TXFR_SVC_ERR8", parent.getTaskId(), parent.getUuid()));
        }
        parent.setStatus(TransferTaskStatus.FAILED);
        parent.setEndTime(Instant.now());
        parent.setErrorMessage(e.getMessage());
        try {
            parent = dao.updateTransferTaskParent(parent);
            if (parent == null) {
                return Mono.empty();
            }
            return Mono.just(parent);
        } catch (DAOException ex) {
            log.error(Utils.getMsg("FILES_TXFR_SVC_ERR9", parent.getTaskId(), parent.getUuid()));
        }
        return Mono.empty();
    }
private Mono < TransferTaskParent > doErrorParentChevronOne ( AcknowledgableDelivery m , Throwable e , TransferTaskParent parent ) { log . error ( Utils . getMsg ( "FILES_TXFR_SVC_ERR7" , parent . toString ( ) ) ) ; log . error ( Utils . getMsg ( "FILES_TXFR_SVC_ERR7" , e ) ) ; m . nack ( false ) ; try { TransferTask task = dao . getTransferTaskByID ( parent . getTaskId ( ) ) ; if ( task == null ) { return Mono . empty ( ) ; } task . setStatus ( TransferTaskStatus . FAILED ) ; task . setEndTime ( Instant . now ( ) ) ; task . setErrorMessage ( e . getMessage ( ) ) ; dao . updateTransferTask ( task ) ; } catch ( DAOException ex ) { log . error ( Utils . getMsg ( "FILES_TXFR_SVC_ERR8" , parent . getTaskId ( ) , parent . getUuid ( ) ) ) ; } parent . setStatus ( TransferTaskStatus . FAILED ) ; parent . setEndTime ( Instant . now ( ) ) ; parent . setErrorMessage ( e . getMessage ( ) ) ; try { parent = dao . updateTransferTaskParent ( parent ) ; if ( parent == null ) { return Mono . empty ( ) ; } return Mono . just ( parent ) ; } catch ( DAOException ex ) { log . error ( Utils . getMsg ( "FILES_TXFR_SVC_ERR9" , parent . getTaskId ( ) , parent . getUuid ( ) ) ) ; } return Mono . empty ( ) ; }
This method handles exceptions/errors if the parent task failed.
This method handles exceptions / errors if the parent task failed .
//TODO: UPDATE this when the Optional stuff gets integrated // This should really never happen, it means that the parent with that ID // was not even in the database.