public abstract class AbstractOutputWriter extends Object implements OutputWriter
OutputWriter.| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
static String |
SETTING_HOST |
static String |
SETTING_NAME_PREFIX |
static String |
SETTING_PORT |
static String |
SETTING_PROTOCOL |
static String |
SETTING_PROXY_HOST |
static String |
SETTING_PROXY_PORT |
static String |
SETTING_TOKEN |
static String |
SETTING_URL |
static String |
SETTING_USERNAME |
| Constructor and Description |
|---|
AbstractOutputWriter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
protected boolean |
getBooleanSetting(String name,
boolean defaultValue)
Convert value of this setting to a Java boolean (via
Boolean.parseBoolean(String)). |
protected int |
getIntSetting(String name)
Convert value of this setting to a Java int.
|
protected int |
getIntSetting(String name,
int defaultValue)
Convert value of this setting to a Java int.
|
protected long |
getLongSetting(String name,
long defaultValue)
Convert value of this setting to a Java long.
|
Map<String,Object> |
getSettings()
Configuration settings of the OutputWriter.
|
ResultNameStrategy |
getStrategy() |
protected String |
getStringSetting(String name)
Convert value of this setting to a Java int.
|
protected String |
getStringSetting(String name,
String defaultValue)
Return the value of the given property.
|
int |
hashCode() |
boolean |
isEnabled() |
void |
setEnabled(boolean enabled) |
void |
setSettings(Map<String,Object> settings)
Sets the configuration setting of the OutputWriter.
|
void |
setStrategy(ResultNameStrategy strategy) |
void |
start()
No-op implementation
|
void |
stop()
No-op implementation
|
String |
toString() |
abstract void |
write(Iterable<QueryResult> results)
Write all the given QueryResult to the target system.
|
public static final String SETTING_URL
public static final String SETTING_USERNAME
public static final String SETTING_TOKEN
public static final String SETTING_PORT
public static final String SETTING_HOST
public static final String SETTING_PROXY_PORT
public static final String SETTING_PROXY_HOST
public static final String SETTING_NAME_PREFIX
public static final String SETTING_PROTOCOL
protected final org.slf4j.Logger logger
public void start()
start in interface OutputWriterpublic void stop()
throws Exception
stop in interface OutputWriterExceptionprotected int getIntSetting(String name) throws IllegalArgumentException
name - name of the setting / propertyIllegalArgumentException - if setting is not found or is not an integer.protected int getIntSetting(String name, int defaultValue) throws IllegalArgumentException
defaultValue is returned. If the property is not an int, an exception is thrown.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.IllegalArgumentException - if setting is not is not an integer.protected long getLongSetting(String name, long defaultValue) throws IllegalArgumentException
defaultValue is returned. If the property is not a long, an exception is thrown.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.IllegalArgumentException - if setting is not is not a long.protected boolean getBooleanSetting(String name, boolean defaultValue)
Boolean.parseBoolean(String)).
If the property is not found, the defaultValue is returned.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.protected String getStringSetting(String name) throws IllegalArgumentException
name - name of the propertyIllegalArgumentException - if setting is not found.protected String getStringSetting(String name, String defaultValue)
defaultValue is returned.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.public abstract void write(Iterable<QueryResult> results)
OutputWriterwrite in interface OutputWriterpublic Map<String,Object> getSettings()
OutputWritergetSettings in interface OutputWriterpublic void setSettings(Map<String,Object> settings)
OutputWritersetSettings in interface OutputWriterpublic ResultNameStrategy getStrategy()
public void setStrategy(ResultNameStrategy strategy)
public boolean isEnabled()
isEnabled in interface OutputWriterpublic void setEnabled(boolean enabled)
setEnabled in interface OutputWriterCopyright © 2015. All Rights Reserved.