public class DataConsumer extends Object
Constructor and Description |
---|
DataConsumer()
Public default constructor
|
Modifier and Type | Method and Description |
---|---|
DataConsumer |
addDataTransformer(DataTransformer dc)
Adds a data transformer to the end of the data transformers list
|
DataConsumer |
addDataWriter(DataWriter ow)
Adds a DataWriter to the end of the dataWriters list
|
int |
consume(Map<String,String> initialVars)
Consumes a produced result.
|
DataPipe |
getDataPipe() |
AtomicBoolean |
getExitFlag() |
long |
getMaxNumberOfLines() |
String |
getReportingHost() |
Future<String> |
sendRequest(String path)
Creates a future for sending a request to the reporting host and ignoring
the response.
|
Future<String> |
sendRequest(String path,
ReportingHandler reportingHandler)
Creates a future that will send a request to the reporting host and call
the handler with the response
|
String |
sendRequestSync(String path)
Sends a synchronous request to the reporting host returning the response
|
DataConsumer |
setExitFlag(AtomicBoolean flag)
Setter for exit flag
|
DataConsumer |
setMaxNumberOfLines(long maxNumberOfLines)
A setter for maxNumberOfLines
|
DataConsumer |
setReportingHost(String reportingHost)
A setter for the reporting host
|
List<Map<String,String>> |
transformAndReturn(Map<String,String> initialVars)
Consumes a produced result.
|
public DataConsumer addDataTransformer(DataTransformer dc)
dc
- a reference to a DataTransformerpublic DataConsumer addDataWriter(DataWriter ow)
ow
- a reference to a data writerpublic DataConsumer setReportingHost(String reportingHost)
reportingHost
- a String containing the URL of the reporting hostpublic DataConsumer setMaxNumberOfLines(long maxNumberOfLines)
maxNumberOfLines
- the max number of linespublic DataConsumer setExitFlag(AtomicBoolean flag)
flag
- a reference to an AtomicBooleanpublic AtomicBoolean getExitFlag()
public long getMaxNumberOfLines()
public String getReportingHost()
public DataPipe getDataPipe()
public int consume(Map<String,String> initialVars)
initialVars
- a map containing the initial variables assignmentspublic List<Map<String,String>> transformAndReturn(Map<String,String> initialVars)
initialVars
- a map containing the initial variables assignmentspublic Future<String> sendRequest(String path)
path
- the path at the reporting host where the request should be
sentFuture
that wraps this activitypublic Future<String> sendRequest(String path, ReportingHandler reportingHandler)
path
- the path at the reporting host which the request will be madereportingHandler
- the handler to receive the response once executed
and recievedFuture
for handing the requestCopyright © 2016. All rights reserved.