コード例 #1
0
  public boolean registerPayment(Argument Status, Argument TravelAgencyPayment) {
    String payment = Status.getValue() + "|" + TravelAgencyPayment.getValue();

    addMessageTraceQueue("acquire", "travelAgency", "approval", payment);

    return true;
  }
コード例 #2
0
 public boolean searchResult(
     Argument FlightStatus, Argument FlightID, Argument FlightPrice, Argument AirlineName) {
   String received =
       FlightStatus.getValue()
           + "|"
           + FlightID.getValue()
           + "|"
           + FlightPrice.getValue()
           + "|"
           + AirlineName.getValue();
   addMessageTraceQueue("airline", "travelAgency", "response", received);
   return true;
 }
コード例 #3
0
  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;
  }
コード例 #4
0
  public boolean buildResponse(
      Argument FlightStatus, Argument FlightID, Argument FlightPrice, Argument AirlineName) {
    String received =
        FlightStatus.getValue()
            + "|"
            + FlightID.getValue()
            + "|"
            + FlightPrice.getValue()
            + "|"
            + AirlineName.getValue();
    okQueue.addMessage("flights");

    return true;
  }
コード例 #5
0
  public boolean emitNotificationTA(Argument Status, Argument Statement) {

    String notification = Status.getValue().toString();
    Statement.setValue(notification);

    addMessageTraceQueue("acquire", "travelAgency", "notificationTA", notification);

    return true;
  }
コード例 #6
0
  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;
  }
コード例 #7
0
  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;
  }
コード例 #8
0
 public boolean registerUser(Argument Name, Argument CcNumber) {
   name = Name.getValue().toString();
   String body = Name.getValue() + "|" + CcNumber.getValue();
   client.POST("/users", body);
   return true;
 }
コード例 #9
0
  public boolean confirmCancellation(Argument Reserve) {
    String info = Reserve.getValue().toString();

    Reserve.setValue(info);
    return true;
  }