public TransferEntity sendTransferConfirmation()

in src/main/java/org/openvasp/host/service/impl/VaspServiceImpl.java [214:233]


    public TransferEntity sendTransferConfirmation(final int transferId, @NonNull final String responseCode) {
        val transferEntity = transferService.getById(transferId);

        checkTransferType(transferEntity, TransferType.INCOMING);
        checkTransferStatus(transferEntity, TransferStatus.TRANSFER_DISPATCHED);

        val message = new TransferConfirmation();
        message.getHeader().setResponseCode(responseCode);

        val session = getBeneficiarySession(transferEntity.getSessionId());
        session.sendMessage(message);
        saveSession(session);

        transferEntity.setDispatchReplyCode(Integer.valueOf(responseCode));
        transferEntity.setTrStatus("1".equals(responseCode)
                ? TransferStatus.DISPATCH_CONFIRMED
                : TransferStatus.DISPATCH_DECLINED);

        return transferService.save(transferEntity);
    }