Class MatrixNotificationWorkflowOperationHandler
java.lang.Object
org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
org.opencastproject.workflow.handler.matrix.MatrixNotificationWorkflowOperationHandler
- All Implemented Interfaces:
WorkflowOperationHandler
The Matrix notification workflow operation handler can send notifications to Matrix rooms.
This workflow operation sends a message to a specified Matrix room using the Matrix Client-Server API. It requires the following configuration parameters:
room-id- The Matrix room ID to send the notification tomessage- The message body to send
The handler also requires the following configuration properties to be set:
matrix.server.url- The Matrix server URL (default: https://matrix.org)matrix.access.token- The Matrix access token for authenticationmatrix.max.retry- Maximum number of retry attempts (default: 5)matrix.timeout- Request timeout in seconds (default: 10)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
AbstractWorkflowOperationHandler.Configuration -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault time between two request attemptsstatic final StringConfiguration key for the Matrix message bodystatic final StringConfiguration key for the Matrix room IDstatic final intThe scale factor to the sleep time between two notification attemptsFields inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
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 TypeMethodDescriptionprotected voidactivate(org.osgi.service.component.ComponentContext cc) Activates this component and initializes the configuration properties.start(WorkflowInstance workflow, JobContext context) Starts the Matrix notification workflow operation.Methods inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
applyTargetTagsToElement, asList, createResult, createResult, createResult, createResult, destroy, equals, getCfg, getConfig, getConfig, getConfig, getDescription, getFileNameFromElements, getId, getOptConfig, getOptConfig, getTagsAndFlavors, getTagsAndFlavors, hashCode, setJobBarrierPollingInterval, setServiceRegistry, skip, toString, waitForStatus, waitForStatus
-
Field Details
-
OPT_ROOM_ID
Configuration key for the Matrix room ID- See Also:
-
OPT_MESSAGE
Configuration key for the Matrix message body- See Also:
-
INITIAL_SLEEP_TIME
public static final int INITIAL_SLEEP_TIMEDefault time between two request attempts- 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
-
MatrixNotificationWorkflowOperationHandler
public MatrixNotificationWorkflowOperationHandler()
-
-
Method Details
-
activate
protected void activate(org.osgi.service.component.ComponentContext cc) Activates this component and initializes the configuration properties.- Overrides:
activatein classAbstractWorkflowOperationHandler- Parameters:
cc- the component context
-
start
public WorkflowOperationResult start(WorkflowInstance workflow, JobContext context) throws WorkflowOperationException Starts the Matrix notification workflow operation.- Specified by:
startin interfaceWorkflowOperationHandler- Specified by:
startin classAbstractWorkflowOperationHandler- Parameters:
workflow- the workflow instancecontext- the job context- Returns:
- the workflow operation result
- Throws:
WorkflowOperationException- if the operation fails- See Also:
-