Package com.denimgroup.threadfix.data.entities

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


      }
    }
   
    Integer scanId = scan.getId();
    Integer scanApplicationChannelId = scan.getApplicationChannel().getId();
    Application app = scan.getApplication();
    List<Scan> appScanList = app.getScans();
   
    if (scanId == null || scanApplicationChannelId == null || appScanList == null) {
      // also probably malformed
      return;
    }
View Full Code Here


     * This name is terrible, let's think about renaming channel merge
     * Should have 124 findings with no merges
     */
    @Test
    public void testChannelMergeMergingOff() {
        Application application = new Application();
        application.setSkipApplicationMerge(true);
        List<Scan> scans = Merger.getScanListFromPaths(application, ScannerType.DEPENDENCY_CHECK, DependencyCheckTests.FILE_PATH);

        assert scans.size() == 1 : "Had " + scans.size() + " scans instead of 1 scan.";

        int size = scans.get(0).getFindings().size();
View Full Code Here

   
    // Also add in the teams that only have app permissions
    Set<Integer> appIds = permissionService.getAuthenticatedAppIds();
    if (appIds != null && !appIds.isEmpty()) {
      for (Integer id : appIds) {
        Application app = applicationService.loadApplication(id);
        if (app != null && app.getOrganization() != null &&
            app.getOrganization().getId() != null &&
            !teamIds.contains(app.getOrganization().getId())) {
          teamIds.add(app.getOrganization().getId());
        }
      }
    }
   
    if (teamIds.size() == 0) {
View Full Code Here

    if (organization == null) {
      log.warn("Invalid Team ID.");
      return RestResponse.failure(CREATION_FAILED);
    }
   
    Application application = new Application();
        application.setOrganization(organization);
        application.setName(name.trim());
        if (url != null) {
            application.setUrl(url.trim());
        }
        // TODO include this as a parameter
        application.setApplicationCriticality(
                applicationCriticalityService.loadApplicationCriticality(
                        ApplicationCriticality.LOW));

    if (applicationService.checkApplication(application)) {
      applicationService.storeApplication(application);
View Full Code Here

        String result = checkKey(request, DETAIL);
        if (!result.equals(API_KEY_SUCCESS)) {
            return failure(result);
        }

        Application application = applicationService.loadApplication(appId);

        if (application == null) {
            log.warn(APPLICATION_LOOKUP_FAILED);
            return failure(APPLICATION_LOOKUP_FAILED);
        }
View Full Code Here

    String result = checkKey(request, SET_PARAMS);
    if (!result.equals(API_KEY_SUCCESS)) {
      return failure(result);
    }
   
    Application application = applicationService.loadApplication(appId);
   
    if (application == null) {
      log.warn(APPLICATION_LOOKUP_FAILED);
      return failure(APPLICATION_LOOKUP_FAILED);
    }
View Full Code Here

    @Override
    public int save(int appId, ScheduledScan scheduledScan) {
        int scheduledScanId = -1;

        Application application = applicationDao.retrieveById(appId);
        if(application != null) {
            scheduledScan.setApplication(application);
            scheduledScanDao.saveOrUpdate(scheduledScan);
            scheduledScanId = scheduledScan.getId();
            log.info("Created ScheduledScan with id: " + scheduledScanId);
View Full Code Here

      log.warn(APPLICATION_LOOKUP_FAILED);
            return failure(APPLICATION_LOOKUP_FAILED);
    }
   
    int teamId = org.getId();
    Application application = applicationService.loadApplication(appName, teamId)
   
    if (application == null) {
      log.warn(APPLICATION_LOOKUP_FAILED);
            return failure(APPLICATION_LOOKUP_FAILED);
    } else {
View Full Code Here

    @Override
    public String delete(ScheduledScan scheduledScan) {
        log.info("Deleting scheduled Scan " + scheduledScan.getScanner() + " of application with id "
                + scheduledScan.getApplication().getId());

        Application application = applicationDao.retrieveById(scheduledScan.getApplication().getId());

        if (application == null) {
            return "ScheduledScan couldn't be deleted. Unable to find application for this task.";
        }

        application.getScheduledScans().remove(scheduledScan);
        scheduledScan.setApplication(null);
        scheduledScanDao.delete(scheduledScan);
        applicationDao.saveOrUpdate(application);
        return null;
    }
View Full Code Here

        if (wafId == null) {
            log.warn("Received incomplete REST request to add a WAF");
            return failure(WAF_LOOKUP_FAILED);
        }
   
    Application application = applicationService.loadApplication(appId);
    Waf waf = wafService.loadWaf(wafId);
   
    if (application == null) {
      log.warn(APPLICATION_LOOKUP_FAILED);
      return failure(APPLICATION_LOOKUP_FAILED);
    } else if (waf == null) {
      log.warn(WAF_LOOKUP_FAILED);
      return failure(WAF_LOOKUP_FAILED);
    } else {
     
      // Delete WAF rules if the WAF has changed
      Integer oldWafId = null;
     
      if (application.getWaf() != null && application.getWaf().getId() != null) {
        oldWafId = application.getWaf().getId();
      }
     
      application.setWaf(waf);
      applicationService.updateWafRules(application, oldWafId);
      applicationService.storeApplication(application);
            return writeSuccessObjectWithView(application, AllViews.RestViewApplication2_1.class);
    }
  }
View Full Code Here

TOP

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

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.