EFBMiddleware

class ehforwarderbot.EFBMiddleware(instance_id: str = None)[source]

Middleware class.

middleware_id

Unique ID of the middleware. Convention of IDs is specified in Packaging and Publish. This ID will be appended with its instance ID when available.

Type:str
middleware_name

Human-readable name of the middleware.

Type:str
instance_id

The instance ID if available.

Type:str
__init__(instance_id: str = None)[source]

Initialize the middleware. Inherited initializer must call the “super init” method at the beginning.

Parameters:instance_id – Instance ID of the middleware.
process_message(message: ehforwarderbot.message.EFBMsg) → Optional[ehforwarderbot.message.EFBMsg][source]

Process a message with middleware

Parameters:message (EFBMsg) – Message object to process
Returns:Processed message or None if discarded.
Return type:Optional[EFBMsg]
process_status(status: ehforwarderbot.status.EFBStatus) → Optional[ehforwarderbot.status.EFBStatus][source]

Process a status update with middleware

Parameters:status (EFBStatus) – Message object to process
Returns:Processed status or None if discarded.
Return type:Optional[EFBStatus]

About Middleware ID

With the introduction of instance IDs, it is required to use the self.middleware_id or equivalent instead of any hard-coded ID or constants while referring to the middleware (e.g. while retrieving the path to the configuration files, etc).