Package com.denimgroup.threadfix.data.entities

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


   
    log.info("Start deleting scheduled scan from application with id " + appId);
    if (!PermissionUtils.isAuthorized(Permission.CAN_MANAGE_APPLICATIONS,orgId,appId)){
      return RestResponse.failure("You are not authorized to delete this scheduled scan.");
    }
        ScheduledScan scheduledScan = scheduledScanService.loadById(scheduledScanId);
        if (scheduledScan == null) {
            return RestResponse.failure("That scheduled scan was not found.");
        }

        //Remove job from scheduler
        if (scheduledScanScheduler.removeScheduledScan(scheduledScan)) {
            String ret = scheduledScanService.delete(scheduledScan);
            if (ret != null) {
                log.warn(ret);
                return RestResponse.failure(ret);
            } else {
                log.info("Successfully deleted scheduled scan from scheduler");
                return RestResponse.success(scheduledScan.getFrequency() + " Scan for " + scheduledScan.getScanner()
                        + " Scheduled Scan successfully deleted.");
            }
        } else {
            String message = "Failed to delete " + scheduledScan.getFrequency() + " Scan for " + scheduledScan.getScanner() +
                    " scheduled scan from scheduler";
            log.warn(message);
            return RestResponse.failure(message);
        }
  }
View Full Code Here

TOP

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

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.