From 5f54fe6721790249843afa797229fb8bf729ffa8 Mon Sep 17 00:00:00 2001 From: kske Date: Fri, 12 Jun 2020 10:56:02 +0200 Subject: [PATCH] Change default logging level to finest, rename a class --- src/main/java/envoy/server/Startup.java | 23 ++++++++----------- ...essor.java => ContactSearchProcessor.java} | 4 ++-- 2 files changed, 12 insertions(+), 15 deletions(-) rename src/main/java/envoy/server/processors/{ContactsRequestEventProcessor.java => ContactSearchProcessor.java} (89%) diff --git a/src/main/java/envoy/server/Startup.java b/src/main/java/envoy/server/Startup.java index 150f9ff..63415aa 100755 --- a/src/main/java/envoy/server/Startup.java +++ b/src/main/java/envoy/server/Startup.java @@ -3,7 +3,6 @@ package envoy.server; import java.io.File; import java.io.IOException; import java.util.HashMap; -import java.util.HashSet; import java.util.Set; import java.util.logging.Level; @@ -40,7 +39,7 @@ public class Startup { items.put("homeDirectory", new ConfigItem<>("homeDirectory", "h", File::new, new File(System.getProperty("user.home"), ".envoy-server"), true)); items.put("fileLevelBarrier", new ConfigItem<>("fileLevelBarrier", "fb", Level::parse, Level.SEVERE, true)); - items.put("consoleLevelBarrier", new ConfigItem<>("consoleLevelBarrier", "cb", Level::parse, Level.FINE, true)); + items.put("consoleLevelBarrier", new ConfigItem<>("consoleLevelBarrier", "cb", Level::parse, Level.FINEST, true)); final var config = new Config(); config.load(items); @@ -59,17 +58,15 @@ public class Startup { public static void main(String[] args) throws IOException { initLogging(); - Set> processors = new HashSet<>(); - processors.add(new LoginCredentialProcessor()); - processors.add(new MessageProcessor()); - processors.add(new GroupCreationProcessor()); - processors.add(new GroupMessageProcessor()); - processors.add(new MessageStatusChangeProcessor()); - processors.add(new UserStatusChangeProcessor()); - processors.add(new IDGeneratorRequestProcessor()); - processors.add(new ContactsRequestEventProcessor()); - processors.add(new ContactOperationProcessor()); - Server server = new Server(8080, ObjectMessageReader::new, new ObjectMessageProcessor(processors)); + Server server = new Server(8080, ObjectMessageReader::new, + new ObjectMessageProcessor(Set.of(new LoginCredentialProcessor(), + new MessageProcessor(), + new GroupCreationProcessor(), + new MessageStatusChangeProcessor(), + new UserStatusChangeProcessor(), + new IDGeneratorRequestProcessor(), + new ContactSearchProcessor(), + new ContactOperationProcessor()))); // Initialize the current message ID PersistenceManager persistenceManager = PersistenceManager.getInstance(); diff --git a/src/main/java/envoy/server/processors/ContactsRequestEventProcessor.java b/src/main/java/envoy/server/processors/ContactSearchProcessor.java similarity index 89% rename from src/main/java/envoy/server/processors/ContactsRequestEventProcessor.java rename to src/main/java/envoy/server/processors/ContactSearchProcessor.java index b1330c9..49fb33f 100755 --- a/src/main/java/envoy/server/processors/ContactsRequestEventProcessor.java +++ b/src/main/java/envoy/server/processors/ContactSearchProcessor.java @@ -13,14 +13,14 @@ import envoy.server.net.ObjectWriteProxy; /** * Project: envoy-server-standalone
- * File: ContactsRequestEventProcessor.java
+ * File: ContactSearchProcessor.java
* Created: 08.02.2020
* * @author Kai S. K. Engelbart * @author Maximilian Käfer * @since Envoy Server Standalone v0.1-alpha */ -public class ContactsRequestEventProcessor implements ObjectProcessor { +public class ContactSearchProcessor implements ObjectProcessor { /** * Writes a list of contacts to the client containing all {@link Contact}s