private void findAction(){
     
        if (this.action.equals("LOG-USER-OFF")){
            connectedClients.remove(this.users);
            System.out.println("User " + this.getUsers(0) + " has been logged of and removed from the hashmap");
        }
        else if (this.action.equals("BROADCAST")){
            System.out.println("message for everyone");
            //iterate the whole hashmap to send a message to all online users
            for (String currentUser : connectedClients.keySet()) {
                if (!currentUser.equals(recievedUsername)) {
                    writeMessageToOnlineUser(currentUser, recievedUsername, this.getMessage() + "&&all");
                }
            }
        }
        else if (this.action.equals("USER")){ // message is for single conversation
            System.out.println("SINGLE user communication : " + this.getUsers(0));
            //check if client user is currently online
            if (connectedClients.containsKey(this.getUsers(0)) == true) {
                writeMessageToOnlineUser(this.getUsers(0), recievedUsername, this.getMessage());
            } else {
                writeMessageToOfflineUser(this.getUsers(0), recievedUsername, this.getMessage());
                System.out.println("User not online, offline message has been sent");
            }
        }
        else if (this.action.equals("USERS")){ // message is for multiple users
            System.out.println("MULTI user communication");
            //iterate the users of the multipleUsers string array
            System.out.println("lenght : " + this.users.length);
            for (int i = 0; i < this.users.length; i++) {
                System.out.println("users name  : (" + this.getUsers(i)+")");
                //check if client user is currently online
                if (connectedClients.containsKey(this.getUsers(i)) == true) {
                    writeMessageToOnlineUser(this.getUsers(i), recievedUsername, this.getMessage() + "&&USERS::" + this.getStringUsers());
                }
            }
        }
        else if (this.action.equals("REQUEST")){ // Asking permittion to add him into a group
            if (connectedClients.containsKey(this.getUsers(0)) == true) {
                writeMessageToOnlineUser(this.getUsers(0), recievedUsername, this.getMessage() + "&&REQUEST");
            }
        }
        else if(this.action.equals("REQUEST-ANSWERED")){
            for (int i = 0; i < this.users.length; i++) {
                if (connectedClients.containsKey(this.getUsers(i)) == true) {
                    writeMessageToOnlineUser(this.getUsers(i), recievedUsername, this.getStringUsers() + this.getMessage() + "&&ANSWERED");
                }
            }
        }
        
    }