Package acme.dataapp

Examples of acme.dataapp.Flights


        String code = ac.getCode(par[0], par[1]);
        res.put("code", code);

      } else if (path.contains("/api/flights/all")) {
        // Gets the details of all flights
        Flights fs = Flights.getInstance();
        res = fs.getFlights();

      } else if (path.contains("/api/flight/")) {
        // Gets the details of a flight
        Flights fs = Flights.getInstance();
        int idx = path.indexOf("/api/flight/")
            + "/api/flight/".length();
        String flightId = path.substring(idx);
        res = fs.getFlightsByID(flightId);

      } else if (path.contains("/api/logout")) {
        // Logs out the user
        HttpSession cur = request.getSession(false);
        if (cur != null) {
View Full Code Here


        fc.addFlight(flightId, state);
        res.put("result", "added");

      } else if (path.contains("/api/flights")) {
        // adds a flight status
        Flights fs = Flights.getInstance();
        JSONObject o = new JSONObject(request.getInputStream());
        String flight = (String) o.get("flight");
        String depart = (String) o.get("depart");
        String arrive = (String) o.get("arrive");
        String time = (String) o.get("time");
        String flightTime = (String) o.get("flighttime");
        fs.add(flight, depart, arrive, time, flightTime);
        res.put("result", "added");

      } else if (path.contains("/api/addmyflight")) {

      } else if (path.contains("/api/login")) {
View Full Code Here

    JSONObject res = new JSONObject();

    try {
      if (path.contains("/api/flights")) {
        // deletes a flight status
        Flights fs = Flights.getInstance();
        JSONObject o = new JSONObject(request.getInputStream());
        String flight = (String) o.get("flight");
        fs.removeFlight(flight);

      } else if (path.contains("/api/fc/")) {
        // deletes a new flight status
        JSONObject o = new JSONObject(request.getInputStream());
        String flightId = o.getString("flightId");
View Full Code Here

    JSONObject res = new JSONObject();

    try {
      if (path.contains("/api/flightstatus")) {
        // updates a flight status
        Flights fs = Flights.getInstance();
        JSONObject o = new JSONObject(request.getInputStream());
        String flight = (String) o.get("flight");
        String depart = (String) o.get("depart");
        String arrive = (String) o.get("arrive");
        String time = (String) o.get("time");
        String flightTime = (String) o.get("flighttime");
        fs.update(flight, depart, arrive, time, flightTime);

      }

      else if (path.contains("/api/fc/")) {
        // Creates a new flight status
View Full Code Here

TOP

Related Classes of acme.dataapp.Flights

Copyright © 2018 www.massapicom. 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.