lakesuperior.messaging package

Submodules

lakesuperior.messaging.formatters module

class lakesuperior.messaging.formatters.ASDeltaFormatter(rsrc_uri, ev_type, timestamp, rsrc_type, actor, data=None)[source]

Bases: lakesuperior.messaging.formatters.BaseASFormatter

Sends the same information as ASResourceFormatter with the addition of the triples that were added and the ones that were removed in the request. This may be used to send rich provenance data to a preservation system.

class lakesuperior.messaging.formatters.ASResourceFormatter(rsrc_uri, ev_type, timestamp, rsrc_type, actor, data=None)[source]

Bases: lakesuperior.messaging.formatters.BaseASFormatter

Sends information about a resource being created, updated or deleted, by who and when, with no further information about what changed.

class lakesuperior.messaging.formatters.BaseASFormatter(rsrc_uri, ev_type, timestamp, rsrc_type, actor, data=None)[source]

Bases: object

Format message as ActivityStreams.

This is not really a logging.Formatter subclass, but a plain string builder.

ev_names = {'_create_': 'Resource Creation', '_delete_': 'Resource Deletion', '_update_': 'Resource Modification'}
ev_types = {'_create_': 'Create', '_delete_': 'Delete', '_update_': 'Update'}

lakesuperior.messaging.handlers module

class lakesuperior.messaging.handlers.StompHandler(conf)[source]

Bases: logging.Handler

Send messages to a remote queue broker using the STOMP protocol.

This module is named and configured separately from standard logging for clarity about its scope: while logging has an informational purpose, this module has a functional one.

emit(record)[source]

Send the message to the destination endpoint.

lakesuperior.messaging.messenger module

class lakesuperior.messaging.messenger.Messenger(config)[source]

Bases: object

Very simple message sender using the standard Python logging facility.

send(*args, **kwargs)[source]

Send one or more external messages.