Package com.denimgroup.threadfix.data.entities

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


  private DefaultConfigurationDao defaultConfigurationDao;

    @Transactional(readOnly = false)
  @Override
  public DefaultConfiguration loadCurrentConfiguration() {
        DefaultConfiguration configuration;

    List<DefaultConfiguration> list = defaultConfigurationDao.retrieveAll();
    if (list.size() == 0) {
            configuration = DefaultConfiguration.getInitialConfig();
    } else if (list.size() > 1) {
      DefaultConfiguration config = list.get(0);
      list.remove(0);
      for (DefaultConfiguration defaultConfig : list) {
        defaultConfigurationDao.delete(defaultConfig);
      }
      configuration = config;
View Full Code Here


    @Override
    public void onAuthenticationSuccess(HttpServletRequest request,
                                        HttpServletResponse response, Authentication authentication)
            throws ServletException, IOException {

        DefaultConfiguration config = defaultConfigService.loadCurrentConfiguration();

        Integer sessionTimeout = config.getSessionTimeout();

        if (sessionTimeout != null) {
            sessionTimeout = (sessionTimeout > MAX_TIMEOUT || sessionTimeout < MIN_TIMEOUT) ? MAX_TIMEOUT : sessionTimeout;
            request.getSession().setMaxInactiveInterval(sessionTimeout*SECONDS_IN_MIN);
        }
View Full Code Here

    private void addProxy(com.microsoft.tfs.core.httpclient.HttpClient client) {

        if (proxyService != null && proxyService.shouldUseProxy(TFSDefectTracker.class)) {

            DefaultConfiguration config = proxyService.getDefaultConfigurationWithProxyCredentials();

            if (config.hasConfiguredHostAndPort()) {
                client.getHostConfiguration().setProxy(config.getProxyHost(), config.getProxyPort());

                if (config.hasConfiguredCredentials()) {
                    client.getState().setProxyCredentials(AuthScope.ANY,
                            new UsernamePasswordCredentials(config.getProxyUsername(), config.getProxyPassword()));
                }
            }
        }
    }
View Full Code Here

        return scanners;
    }

    public DefaultConfiguration loadCurrentConfiguration() {
        DefaultConfiguration configuration;

        List<DefaultConfiguration> list = defaultConfigurationDao.retrieveAll();
        if (list.size() == 0) {
            configuration = DefaultConfiguration.getInitialConfig();
        } else if (list.size() > 1) {
            DefaultConfiguration config = list.get(0);
            list.remove(0);
            for (DefaultConfiguration defaultConfig : list) {
                defaultConfigurationDao.delete(defaultConfig);
            }
            configuration = config;
View Full Code Here

    @Override
    @Transactional
    public void updateMappings() {
        log.info("Start updating Scanner mapping from startup");

        DefaultConfiguration config = loadCurrentConfiguration();
        Calendar pluginTimestamp = config.getLastScannerMappingsUpdate();

        UpdaterHarness harness = new UpdaterHarness(pluginTimestamp);

        Calendar genericMappingsTime = harness.executeUpdates(genericMappingsUpdater);
        Calendar channelMappingsTime = harness.executeUpdates(channelVulnerabilityUpdater);
        Calendar defectTrackerTime = harness.executeUpdates(defectTrackerUpdater);
        Calendar wafTime = harness.executeUpdates(wafsUpdater);

        Calendar latestCalendar = getLatestCalendar(
                pluginTimestamp, genericMappingsTime, channelMappingsTime, defectTrackerTime, wafTime);
        config.setLastScannerMappingsUpdate(latestCalendar);

        defaultConfigurationDao.saveOrUpdate(config);

        log.info("Ended updating Scanner mapping from startup");
    }
View Full Code Here

        log.info("Ended updating Scanner mapping from startup");
    }

    @Override
    public ScanPluginCheckBean checkPluginJar() {
        DefaultConfiguration configuration = loadCurrentConfiguration();

        if (configuration != null && configuration.getLastScannerMappingsUpdate() != null) {

            Calendar databaseDate = configuration.getLastScannerMappingsUpdate();
            Calendar pluginDate = getMostRecentFileDate(databaseDate);

            if (pluginDate != null && databaseDate != null && !pluginDate.after(databaseDate)) {
                return new ScanPluginCheckBean(false, databaseDate, pluginDate);
            } else {
View Full Code Here

TOP

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

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.