public class HttpPollerProcessor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
failureRegex
The failure regex.
|
private java.lang.String |
jobIdPlaceHolder
The job id place holder.
|
private java.lang.String |
jobIdRegex
The job id regex.
|
private static org.slf4j.Logger |
logger
The logger.
|
private int |
maxPollError
The max poll error.
|
private java.lang.String |
pollerRequestTemplate
The poller request template.
|
private java.lang.String |
pollerType
The poller type.
|
private long |
pollIntervalMillis
The poll interval millis.
|
private java.lang.String |
progressRegex
The progress regex.
|
private int |
progressStuckTimeoutSeconds
The progress stuck timeout seconds.
|
private java.lang.String |
successRegex
The success regex.
|
Constructor and Description |
---|
HttpPollerProcessor()
default as the cronus agent poller
Assuming the polling API is By HTTP GET; without any postbody (for GET, no
post body for sure)
|
HttpPollerProcessor(java.lang.String pollerType,
java.lang.String successRegex,
java.lang.String failureRegex,
java.lang.String uuidRegex,
java.lang.String progressRegex,
int progressStuckTimeoutSeconds,
long pollIntervalMillis,
java.lang.String pollerRequestTemplate,
java.lang.String jobIdPlaceHolder,
int maxPollError)
Instantiates a new http poller processor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFailureRegex()
Gets the failure regex.
|
java.lang.String |
getJobIdPlaceHolder()
Gets the job id place holder.
|
java.lang.String |
getJobIdRegex()
Gets the job id regex.
|
int |
getMaxPollError()
Gets the max poll error.
|
java.lang.String |
getPollerRequestTemplate()
Gets the poller request template.
|
java.lang.String |
getPollerRequestUrl(java.lang.String uuid)
Important.
|
java.lang.String |
getPollerType()
Gets the poller type.
|
long |
getPollIntervalMillis()
Gets the poll interval millis.
|
double |
getProgressFromResponse(ResponseOnSingeRequest myResponse)
Gets the progress from response.
|
java.lang.String |
getProgressRegex()
Gets the progress regex.
|
int |
getProgressStuckTimeoutSeconds()
Gets the progress stuck timeout seconds.
|
java.lang.String |
getUuidFromResponse(ResponseOnSingeRequest myResponse)
Gets the uuid from response.
|
boolean |
ifTaskCompletedSuccessOrFailureFromResponse(ResponseOnSingeRequest myResponse)
If task completed success or failure from response.
|
boolean |
ifThereIsErrorInResponse(ResponseOnSingeRequest myResponse)
If there is error in response.
|
void |
setFailureRegex(java.lang.String failureRegex)
Sets the failure regex.
|
void |
setJobIdPlaceHolder(java.lang.String jobIdPlaceHolder)
Sets the job id place holder.
|
void |
setJobIdRegex(java.lang.String jobIdRegex)
Sets the job id regex.
|
void |
setMaxPollError(int maxPollError)
Sets the max poll error.
|
void |
setPollerRequestTemplate(java.lang.String pollerRequestTemplate)
Sets the poller request template.
|
void |
setPollerType(java.lang.String pollerType)
Sets the poller type.
|
void |
setPollIntervalMillis(long pollIntervalMillis)
Sets the poll interval millis.
|
void |
setProgressRegex(java.lang.String progressRegex)
Sets the progress regex.
|
void |
setProgressStuckTimeoutSeconds(int progressStuckTimeoutSeconds)
Sets the progress stuck timeout seconds.
|
java.lang.String |
toString() |
private static org.slf4j.Logger logger
private java.lang.String pollerType
private java.lang.String successRegex
private java.lang.String failureRegex
private java.lang.String jobIdRegex
private java.lang.String progressRegex
private int progressStuckTimeoutSeconds
private int maxPollError
private long pollIntervalMillis
private java.lang.String pollerRequestTemplate
private java.lang.String jobIdPlaceHolder
public HttpPollerProcessor()
public HttpPollerProcessor(java.lang.String pollerType, java.lang.String successRegex, java.lang.String failureRegex, java.lang.String uuidRegex, java.lang.String progressRegex, int progressStuckTimeoutSeconds, long pollIntervalMillis, java.lang.String pollerRequestTemplate, java.lang.String jobIdPlaceHolder, int maxPollError)
pollerType
- the poller typesuccessRegex
- the success regexfailureRegex
- the failure regexuuidRegex
- the uuid regexprogressRegex
- the progress regexprogressStuckTimeoutSeconds
- the progress stuck timeout secondspollIntervalMillis
- the poll interval millispollerRequestTemplate
- the poller request templatejobIdPlaceHolder
- the job id place holdermaxPollError
- the max poll errorpublic java.lang.String getPollerRequestUrl(java.lang.String uuid)
uuid
- the uuidpublic long getPollIntervalMillis()
public void setPollIntervalMillis(long pollIntervalMillis)
pollIntervalMillis
- the new poll interval millispublic java.lang.String getPollerRequestTemplate()
public void setPollerRequestTemplate(java.lang.String pollerRequestTemplate)
pollerRequestTemplate
- the new poller request templatepublic java.lang.String getUuidFromResponse(ResponseOnSingeRequest myResponse)
myResponse
- the my responsepublic double getProgressFromResponse(ResponseOnSingeRequest myResponse)
myResponse
- the my responsepublic boolean ifThereIsErrorInResponse(ResponseOnSingeRequest myResponse)
myResponse
- the my responsepublic boolean ifTaskCompletedSuccessOrFailureFromResponse(ResponseOnSingeRequest myResponse)
myResponse
- the my responsepublic java.lang.String getPollerType()
public void setPollerType(java.lang.String pollerType)
pollerType
- the new poller typepublic java.lang.String getFailureRegex()
public void setFailureRegex(java.lang.String failureRegex)
failureRegex
- the new failure regexpublic java.lang.String getProgressRegex()
public void setProgressRegex(java.lang.String progressRegex)
progressRegex
- the new progress regexpublic int getProgressStuckTimeoutSeconds()
public void setProgressStuckTimeoutSeconds(int progressStuckTimeoutSeconds)
progressStuckTimeoutSeconds
- the new progress stuck timeout secondspublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getJobIdPlaceHolder()
public void setJobIdPlaceHolder(java.lang.String jobIdPlaceHolder)
jobIdPlaceHolder
- the new job id place holderpublic java.lang.String getJobIdRegex()
public void setJobIdRegex(java.lang.String jobIdRegex)
jobIdRegex
- the new job id regexpublic int getMaxPollError()
public void setMaxPollError(int maxPollError)
maxPollError
- the new max poll error