public class GluttonClient extends CrossrefClient
Modifier and Type | Field and Description |
---|---|
static Logger |
logger |
executorService, futures, limitAuto, timedSemaphore
Modifier and Type | Method and Description |
---|---|
static GluttonClient |
getInstance() |
static void |
printLog(GluttonRequest<?> request,
java.lang.String message) |
<T> void |
pushRequest(GluttonRequest<T> request,
CrossrefRequestListener<T> listener,
long threadId)
Push a request in pool to be executed as soon as possible, then wait a response through the listener.
|
<T> void |
pushRequest(java.lang.String model,
java.util.Map<java.lang.String,java.lang.String> params,
CrossrefDeserializer<T> deserializer,
long threadId,
CrossrefRequestListener<T> listener)
Push a request in pool to be executed soon as possible, then wait a response through the listener.
|
checkLimits, close, finish, printLog, pushRequest, setLimits, updateLimits
public static GluttonClient getInstance()
public static void printLog(GluttonRequest<?> request, java.lang.String message)
public <T> void pushRequest(GluttonRequest<T> request, CrossrefRequestListener<T> listener, long threadId) throws java.net.URISyntaxException, ClientProtocolException, java.io.IOException
java.net.URISyntaxException
ClientProtocolException
java.io.IOException
public <T> void pushRequest(java.lang.String model, java.util.Map<java.lang.String,java.lang.String> params, CrossrefDeserializer<T> deserializer, long threadId, CrossrefRequestListener<T> listener) throws java.net.URISyntaxException, ClientProtocolException, java.io.IOException
pushRequest
in class CrossrefClient
params
- query parameters, can be null, ex: ?query.title=[title]&query.author=[author]deserializer
- json response deserializer, ex: WorkDeserializer to convert Work to BiblioItemthreadId
- the java identifier of the thread providing the request (e.g. via Thread.currentThread().getId())listener
- catch response from requestjava.net.URISyntaxException
ClientProtocolException
java.io.IOException