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 5ef46d80c3
commit a9de00371d
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.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<ObjectProcessor<?>> 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();

View File

@ -13,14 +13,14 @@ import envoy.server.net.ObjectWriteProxy;
/**
* 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>
*
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @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