Package com.example.common.command
Class LoginCommand
java.lang.Object
com.example.common.command.BaseCommand
com.example.common.command.LoginCommand
- All Implemented Interfaces:
Command
This class represents a command to log in a client to the chat.
-
Field Summary
Fields inherited from class com.example.common.command.BaseCommand
chatInterface, description, messageSender, name
-
Constructor Summary
ConstructorsConstructorDescriptionLoginCommand
(MessageSender messageSender, ChatInterface chatInterface) Constructor for the LoginCommand. -
Method Summary
Modifier and TypeMethodDescriptionexecute
(BodyMessage bodyMessage) Executes the LoginCommand by logging in a client to the chat.Methods inherited from class com.example.common.command.BaseCommand
getDescription, getName
-
Constructor Details
-
LoginCommand
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
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.
-