Package com.denimgroup.threadfix.data.entities

Examples of com.denimgroup.threadfix.data.entities.ApplicationChannel


    private RemoteProviderApplication getApplication(RemoteProviderType type, String nativeName) {
        RemoteProviderApplication application = new RemoteProviderApplication();
        application.setNativeName(nativeName);
        application.setRemoteProviderType(type);
        application.setApplicationChannel(new ApplicationChannel());
        return application;
    }
View Full Code Here


        RemoteProviderType type = new RemoteProviderType();
        type.setUsername(VeracodeMockHttpUtils.GOOD_USERNAME);
        type.setPassword(VeracodeMockHttpUtils.GOOD_PASSWORD);

        provider.setRemoteProviderType(type);
        provider.setChannel(new ApplicationChannel());

        List<Scan> scans = provider.getScans(getApplication(type, nativeName));

        assertFalse("Scans were null for application " + nativeName + ".", scans == null);
        assertFalse("Scans were empty.", scans.isEmpty());
View Full Code Here

    private RemoteProviderApplication getApplication(RemoteProviderType type, String nativeName) {
        RemoteProviderApplication application = new RemoteProviderApplication();
        application.setNativeName(nativeName);
        application.setRemoteProviderType(type);
        application.setApplicationChannel(new ApplicationChannel());
        return application;
    }
View Full Code Here

        RemoteProviderType type = new RemoteProviderType();
        type.setUsername(QualysMockHttpUtils.GOOD_USERNAME);
        type.setPassword(QualysMockHttpUtils.GOOD_PASSWORD);

        provider.setRemoteProviderType(type);
        provider.setChannel(new ApplicationChannel());

        List<Scan> scans = provider.getScans(getApplication(type, nativeName));

        assertFalse("Scans were null for application " + nativeName + ".", scans == null);
        assertFalse("Scans were empty.", scans.isEmpty());
View Full Code Here

            String message = "Bad file name (" + fileName + ") passed into addFileToQueue. Exiting.";
            LOG.error(message);
            throw new IllegalArgumentException(message);
        }

        ApplicationChannel applicationChannel = applicationChannelDao
                .retrieveById(channelId);

        Integer appId = applicationChannel.getApplication().getId();
        Integer orgId = applicationChannel.getApplication()
                .getOrganization().getId();

        queueSender.addScanToQueue(fileName, channelId, orgId, appId, scanDate, applicationChannel);
    }
View Full Code Here

            String message = "Bad file name (" + fileName + ") passed into addFileToQueue. Exiting.";
            LOG.error(message);
            throw new IllegalArgumentException(message);
        }

        ApplicationChannel channel = applicationChannelDao.retrieveById(channelId);

        if (channel == null) {
            LOG.warn("The ApplicationChannel could not be loaded.");
            return new ScanCheckResultBean(ScanImportStatus.OTHER_ERROR);
        }

        ChannelImporter importer = channelImporterFactory.getChannelImporter(channel);

        if (importer == null) {
            LOG.warn("No importer could be loaded for the ApplicationChannel.");
            return new ScanCheckResultBean(ScanImportStatus.OTHER_ERROR);
        }

        importer.setFileName(fileName);

        ScanCheckResultBean result = importer.checkFile();

        if ((!result.getScanCheckResult().equals(ScanImportStatus.SUCCESSFUL_SCAN)
                && !result.getScanCheckResult().equals(ScanImportStatus.EMPTY_SCAN_ERROR))) {
            importer.deleteScanFile();
        }

        Calendar scanQueueDate = applicationChannelDao.getMostRecentQueueScanTime(channel.getId());
   
    if (scanQueueDate != null && result.getTestDate() != null &&
        !result.getTestDate().after(scanQueueDate)) {
      LOG.warn(ScanImportStatus.MORE_RECENT_SCAN_ON_QUEUE.toString());
      return new ScanCheckResultBean(ScanImportStatus.MORE_RECENT_SCAN_ON_QUEUE, result.getTestDate());
View Full Code Here

        emptyScan.getFileName() == null) {
      LOG.warn("The empty scan was not added to the queue. It was either already processed or incorrectly configured.");
      return;
    }
   
    ApplicationChannel applicationChannel = emptyScan.getApplicationChannel();
   
    Integer appId = applicationChannel.getApplication().getId();
    Integer orgId = applicationChannel.getApplication()
        .getOrganization().getId();

    String fileName = emptyScan.getFileName();
   
    queueSender.addScanToQueue(fileName, applicationChannel.getId(), orgId, appId, null, applicationChannel);
 
    emptyScan.setAlreadyProcessed(true);
    emptyScanDao.saveOrUpdate(emptyScan);
  }
View Full Code Here

    @Autowired
    protected GenericVulnerabilityDao genericVulnerabilityDao;

    public ChannelImporter getImporter(ScannerType type) {

        ApplicationChannel channel = new ApplicationChannel();
        channel.setChannelType(new ChannelType());
        channel.getChannelType().setName(type.getDbName());

        ChannelImporter importer = factory.getChannelImporter(channel);

        if (importer == null) {
            throw new IllegalArgumentException("The supplied ScannerType should produce a " +
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.data.entities.ApplicationChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.