}
@Override
public void received(Connection connection, Object object) {
if (connection.isConnected() && object instanceof MessageContainer) {
MessageContainer message = (MessageContainer) object;
LOG.log(Level.INFO, "[SERVER] Received message of type {0}", message.getType().name());
Integer id = connection.getID();
if (!clients.containsKey(id)) {
throw new RuntimeException("[SERVER] ID not registered. Internal failure.");
}
process(id, message);