public class Client
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Client.Builder
Builder provide structure to the construction of a
Client |
| Modifier and Type | Field and Description |
|---|---|
static com.google.api.control.Client.SchedulerFactory |
DEFAULT_SCHEDULER_FACTORY |
static int |
DO_NOT_LOG_STATS |
| Constructor and Description |
|---|
Client(java.lang.String serviceName,
CheckAggregationOptions checkOptions,
ReportAggregationOptions reportOptions,
QuotaAggregationOptions quotaOptions,
com.google.api.services.servicecontrol.v1.ServiceControl transport,
java.util.concurrent.ThreadFactory threads,
com.google.api.control.Client.SchedulerFactory schedulers,
int statsLogFrequency,
com.google.common.base.Ticker ticker) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.servicecontrol.v1.AllocateQuotaResponse |
allocateQuota(com.google.api.servicecontrol.v1.AllocateQuotaRequest req) |
com.google.api.servicecontrol.v1.CheckResponse |
check(com.google.api.servicecontrol.v1.CheckRequest req)
Process a check request.
|
void |
report(com.google.api.servicecontrol.v1.ReportRequest req)
Process a report request.
|
void |
start()
Starts processing.
|
void |
stop()
Stops processing.
|
public static final int DO_NOT_LOG_STATS
public static final com.google.api.control.Client.SchedulerFactory DEFAULT_SCHEDULER_FACTORY
public Client(java.lang.String serviceName,
CheckAggregationOptions checkOptions,
ReportAggregationOptions reportOptions,
QuotaAggregationOptions quotaOptions,
com.google.api.services.servicecontrol.v1.ServiceControl transport,
java.util.concurrent.ThreadFactory threads,
com.google.api.control.Client.SchedulerFactory schedulers,
int statsLogFrequency,
@Nullable
com.google.common.base.Ticker ticker)
public void start()
IllegalStateError.public void stop()
@Nullable public com.google.api.servicecontrol.v1.CheckResponse check(com.google.api.servicecontrol.v1.CheckRequest req)
req is first passed to the CheckAggregator. If there is a valid cached
response, that is returned, otherwise a response is obtained from the transport.req - a CheckRequestCheckResponse or null if none was cached and there was a transport
failurepublic com.google.api.servicecontrol.v1.AllocateQuotaResponse allocateQuota(com.google.api.servicecontrol.v1.AllocateQuotaRequest req)
public void report(com.google.api.servicecontrol.v1.ReportRequest req)
req is first passed to the ReportAggregator. It will either be aggregated
with prior requests or sent immediatelyreq - a ReportRequest