org.jclouds.cloudservers.domain
Class RateLimit

java.lang.Object
  extended by org.jclouds.cloudservers.domain.RateLimit

public class RateLimit
extends Object

RateLimit.

we specify rate limits in terms of both a human readable wild-card URI and a machine processable regular expression. The regular expression boundary matcher '^' takes affect after the root URI path. For example, the regular expression ^/servers would match the bolded portion of the following URI: https://servers.api.rackspacecloud.com/v1.0/3542812 /servers .

Rate limits are applied in order relative to the verb, going from least to most specific. For example, although the threshold for POST to /servers is 25 per day, one cannot POST to /servers more than 10 times within a single minute because the rate limits for any POST is 10/min. In the event you exceed the thresholds established for your identity, a 413 Rate Control HTTP response will be returned with a Reply-After header to notify the client when theyagain.

Author:
Adrian Cole

Nested Class Summary
static class RateLimit.Builder<T extends RateLimit.Builder<T>>
           
 
Constructor Summary
protected RateLimit(String uri, String regex, int remaining, long resetTime, RateLimitUnit unit, int value, String verb)
           
 
Method Summary
static RateLimit.Builder<?> builder()
           
 boolean equals(Object obj)
           
 String getRegex()
           
 int getRemaining()
           
 long getResetTime()
           
 RateLimitUnit getUnit()
           
 String getUri()
           
 int getValue()
           
 String getVerb()
           
 int hashCode()
           
protected  com.google.common.base.Objects.ToStringHelper string()
           
 RateLimit.Builder<?> toBuilder()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RateLimit

@ConstructorProperties(value={"uri","regex","remaining","resetTime","unit","value","verb"})
protected RateLimit(String uri,
                                               @Nullable
                                               String regex,
                                               int remaining,
                                               long resetTime,
                                               @Nullable
                                               RateLimitUnit unit,
                                               int value,
                                               @Nullable
                                               String verb)
Method Detail

builder

public static RateLimit.Builder<?> builder()

toBuilder

public RateLimit.Builder<?> toBuilder()

getUri

public String getUri()

getRegex

@Nullable
public String getRegex()

getRemaining

public int getRemaining()

getResetTime

public long getResetTime()

getUnit

@Nullable
public RateLimitUnit getUnit()

getValue

public int getValue()

getVerb

@Nullable
public String getVerb()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

string

protected com.google.common.base.Objects.ToStringHelper string()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 jclouds. All Rights Reserved.