public class SimpleHTTPPostPersistWriter extends Object implements StreamsPersistWriter
Modifier and Type | Field and Description |
---|---|
protected String |
authHeader |
protected HttpPersistWriterConfiguration |
configuration |
protected org.apache.http.impl.client.CloseableHttpClient |
httpclient |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected org.apache.http.client.utils.URIBuilder |
uriBuilder |
Constructor and Description |
---|
SimpleHTTPPostPersistWriter() |
SimpleHTTPPostPersistWriter(HttpPersistWriterConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
protected com.fasterxml.jackson.databind.node.ObjectNode |
executePost(org.apache.http.client.methods.HttpPost httpPost) |
String |
getId() |
void |
prepare(Object configurationObject) |
org.apache.http.client.methods.HttpPost |
prepareHttpPost(URI uri,
com.fasterxml.jackson.databind.node.ObjectNode payload)
Override this to add headers to the request.
|
protected Map<String,String> |
prepareParams(StreamsDatum entry)
Override this to add parameters to the request.
|
protected com.fasterxml.jackson.databind.node.ObjectNode |
preparePayload(StreamsDatum entry)
Override this to alter json payload on to the request.
|
protected URI |
prepareURI(Map<String,String> params)
Override this to alter request URI.
|
void |
write(StreamsDatum entry) |
protected com.fasterxml.jackson.databind.ObjectMapper mapper
protected org.apache.http.client.utils.URIBuilder uriBuilder
protected org.apache.http.impl.client.CloseableHttpClient httpclient
protected HttpPersistWriterConfiguration configuration
protected String authHeader
public SimpleHTTPPostPersistWriter()
public SimpleHTTPPostPersistWriter(HttpPersistWriterConfiguration configuration)
public String getId()
getId
in interface StreamsOperation
public void write(StreamsDatum entry)
write
in interface StreamsPersistWriter
protected Map<String,String> prepareParams(StreamsDatum entry)
protected com.fasterxml.jackson.databind.node.ObjectNode preparePayload(StreamsDatum entry) throws Exception
Exception
public org.apache.http.client.methods.HttpPost prepareHttpPost(URI uri, com.fasterxml.jackson.databind.node.ObjectNode payload)
protected com.fasterxml.jackson.databind.node.ObjectNode executePost(org.apache.http.client.methods.HttpPost httpPost)
public void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void cleanUp()
cleanUp
in interface StreamsOperation
Copyright © 2012–2016 The Apache Software Foundation. All rights reserved.