public boolean catchUserData( Argument Reserve, Argument Name, Argument CcNumber, Argument TotalPrice) { String resource = name.replace(" ", "%20"); String ccNumber = client.GET("/users?name=" + resource); Name.setValue(name); CcNumber.setValue(ccNumber); String reserveCode = Reserve.getValue().toString().toLowerCase(); String response = client.GET("/reserves/" + reserveCode); StringTokenizer parser = new StringTokenizer(response, "|"); parser.nextToken(); parser.nextToken(); TotalPrice.setValue(parser.nextToken()); return true; }
public boolean emitStatement( Argument Reserve, Argument Name, Argument AirlinePayment, Argument Statement) { String resource = name.replace(" ", "%20"); String ccNumber = client.GET("/users?name=" + resource); int value = Integer.parseInt(AirlinePayment.getValue().toString()); value = value + 100; String statement = "Name: " + name + "\n" + "Credit card: " + ccNumber + "\n" + "Value discounted: $" + value; Statement.setValue(statement); return true; }
public boolean travelAgencyRegisterReservation(Argument ReserveCost, Argument Reserve) { StringTokenizer parser = new StringTokenizer(ReserveCost.getValue().toString(), "|"); String id = parser.nextToken(); int value = Integer.parseInt(parser.nextToken()) + 100; String body = id + "|" + name + "|" + value; client.POST("/reserves", body); Reserve.setValue(id); addMessageTraceQueue("airline", "travelAgency", "response", ReserveCost.getValue()); return true; }
public boolean travelAgencyMakesAReservation(Argument FlightID, Argument TravelAgencyID) { String id = client.GET("/name"); TravelAgencyID.setValue(id); return true; }
public boolean registerUser(Argument Name, Argument CcNumber) { name = Name.getValue().toString(); String body = Name.getValue() + "|" + CcNumber.getValue(); client.POST("/users", body); return true; }
public TravelAgencyOKC() { client = new RESTClient(); client.setBaseURL("http://localhost:9881/travelagency"); queue = new MessageTraceQueue(); okQueue = new OKMessagesQueue(); }