Package notification
Class Server
java.lang.Object
notification.Server
Class representing the server dedicated to the application.
It calls other classes from the notification package.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String,Subscriber> List of subscribers identified by their name. -
Constructor Summary
ConstructorsConstructorDescriptionServer()Constructor that initializes the abonnements attribute of type Map>String,Subscriber< with an instance of HashMap. -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod for subscribing to the service.voidMethod for sending an alert to the service's clients.String[]Method that returns the list of clients in the format: "Name Address (Mode)".voidMethod for unsubscribing from the service.
-
Field Details
-
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
Method for subscribing to the service.- Parameters:
clientName- : Name of the subscribing client.mode- : Chosen transmission mode.adr- : Client's address.
-
retirer
Method for unsubscribing from the service.- Parameters:
clientName- : Name of the client.
-
alerter
Method for sending an alert to the service's clients.- Parameters:
message- : The message to be transmitted.
-
getListeInscrits
Method that returns the list of clients in the format: "Name Address (Mode)".- Returns:
- the list of clients.
-