コード例 #1
0
ファイル: StubFactory.java プロジェクト: RamGanesh/atlas-lb
  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
ファイル: StubFactory.java プロジェクト: RamGanesh/atlas-lb
  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
ファイル: StubFactory.java プロジェクト: RamGanesh/atlas-lb
  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;
  }