Change default logging level to finest, rename a class

This commit is contained in:
Kai S. K. Engelbart 2020-06-12 10:56:02 +02:00
parent 8ad43fecd9
commit 5f54fe6721
2 changed files with 12 additions and 15 deletions

View File

@ -3,7 +3,6 @@ package envoy.server;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.logging.Level; import java.util.logging.Level;
@ -40,7 +39,7 @@ public class Startup {
items.put("homeDirectory", items.put("homeDirectory",
new ConfigItem<>("homeDirectory", "h", File::new, new File(System.getProperty("user.home"), ".envoy-server"), true)); 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("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(); final var config = new Config();
config.load(items); config.load(items);
@ -59,17 +58,15 @@ public class Startup {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
initLogging(); initLogging();
Set<ObjectProcessor<?>> processors = new HashSet<>(); Server server = new Server(8080, ObjectMessageReader::new,
processors.add(new LoginCredentialProcessor()); new ObjectMessageProcessor(Set.of(new LoginCredentialProcessor(),
processors.add(new MessageProcessor()); new MessageProcessor(),
processors.add(new GroupCreationProcessor()); new GroupCreationProcessor(),
processors.add(new GroupMessageProcessor()); new MessageStatusChangeProcessor(),
processors.add(new MessageStatusChangeProcessor()); new UserStatusChangeProcessor(),
processors.add(new UserStatusChangeProcessor()); new IDGeneratorRequestProcessor(),
processors.add(new IDGeneratorRequestProcessor()); new ContactSearchProcessor(),
processors.add(new ContactsRequestEventProcessor()); new ContactOperationProcessor())));
processors.add(new ContactOperationProcessor());
Server server = new Server(8080, ObjectMessageReader::new, new ObjectMessageProcessor(processors));
// Initialize the current message ID // Initialize the current message ID
PersistenceManager persistenceManager = PersistenceManager.getInstance(); PersistenceManager persistenceManager = PersistenceManager.getInstance();

View File

@ -13,14 +13,14 @@ import envoy.server.net.ObjectWriteProxy;
/** /**
* Project: <strong>envoy-server-standalone</strong><br> * Project: <strong>envoy-server-standalone</strong><br>
* File: <strong>ContactsRequestEventProcessor.java</strong><br> * File: <strong>ContactSearchProcessor.java</strong><br>
* Created: <strong>08.02.2020</strong><br> * Created: <strong>08.02.2020</strong><br>
* *
* @author Kai S. K. Engelbart * @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer * @author Maximilian K&auml;fer
* @since Envoy Server Standalone v0.1-alpha * @since Envoy Server Standalone v0.1-alpha
*/ */
public class ContactsRequestEventProcessor implements ObjectProcessor<ContactSearchRequest> { public class ContactSearchProcessor implements ObjectProcessor<ContactSearchRequest> {
/** /**
* Writes a list of contacts to the client containing all {@link Contact}s * Writes a list of contacts to the client containing all {@link Contact}s