Class LoginCommand

java.lang.Object
com.example.common.command.BaseCommand
com.example.common.command.LoginCommand
All Implemented Interfaces:
Command

public class LoginCommand extends BaseCommand
This class represents a command to log in a client to the chat.
  • Constructor Details

    • LoginCommand

      public LoginCommand(MessageSender messageSender, ChatInterface chatInterface)
      Constructor for the LoginCommand.
      Parameters:
      messageSender - The MessageSender object for sending messages.
      chatInterface - The ChatInterface containing information about clients in the chat.
  • Method Details

    • execute

      public Status execute(BodyMessage bodyMessage) throws IOException
      Executes the LoginCommand by logging in a client to the chat.
      Parameters:
      bodyMessage - The BodyMessage containing the login details.
      Returns:
      The execution status of the command.
      Throws:
      IOException - if an I/O error occurs during message sending.