<commit_before>package no.cantara.jau.serviceconfig;

import no.cantara.jau.serviceconfig.dto.DownloadItem;
import no.cantara.jau.serviceconfig.dto.MavenMetadata;
import no.cantara.jau.serviceconfig.dto.NexusUrlBuilder;
import no.cantara.jau.serviceconfig.dto.ServiceConfig;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @author <a href="mailto:<EMAIL>"><NAME></a> 2015-07-09.
 */
@Service
public class InMemConfigRepo implements ServiceConfigDao {
    private final Map<String, ServiceConfig> repo;

    public InMemConfigRepo() {
        this.repo = new HashMap<>();
        addTestData();
    }

    private void addTestData() {
        MavenMetadata metadata = new MavenMetadata("net.whydah.identity", "UserAdminService", "2.1-SNAPSHOT");
        String url = new NexusUrlBuilder("http://mvnrepo.cantara.no", "snapshots").build(metadata);
        DownloadItem downloadItem = new DownloadItem(url, "username", "<PASSWORD>", metadata);

        ServiceConfig serviceConfig = new ServiceConfig("Service1-1.23");
        serviceConfig.addDownloadItem(downloadItem);
        serviceConfig.setStartServiceScript("java -DIAM_MODE=DEV -jar " + downloadItem.filename);
        addOrUpdateConfig("clientid1", serviceConfig);
    }

    public void addOrUpdateConfig(String clientId, ServiceConfig serviceConfig) {
        repo.put(clientId, serviceConfig);
    }

    public ServiceConfig findConfig(String clientId) {
        return repo.get(clientId);
    }
}<commit_msg>#1 - sett username and password to null to disable basic auth<commit_after>package no.cantara.jau.serviceconfig;

import no.cantara.jau.serviceconfig.dto.DownloadItem;
import no.cantara.jau.serviceconfig.dto.MavenMetadata;
import no.cantara.jau.serviceconfig.dto.NexusUrlBuilder;
import no.cantara.jau.serviceconfig.dto.ServiceConfig;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @author <a href="mailto:<EMAIL>"><NAME></a> 2015-07-09.
 */
@Service
public class InMemConfigRepo implements ServiceConfigDao {
    private final Map<String, ServiceConfig> repo;

    public InMemConfigRepo() {
        this.repo = new HashMap<>();
        addTestData();
    }

    private void addTestData() {
        MavenMetadata metadata = new MavenMetadata("net.whydah.identity", "UserAdminService", "2.1-SNAPSHOT");
        String url = new NexusUrlBuilder("http://mvnrepo.cantara.no", "snapshots").build(metadata);
        DownloadItem downloadItem = new DownloadItem(url, null, null, metadata);

        ServiceConfig serviceConfig = new ServiceConfig("Service1-1.23");
        serviceConfig.addDownloadItem(downloadItem);
        serviceConfig.setStartServiceScript("java -DIAM_MODE=DEV -jar " + downloadItem.filename());
        addOrUpdateConfig("clientid1", serviceConfig);
    }


    public void addOrUpdateConfig(String clientId, ServiceConfig serviceConfig) {
        repo.put(clientId, serviceConfig);
    }

    public ServiceConfig findConfig(String clientId) {
        return repo.get(clientId);
    }
}
{'fraction_non_alphanumeric': 0.11726595400064788, 'fraction_numerical': 0.01004211208292841, 'mean_word_length': 4.181208053691275, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6963644', 'n_tokens_mistral': 945, 'n_tokens_neox': 924, 'n_words': 176}