public class SimpleHttpProvider extends Object implements StreamsProvider
Modifier and Type | Field and Description |
---|---|
protected HttpProviderConfiguration |
configuration |
protected org.apache.http.impl.client.CloseableHttpClient |
httpclient |
protected ReadWriteLock |
lock |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected Queue<StreamsDatum> |
providerQueue |
protected org.apache.http.client.utils.URIBuilder |
uriBuilder |
Constructor and Description |
---|
SimpleHttpProvider()
SimpleHttpProvider constructor - resolves HttpProcessorConfiguration from JVM 'http'.
|
SimpleHttpProvider(HttpProviderConfiguration providerConfiguration)
SimpleHttpProvider constructor - uses provided HttpProviderConfiguration.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
String |
getId() |
boolean |
isRunning() |
protected List<com.fasterxml.jackson.databind.node.ObjectNode> |
parse(com.fasterxml.jackson.databind.JsonNode jsonNode)
Override this to change how entity gets converted to objects.
|
void |
prepare(Object configurationObject) |
org.apache.http.client.methods.HttpRequestBase |
prepareHttpRequest(URI uri)
prepareHttpRequest
|
protected Map<String,String> |
prepareParams(StreamsDatum entry)
Override this to add parameters to the request.
|
StreamsResultSet |
readCurrent() |
StreamsResultSet |
readNew(BigInteger sequence) |
StreamsResultSet |
readRange(org.joda.time.DateTime start,
org.joda.time.DateTime end) |
protected void |
shutdownAndAwaitTermination(ExecutorService pool) |
void |
startStream() |
protected com.fasterxml.jackson.databind.ObjectMapper mapper
protected org.apache.http.client.utils.URIBuilder uriBuilder
protected org.apache.http.impl.client.CloseableHttpClient httpclient
protected HttpProviderConfiguration configuration
protected volatile Queue<StreamsDatum> providerQueue
protected final ReadWriteLock lock
public SimpleHttpProvider()
public SimpleHttpProvider(HttpProviderConfiguration providerConfiguration)
public String getId()
getId
in interface StreamsOperation
protected Map<String,String> prepareParams(StreamsDatum entry)
public org.apache.http.client.methods.HttpRequestBase prepareHttpRequest(URI uri)
uri
- uripublic void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void cleanUp()
cleanUp
in interface StreamsOperation
public void startStream()
startStream
in interface StreamsProvider
public StreamsResultSet readCurrent()
readCurrent
in interface StreamsProvider
protected List<com.fasterxml.jackson.databind.node.ObjectNode> parse(com.fasterxml.jackson.databind.JsonNode jsonNode)
public StreamsResultSet readNew(BigInteger sequence)
readNew
in interface StreamsProvider
public StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange
in interface StreamsProvider
public boolean isRunning()
isRunning
in interface StreamsProvider
protected void shutdownAndAwaitTermination(ExecutorService pool)
Copyright © 2017 The Apache Software Foundation. All rights reserved.