Пример #1
0
  public static RateLimit rndRateLimit() {
    Ticket ticket = new Ticket();
    ticket.setTicketId("1234");
    ticket.setComment("My first ticket! Yuppee!");

    RateLimit rl = new RateLimit();
    rl.setExpirationTime(Calendar.getInstance());
    rl.setMaxRequestsPerSecond(rndInt(0, 60));
    rl.setTicket(ticket);
    return rl;
  }
Пример #2
0
  public static Suspension getLoadBalancerSuspensionDetails(
      String reason, int ticketId, String user) {
    Suspension suspension = new Suspension();

    Ticket ticket = new Ticket();
    ticket.setTicketId("1234");
    ticket.setComment("My first ticket! Yuppee!");

    suspension.setReason(reason);
    suspension.setTicket(ticket);
    suspension.setUser(user);
    return suspension;
  }
Пример #3
0
  public static RateLimit getRateLimitDetails(int ticketId, int maxRequestsPerSecond)
      throws ParseException {

    RateLimit rl = new RateLimit();

    Ticket ticket = new Ticket();
    ticket.setTicketId("1234");
    ticket.setComment("My first ticket! Yuppee!");

    rl.setExpirationTime(Calendar.getInstance());
    rl.setMaxRequestsPerSecond(ticketId);
    rl.setTicket(ticket);
    return rl;
  }