public class TargetHostsBuilder extends java.lang.Object implements ITargetHostsBuilder
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
logger
The logger.
|
| Constructor and Description |
|---|
TargetHostsBuilder()
Instantiates a new target hosts builder.
|
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
getContentFromPath(java.lang.String sourcePath,
HostsSourceType sourceType)
note that for read from file, this will just load all to memory.
|
java.util.List<java.lang.String> |
setTargetHostsFromCmsQueryUrl(java.lang.String cmsQueryUrl)
Sets the target hosts from cms query url.
|
java.util.List<java.lang.String> |
setTargetHostsFromCmsQueryUrl(java.lang.String cmsQueryUrl,
java.lang.String projection)
Sets the target hosts from cms query url.
|
java.util.List<java.lang.String> |
setTargetHostsFromJsonPath(java.lang.String jsonPath,
java.lang.String sourcePath,
HostsSourceType sourceType)
TODO https://github.com/jayway/JsonPath
|
java.util.List<java.lang.String> |
setTargetHostsFromLineByLineText(java.lang.String sourcePath,
HostsSourceType sourceType)
get target hosts from line by line.
|
java.util.List<java.lang.String> |
setTargetHostsFromList(java.util.List<java.lang.String> targetHosts)
Sets the target hosts from list.
|
java.util.List<java.lang.String> |
setTargetHostsFromString(java.lang.String targetHostsStr)
Sets the target hosts from string.
|
public TargetHostsBuilder()
private java.lang.String getContentFromPath(java.lang.String sourcePath,
HostsSourceType sourceType)
throws java.io.IOException
sourcePath - the source pathsourceType - the source typejava.io.IOException - Signals that an I/O exception has occurred.public java.util.List<java.lang.String> setTargetHostsFromList(java.util.List<java.lang.String> targetHosts)
ITargetHostsBuildersetTargetHostsFromList in interface ITargetHostsBuildertargetHosts - the target hostspublic java.util.List<java.lang.String> setTargetHostsFromString(java.lang.String targetHostsStr)
ITargetHostsBuildersetTargetHostsFromString in interface ITargetHostsBuildertargetHostsStr - the target hosts strpublic java.util.List<java.lang.String> setTargetHostsFromJsonPath(java.lang.String jsonPath,
java.lang.String sourcePath,
HostsSourceType sourceType)
throws TargetHostsLoadException
setTargetHostsFromJsonPath in interface ITargetHostsBuilderjsonPath - the json pathsourcePath - the source pathsourceType - the source typeTargetHostsLoadException - the target hosts load exceptionpublic java.util.List<java.lang.String> setTargetHostsFromLineByLineText(java.lang.String sourcePath,
HostsSourceType sourceType)
throws TargetHostsLoadException
setTargetHostsFromLineByLineText in interface ITargetHostsBuildersourcePath - the source pathsourceType - the source typeTargetHostsLoadException - the target hosts load exceptionpublic java.util.List<java.lang.String> setTargetHostsFromCmsQueryUrl(java.lang.String cmsQueryUrl)
throws TargetHostsLoadException
ITargetHostsBuildersetTargetHostsFromCmsQueryUrl in interface ITargetHostsBuildercmsQueryUrl - the cms query urlTargetHostsLoadException - the target hosts load exceptionpublic java.util.List<java.lang.String> setTargetHostsFromCmsQueryUrl(java.lang.String cmsQueryUrl,
java.lang.String projection)
ITargetHostsBuildersetTargetHostsFromCmsQueryUrl in interface ITargetHostsBuildercmsQueryUrl - the cms query urlprojection - the projection