All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bdware.doip.test.DoipServerTest Maven / Gradle / Ivy

The newest version!
package org.bdware.doip.test;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bdware.doip.audit.EndpointConfig;
import org.bdware.doip.audit.config.FileStorage;
import org.bdware.doip.audit.server.AuditDoipServer;

import java.util.concurrent.atomic.AtomicInteger;

public class DoipServerTest {
    static Logger LOGGER = LogManager.getLogger(DoipServerTest.class);

    public static void main(String[] arg) throws Exception {
        run();
    }

    public static void run() throws Exception {
        FileStorage fileStorage = new FileStorage("./input/auditrepo.json");
        EndpointConfig config = fileStorage.loadAsEndpointConfig();
        AuditDoipServer server = new AuditDoipServer(config);
        final AtomicInteger count = new AtomicInteger(0);
        TestRepoHandler handler = new TestRepoHandler();
        handler.count = count;
        server.setRepositoryHandler(handler);
        server.start();
        for (; ; ) {
            LOGGER.info("Count:" + count.get());
            Thread.sleep(10000);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy