Exemple #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;
  }
Exemple #2
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;
  }