Interface MessageSender

All Known Implementing Classes:
SimpleMessageSender

public interface MessageSender
Interface for sending messages to clients in a chat application.
  • Method Details

    • sendMessageToClient

      void sendMessageToClient(String nickname, String message, ChatInterface chatClient) throws IOException
      Sends a message to a specific client identified by their nickname.
      Parameters:
      nickname - The nickname of the client to whom the message is sent.
      message - The message to be sent to the client.
      chatClient - The ChatInterface managing the client connections.
      Throws:
      IOException - if an I/O error occurs while sending the message.
    • sendMessage

      void sendMessage(ChatClient client, String message) throws IOException
      Sends a message to a specific client.
      Parameters:
      client - The ChatClient to whom the message is sent.
      message - The message to be sent to the client.
      Throws:
      IOException - if an I/O error occurs while sending the message.
    • sendLastMessages

      void sendLastMessages(ChatClient client) throws IOException
      Sends the last messages to a specific client upon connecting.
      Parameters:
      client - The ChatClient to whom the last messages are sent.
      Throws:
      IOException - if an I/O error occurs while sending the last messages.