Package org.cis1200

Class KickCommand

java.lang.Object
org.cis1200.Command
org.cis1200.KickCommand

class KickCommand extends Command
Represents a Command issued by a client to remove another client from a channel owned by the sender. Everyone in the initial channel (including the user being kicked) should be informed that the user was kicked.
  • Constructor Details

    • KickCommand

      public KickCommand(int senderId, String channel, String userToKick)
      Constructor; initializes the private fields of the object.
      Parameters:
      senderId - of this command, should be channel owner
      channel - where the owner wants to remove a user
      userToKick - must be a member of the channel
  • Method Details

    • updateServerModel

      public ResponseSet updateServerModel(ServerModel model)
      Description copied from class: Command
      Process the command and update the server model accordingly.
      Specified by:
      updateServerModel in class Command
      Parameters:
      model - An instance of the ServerModel class which represents the current state of the server.
      Returns:
      A ResponseSet object, informing clients about changes resulting from the command.
    • getChannel

      public String getChannel()
      Returns:
      the channel name
    • getUserToKick

      public String getUserToKick()
      Returns:
      the nickname of the user to remove
    • toString

      public String toString()
      Overrides:
      toString in class Object