diff --git a/src/main/java/com/epita/guereza/Main.java b/src/main/java/com/epita/guereza/Main.java index 8c023d3..8ad242a 100644 --- a/src/main/java/com/epita/guereza/Main.java +++ b/src/main/java/com/epita/guereza/Main.java @@ -1,8 +1,10 @@ package com.epita.guereza; -import com.epita.domain.*; +import com.epita.domain.Crawler; +import com.epita.domain.Document; +import com.epita.domain.Index; +import com.epita.domain.Indexer; import com.epita.eventbus.EventBusClient; -import com.epita.eventbus.EventMessage; import com.epita.eventbus.NettyEventBusClient; import com.epita.eventbus.NettyServer; import com.epita.guereza.service.CrawlerService; @@ -11,35 +13,14 @@ import com.epita.winter.provider.LazySingleton; import com.epita.winter.provider.Prototype; import com.epita.winter.provider.Singleton; -import com.fasterxml.jackson.core.JsonProcessingException; import java.util.Map; import java.util.function.Function; public class Main { - private static final String NETTY_HOST = "localhost"; private static final int NETTY_PORT = 8000; public static void main(String[] args) { -// final Index index = new Index(); -// final Repo repo = new UrlStore(); -// -// //repo.store(new String[]{"https://www.bbc.co.uk/food/recipes/saladenicoise_6572"}); -// -// boolean server = false; -// boolean client = true; -// if (server) { -// testEventBusClientSubscribe(); -// } else { -// testServer(); -// } -// -// //testSearch(index, "onions courgettes pepper"); - - testApp(); - } - - private static void testApp() { final Crawler crawler = new CrawlerService(); final Indexer indexer = new IndexerService(); @@ -69,24 +50,6 @@ private static void testServer() { ns.run(NETTY_PORT); } - - private static void testEventBusClientSubscribe() { - final NettyEventBusClient nebc = new NettyEventBusClient(); - final boolean succeed = nebc.run(NETTY_HOST, NETTY_PORT); - - if (succeed) { - final EventBusClient.Subscription s = nebc.subscribe("room", message -> { - System.out.println("sub: " + message.getContent()); - }); - try { - nebc.publish(new EventMessage("room", "Hi!")); - nebc.publish(new EventMessage("game", "Salut mec")); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - } - } - private static void testSearch(final Index index, final String query) { IndexerService indexer = new IndexerService();