Class MattermostNotificationWorkflowOperationHandler
java.lang.Object
org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
org.opencastproject.workflow.handler.mattermost.notification.MattermostNotificationWorkflowOperationHandler
- All Implemented Interfaces:
WorkflowOperationHandler
public class MattermostNotificationWorkflowOperationHandler
extends AbstractWorkflowOperationHandler
Workflow operation for notifying Mattermost about the status of the current workflow.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
AbstractWorkflowOperationHandler.Configuration -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the subject HTTP parameterstatic final intDefault time between two request attempts in millisecondsstatic final StringConfiguration key for the maximal attempts for the notification requeststatic final StringConfiguration key for the HTTP method to use (put or post)static final StringConfiguration key for the notification messagestatic final StringConfiguration key for the request timeout in millisecondsstatic final StringConfiguration key for the target URL of the notification requeststatic final StringHTTP method POSTstatic final StringHTTP method PUTstatic final intThe scale factor to the sleep time between two notification attemptsFields inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
asList, description, id, serviceRegistry, SOURCE_FLAVOR, SOURCE_FLAVORS, SOURCE_TAG, SOURCE_TAGS, TARGET_FLAVOR, TARGET_FLAVORS, TARGET_TAG, TARGET_TAGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstart(WorkflowInstance workflowInstance, JobContext context) Runs the workflow operation on thisWorkflowInstance.Methods inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
activate, asList, cfgKeyMissing, createResult, createResult, createResult, createResult, destroy, equals, getCfg, getConfig, getConfig, getConfig, getDescription, getFileNameFromElements, getId, getOptConfig, getOptConfig, getTagsAndFlavors, hashCode, setJobBarrierPollingInterval, setServiceRegistry, skip, toString, waitForStatus, waitForStatus
-
Field Details
-
OPT_URL_PATH
Configuration key for the target URL of the notification request- See Also:
-
OPT_NOTIFICATION_MESSAGE
Configuration key for the notification message- See Also:
-
OPT_METHOD
Configuration key for the HTTP method to use (put or post)- See Also:
-
OPT_MAX_RETRY
Configuration key for the maximal attempts for the notification request- See Also:
-
OPT_TIMEOUT
Configuration key for the request timeout in milliseconds- See Also:
-
HTTP_PARAM_PAYLOAD
Name of the subject HTTP parameter- See Also:
-
POST
HTTP method POST- See Also:
-
PUT
HTTP method PUT- See Also:
-
INITIAL_SLEEP_TIME
public static final int INITIAL_SLEEP_TIMEDefault time between two request attempts in milliseconds- See Also:
-
SLEEP_SCALE_FACTOR
public static final int SLEEP_SCALE_FACTORThe scale factor to the sleep time between two notification attempts- See Also:
-
-
Constructor Details
-
MattermostNotificationWorkflowOperationHandler
public MattermostNotificationWorkflowOperationHandler()
-
-
Method Details
-
start
public WorkflowOperationResult start(WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException Runs the workflow operation on thisWorkflowInstance. If the execution fails for some reason, this must throw aWorkflowOperationExceptionin order to handle the problem gracefully. Runtime exceptions will cause the entire workflow instance to fail.- Specified by:
startin interfaceWorkflowOperationHandler- Specified by:
startin classAbstractWorkflowOperationHandler- Parameters:
workflowInstance- the workflow instancecontext- the job context- Returns:
- the
WorkflowOperationResultcontaining a potentially modified MediaPackage and whether to put the workflow instance into a wait state. - Throws:
WorkflowOperationException- If the workflow operation fails to execute properly, and the default error handling should be invoked.- See Also:
-