@groovy.util.logging.Slf4j @groovy.transform.CompileStatic class WebLogObserver extends java.lang.Object
Send out messages via HTTP to a configured URL on different workflow execution events.
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
DEF_URL |
The default url is localhost |
Constructor and description |
---|
WebLogObserver
(java.lang.String url) Constructor that consumes a URL and creates a basic HTTP client. |
protected WebLogObserver
() only for testing purpose -- do not use |
Type Params | Return Type | Name and description |
---|---|---|
|
protected void |
asyncHttpMessage(java.lang.String event, java.lang.Object payload = null) Asynchronous HTTP POST request wrapper. |
|
protected java.lang.String |
checkUrl(java.lang.String url) Check the URL and create an HttpPost() object. |
|
protected static WebLogObserver.FlowPayload |
createFlowPayloadFromSession(Session session) |
|
protected void |
logHttpResponse() Little helper function that can be called for logging upon an incoming HTTP response |
|
void |
onFlowComplete() Send an HTTP message when the workflow is completed. |
|
void |
onFlowCreate(Session session) On workflow start, submit a message with some basic information, like Id, activity and an ISO 8601 formatted timestamp. |
|
void |
onFlowError(TaskHandler handler, TraceRecord trace) Send an HTTP message, when a workflow has failed |
|
void |
onProcessComplete(TaskHandler handler, TraceRecord trace) Send an HTTP message, when a process completed |
|
void |
onProcessStart(TaskHandler handler, TraceRecord trace) Send an HTTP message, when a process has started |
|
void |
onProcessSubmit(TaskHandler handler, TraceRecord trace) Send an HTTP message when a process has been submitted |
|
protected void |
sendHttpMessage(java.lang.String event, java.lang.Object payload = null) Little helper method that sends a HTTP POST message as JSON with the current run status, ISO 8601 UTC timestamp, run name and the TraceRecord object, if present. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor that consumes a URL and creates a basic HTTP client.
url
- The target address for sending messages toonly for testing purpose -- do not use
Asynchronous HTTP POST request wrapper.
event
- The workflow run statuspayload
- An additional object to send. Must be of type TraceRecord or ManifestCheck the URL and create an HttpPost() object. If a invalid i.e. protocol is used, the constructor will raise an exception. The RegEx was taken and adapted from http://urlregex.com
url
- String with target URLLittle helper function that can be called for logging upon an incoming HTTP response
Send an HTTP message when the workflow is completed.
On workflow start, submit a message with some basic information, like Id, activity and an ISO 8601 formatted timestamp.
session
- The current Nextflow session objectSend an HTTP message, when a workflow has failed
handler
- A TaskHandler object representing the task that caused the workflow execution to fail (it may be null)trace
- A TraceRecord object holding the task metadata and runtime info (it may be null)Send an HTTP message, when a process completed
handler
- A TaskHandler object representing the task completedtrace
- A TraceRecord object holding the task metadata and runtime infoSend an HTTP message, when a process has started
handler
- A TaskHandler object representing the task startedtrace
- A TraceRecord object holding the task metadata and runtime infoSend an HTTP message when a process has been submitted
handler
- A TaskHandler object representing the task submittedtrace
- A TraceRecord object holding the task metadata and runtime infoLittle helper method that sends a HTTP POST message as JSON with the current run status, ISO 8601 UTC timestamp, run name and the TraceRecord object, if present.
event
- The current run status. One of {'started', 'process_submit', 'process_start',
'process_complete', 'error', 'completed'}payload
- An additional object to send. Must be of type TraceRecord or Manifest