Package org.cis1200

Class JoinCommand

java.lang.Object
org.cis1200.Command
org.cis1200.JoinCommand

class JoinCommand extends Command
Represents a Command issued by a client to join an existing channel. All users in the channel (including the new one) should be notified about when a "join" occurs.
  • Constructor Details

    • JoinCommand

      public JoinCommand(int senderId, String channel)
      Constructor; initializes the private fields of the object.
      Parameters:
      senderId - of this command
      channel - name of the new channel the user wants to join
  • 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 the user wants to join
    • toString

      public String toString()
      Overrides:
      toString in class Object