Package notification

Class Server

java.lang.Object
notification.Server

public class Server extends Object
Class representing the server dedicated to the application. It calls other classes from the notification package.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    List of subscribers identified by their name.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor that initializes the abonnements attribute of type Map>String,Subscriber< with an instance of HashMap.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    adherer(String clientName, String mode, String adr)
    Method for subscribing to the service.
    void
    alerter(String message)
    Method for sending an alert to the service's clients.
    Method that returns the list of clients in the format: "Name Address (Mode)".
    void
    retirer(String clientName)
    Method for unsubscribing from the service.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • abonnements

      private Map<String,Subscriber> abonnements
      List of subscribers identified by their name.
  • Constructor Details

    • Server

      public Server()
      Constructor that initializes the abonnements attribute of type Map>String,Subscriber< with an instance of HashMap.
  • Method Details

    • adherer

      public void adherer(String clientName, String mode, String adr)
      Method for subscribing to the service.
      Parameters:
      clientName - : Name of the subscribing client.
      mode - : Chosen transmission mode.
      adr - : Client's address.
    • retirer

      public void retirer(String clientName)
      Method for unsubscribing from the service.
      Parameters:
      clientName - : Name of the client.
    • alerter

      public void alerter(String message)
      Method for sending an alert to the service's clients.
      Parameters:
      message - : The message to be transmitted.
    • getListeInscrits

      public String[] getListeInscrits()
      Method that returns the list of clients in the format: "Name Address (Mode)".
      Returns:
      the list of clients.