public class ChainedURLTask extends URLTask implements java.io.Serializable
ChainedURLTask
class can execute a set of URLs sequentially. The URL execution stops when it
encounters an error in the sequential execution process.URLTask
,
Serialized FormConstructor and Description |
---|
ChainedURLTask() |
Modifier and Type | Method and Description |
---|---|
void |
addUrlTask(URLTask urlTask)
Add an URL task to the list of URLs.
|
java.lang.String |
getCompleteURL()
Get the complete URL of the current execution task.
|
java.lang.String |
getErrorMsg()
Get the error message if any for the current execution task.
|
java.lang.String |
getHost()
Get the host of the current execution task.
|
java.lang.String |
getHostIPAddress()
Get the host IP of the current execution task.
|
java.lang.Long |
getLastTaskStatusUpdateTime()
Get the last update time when there is a change in task status for the current execution task.
|
java.lang.String |
getPath()
Get the URL path of the current execution task.
|
int |
getPort()
Get the port of the current execution task.
|
LightningCoreConstants.TaskStatus |
getStatus()
Get the state of the current execution task.
|
int |
getStatusCode()
Get the HTTP status code of the current execution task.
|
boolean |
hasNext()
Check for more task to be executed in the task list.
|
boolean |
isUseProxyServer()
Check if proxy is enabled for the current execution task.
|
void |
moveToNext()
Move to the next task to be executed in the task list.
|
void |
setErrorMsg(java.lang.String errorMsg)
Set the error message if any for the current execution task.
|
void |
setHostIPAddress(java.lang.String hostIPAddress)
Set the host IP of the current execution task.
|
void |
setLastTaskStatusUpdateTime(java.lang.Long lastTaskStatusUpdateTime)
Set the last update time when there is a change in task status for the current execution task.
|
void |
setStatus(LightningCoreConstants.TaskStatus status)
Set the state of the current execution task.
|
void |
setStatusCode(int statusCode)
Set the HTTP status code of the current execution task.
|
void |
setUseProxyServer(boolean useProxyServer)
Enable proxy for the current execution task.
|
public ChainedURLTask() throws java.net.URISyntaxException
java.net.URISyntaxException
public void addUrlTask(URLTask urlTask)
urlTask
- the URL task to be added to the listpublic LightningCoreConstants.TaskStatus getStatus()
Refer LightningCoreConstants.TaskStatus
on the possible states for the task.
public void setStatus(LightningCoreConstants.TaskStatus status)
Refer LightningCoreConstants.TaskStatus
on the possible states for the task.
public void setStatusCode(int statusCode)
setStatusCode
in class URLTask
statusCode
- the HTTP status code of the current execution taskpublic int getStatusCode()
getStatusCode
in class URLTask
public int getPort()
public java.lang.String getHost()
public java.lang.String getPath()
public boolean isUseProxyServer()
isUseProxyServer
in class URLTask
public void setUseProxyServer(boolean useProxyServer)
setUseProxyServer
in class URLTask
useProxyServer
- enable proxy for the current execution taskpublic java.lang.String getHostIPAddress()
getHostIPAddress
in class URLTask
setUseProxyServer(boolean)
is enabled, the proxy IP
is returned. Or else the host IP is returned.public void setHostIPAddress(java.lang.String hostIPAddress)
setHostIPAddress
in class URLTask
hostIPAddress
- the host IP of the current execution taskpublic java.lang.String getCompleteURL()
getCompleteURL
in class URLTask
public java.lang.String getErrorMsg()
getErrorMsg
in class Task
null
is returnedpublic void setErrorMsg(java.lang.String errorMsg)
setErrorMsg
in class Task
errorMsg
- the error message if any for the current execution taskpublic java.lang.Long getLastTaskStatusUpdateTime()
getLastTaskStatusUpdateTime
in class Task
public void setLastTaskStatusUpdateTime(java.lang.Long lastTaskStatusUpdateTime)
setLastTaskStatusUpdateTime
in class Task
lastTaskStatusUpdateTime
- the last update time when there is a change in task status for the
current execution taskpublic boolean hasNext()
public void moveToNext()
hasNext()
method has to be called before calling this method.