Examples of Reservation


Examples of beans.Reservation

    public Reservation startReservationManagement(int nextID,Product product, User u) {
        System.out.println("next id: " + nextID);
        RestClient add_reservationto_server = new RestClient();
       
        if (product instanceof Video){
            Reservation reservation = new Reservation(nextID,u,product,new Date(),new Date(),false);
            //System.out.println("json: " + encodeJsonObject(reservation).toJSONString());
            //System.out.println("json: " + encodeJsonObjectProductstats(reservation).toJSONString());           
            add_reservationto_server.apacheHttpClientPost(Login.url+"api/reservation/reservation/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObject(reservation));
            add_reservationto_server.apacheHttpClientPatch(Login.url+"api/reservation/product/"+reservation.getProduct().getId()+"/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObjectProductstats(reservation));
            return reservation;
        }
        else if (product instanceof Book ){
            Reservation reservation = new Reservation(nextID,u,product,new Date(),new Date(),false);
            //System.out.println(encodeJsonObject(reservation).toJSONString());
            add_reservationto_server.apacheHttpClientPost(Login.url+"api/reservation/reservation/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObject(reservation));
            add_reservationto_server.apacheHttpClientPatch(Login.url+"api/reservation/product/"+reservation.getProduct().getId()+"/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObjectProductstats(reservation));
            return reservation;
        }
        return null;
    }
View Full Code Here

Examples of beans.Reservation

            if (temp!=null){
                authors_node.add(new javax.swing.tree.DefaultMutableTreeNode(temp.getName()));
            }
        }
        for (int i = 0; i< this.window_login.getReservations().size();i++){
            Reservation temp = (Reservation)this.window_login.getReservations().get(i);
            if (temp!=null){
                if (temp.getProduct()!=null){
                    reservations_node.add(new javax.swing.tree.DefaultMutableTreeNode(temp.getProduct().getName()));
                }
            }
        }
        //***************************************************************************************

 
View Full Code Here

Examples of beans.Reservation

                        break;
                    }
                }
            }
            for (int i = 0; i< this.window_login.getReservations().size();i++){
                Reservation temp = (Reservation)this.window_login.getReservations().get(i);
                if (temp!=null){
                    if (temp.getProduct()!=null){
                        if (this.jTextField.getText().toLowerCase().contains(temp.getProduct().getName().toLowerCase())){
                            reservations_node = new DefaultMutableTreeNode("Reservations");
                            reservations_node.add(new javax.swing.tree.DefaultMutableTreeNode(temp.getProduct().getName()));
                            break;
                        }
                    }
                }
            }
View Full Code Here

Examples of beans.Reservation

                            reserv_date_start = sdf.parse((String) jsonObject.get("reserv_date_start"));
                            reserv_finish = sdf.parse((String) jsonObject.get("reserv_finish"));
                        } catch (java.text.ParseException ex) {
                            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
                        }
                        Reservation reservation = new Reservation(Integer.parseInt((String)jsonObject.get("id")), u, product, reserv_date_start,reserv_finish, (boolean) jsonObject.get("penalty"));
                        login.getReservations().add(reservation);
                        login.getReservations_map().put(reservation.getId(), reservation);
                    }
                } catch (ParseException ex) {
                    Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
                }
                flag = true;
View Full Code Here

Examples of beans.Reservation

        * it calls this method, which resets the string buffer
        */
       public void startElement(String uri, String localName,String qName, Attributes attributes) throws SAXException {
              temp = "";
              if (qName.equalsIgnoreCase("Object")) {
                     this.reservation = new Reservation();
              }
       }
View Full Code Here

Examples of beans.Reservation

    }   
       private void readList() {
              System.out.println("Names of  the reservations '" + this.login.getReservations().size()  + "'.");
              Iterator<Reservation> it = this.login.getReservations().iterator();
              while (it.hasNext()) {
                  Reservation aux = it.next();
                  System.out.println(aux.getId());
                  System.out.println(aux.isPenalty());
              }     
       }
View Full Code Here

Examples of beans.Reservation

        // TODO add your handling code here:

        Map<Integer, Reservation> treeMap = new TreeMap <Integer, Reservation>(this.menu_window.getLogin_window().getReservations_map());     
       
        if (this.product instanceof Video){
            Reservation reservation = this.product.startReservationManagement(getNextID(treeMap),menu_window.getUser());
            this.menu_window.getLogin_window().getReservations_map().put(reservation.getId(), reservation);
            System.out.println("Instance of VideReservation " + reservation.getReserv_date_start());        
        }
        else if (this.product instanceof Book ){
            Reservation reservation = this.product.startReservationManagement(getNextID(treeMap),menu_window.getUser());
            this.menu_window.getLogin_window().getReservations_map().put(reservation.getId(), reservation);
            System.out.println("Instance of BookReservation " + reservation.getUser().getUsername());
        }
       
        this.menu_window.setVisible(true);
        this.dispose();
       
View Full Code Here

Examples of classes.Reservation

                                         @PathParam("id") Long id) {

        DAO db = DAO.getInstance();
        ResponseBuilder builder = null;

        Reservation newReservation = reservation.getValue();

        /* means that the ID of the reservation was included in link
         * so i will update this reservation => the xml file does not
         * need to have the resrvation id in his content otherwise it has to
         */
        if (id != null && id.equals(newReservation.getId())) {
            newReservation.setId(id);
        } else {
            builder = Response.status(Response.Status.BAD_REQUEST).
                    entity(HandlingMessage("Error", "error",
                                           "The ID of the reservation is not valid or don't exists!"
                    + "The mentioned id should be the same with the one from"
View Full Code Here

Examples of com.amazonaws.services.ec2.model.Reservation

  public static List<Instance> loadInstances() {
    List<Instance> resultList = new ArrayList<Instance>();
    DescribeInstancesResult describeInstancesResult = getEC2Client().describeInstances();
    List<Reservation> reservations = describeInstancesResult.getReservations();
    for (Iterator<Reservation> iterator = reservations.iterator(); iterator.hasNext();) {
      Reservation reservation = iterator.next();
      for (Instance instance : reservation.getInstances()) {
        resultList.add(instance);
      }
    }
    return resultList;
  }
View Full Code Here

Examples of com.amazonaws.services.ec2.model.Reservation

    public static List<Instance> loadInstances() {
        List<Instance> resultList = new ArrayList<Instance>();
        DescribeInstancesResult describeInstancesResult = getEC2Client().describeInstances();
        List<Reservation> reservations = describeInstancesResult.getReservations();
        for (Iterator<Reservation> iterator = reservations.iterator(); iterator.hasNext();) {
            Reservation reservation = iterator.next();
            for (Instance instance : reservation.getInstances()) {
                resultList.add(instance);
            }
        }
        return resultList;
    }
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.