Package acme.dataapp

Examples of acme.dataapp.FlightController.addFlight()


        JSONObject flightObj = new JSONObject(request.getInputStream());

        FlightController fc = FlightController.getInstance();
        String flightId = (String) flightObj.get("flightId");
        String state = (String) flightObj.get("state");
        fc.addFlight(flightId, state);
        res.put("result", "added");

      } else if (path.contains("/api/flights")) {
        // adds a flight status
        Flights fs = Flights.getInstance();
View Full Code Here


        // Creates a new flight status
        JSONObject o = new JSONObject(request.getInputStream());
        String flightId = o.getString("flightId");
        String state = o.getString("state");
        FlightController fc = FlightController.getInstance();
        fc.addFlight(flightId, state);
        res.put("result", "added");
      } else if (path.contains("/api/myflights/")) {
        // Adds a flight
        Principal prin = request.getUserPrincipal();
        if (prin != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.