app/controllers/SMSController.java
/**
     * Construct SMS warning content based on JSon values
     * POSTed from the front end.
     * userQueue for .equals comparison
     * @return The SMS content to the app.
     */
Construct SMS warning content based on JSon values
POSTed from the front end.
userQueue for .equals comparison
@return The SMS content to the app.
Construct SMS warning content based on JSon values POSTed from the front end . userQueue for . equals comparison @return The SMS content to the app .
public Result Warning(){
        JsonNode json = request().body().asJson();
        if(json == null) {
            System.out.println("Expecting Json data.");
        } else {
            user = json.findPath("user").textValue();
            if(user == null) {
                System.out.println("Missing parameter [user]");
            } else {
                msg = json.findPath("status").textValue();
                if(msg == null) {
                    System.out.println("Missing parameter [msg]");
                }else {
                    if(userQueue.size() == 0){
                        userQueue.add(user);
                        msgQueue.add(msg);
                    }else{
                        boolean add = true;
                        for (int i = 0; i < userQueue.size(); i++) {
                            if (user.equals(userQueue.get(i))) {
                                String check = (msgQueue.get(i));
                                if (msg.equals(check)) {
                                    add = false;
                                }
                            }
                        }
                        if(add == true){
                            userQueue.add(user);
                            msgQueue.add(msg);
                        }
                    }
                }
            }
        }
        System.out.println("userQ: " +userQueue);
        System.out.println("msgQ: " +msgQueue);
        user = "NONE";
        msg = "OK";
        return (ok());
    }
public Result Warning ( ) { JsonNode json = request ( ) . body ( ) . asJson ( ) ; if ( json == null ) { System . out . println ( "Expecting Json data." ) ; } else { user = json . findPath ( "user" ) . textValue ( ) ; if ( user == null ) { System . out . println ( "Missing parameter [user]" ) ; } else { msg = json . findPath ( "status" ) . textValue ( ) ; if ( msg == null ) { System . out . println ( "Missing parameter [msg]" ) ; } else { if ( userQueue . size ( ) == 0 ) { userQueue . add ( user ) ; msgQueue . add ( msg ) ; } else { boolean add = true ; for ( int i = 0 ; i < userQueue . size ( ) ; i ++ ) { if ( user . equals ( userQueue . get ( i ) ) ) { String check = ( msgQueue . get ( i ) ) ; if ( msg . equals ( check ) ) { add = false ; } } } if ( add == true ) { userQueue . add ( user ) ; msgQueue . add ( msg ) ; } } } } } System . out . println ( "userQ: " + userQueue ) ; System . out . println ( "msgQ: " + msgQueue ) ; user = "NONE" ; msg = "OK" ; return ( ok ( ) ) ; }
Construct SMS warning content based on JSon values
 POSTed from the front end.
Construct SMS warning content based on JSon values POSTed from the front end .
//System.out.println("json posted in"); //warning might already be queued. //append warning to end of Queues.