Giter Club home page Giter Club logo

serverconsole's Introduction

Static Badge Static Badge Static Badge Static Badge Static Badge

Сетевой чат (серверная часть)

Учебный проект GeekBrains (сервер и клиент)

Функционал

  • аутентификация и регистрация клиентов
  • проверка от повторного входа
  • диспетчеризация сообщений от клиентов
  • сохранение истории сообщений при выходе клиента
  • загрузка истории сообщение при входе клиента
  • изменение имени клиента
  • ведение лога
  • отключение клиента на этапе процедуры логина/регистрации при неактивности в течении заданного времени.1
  • база данных пользователей, истории сообщений, лог-файл создаются в домашнем каталоге пользователя.2
  • при старте проекта опционально можно очистить историю всех пользователей и создать дефолтных пользователей в БД.3

Установка

git clone https://github.com/igojig/ServerConsole

Запуск

chcp 1251
mvn clean package
cd /target
java -jar Server-jar-with-dependencies.jar

или запуск из IDE

Настройки


1. отключение клиента на этапе процедуры логина/регистрации при неактивности в течении заданного времени

  public class ClientHandler{
    public static final int WAIT_USER_AUTHORISATION_TIMEOUT = 60 * 1000;
  }

2. база данных пользователей, истории сообщений, лог-файл создаются в домашнем каталоге пользователя

  • [user.home]/chat_

  • [user.home]/chat_/history

    каталог назначение
    ${env:user.home}/chat_ лог;
    база данных(users.db);
    ${env:user.home}/chat_/history история клиентов в текстовом формате;
public class LocalFileService {
    public static final String USER_HOME_DIR_ENVIRONMENT_VARIABLE = "user.home";
    public static final String STORAGE_DIR = "chat_";
    public static final String HISTORY_DIR = "history";

3. при старте проекта опционально можно очистить историю всех пользователей и создать дефолтных пользователей в БД

public class ServerApp {
    private static final boolean INIT_DB = true;
    private static final boolean CLEAR_HISTORY = true;
}

Диаграмма взаимодействия

diagramm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.