cowbird.handlers.impl.catalog

Module Contents

Classes

Catalog

Keep the catalog index in sync when files are created/deleted/updated.

Attributes

LOGGER

cowbird.handlers.impl.catalog.LOGGER[source]
class cowbird.handlers.impl.catalog.Catalog(settings: cowbird.typedefs.SettingsType, name: str, **kwargs: Any)[source]

Bases: cowbird.handlers.handler.Handler, cowbird.monitoring.fsmonitor.FSMonitor

Keep the catalog index in sync when files are created/deleted/updated.

Create the catalog instance.

Parameters
  • settings – Cowbird settings for convenience

  • name – Handler name

required_params[source]
abstract get_resource_id(resource_full_name: str)str[source]

Each handler must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

user_created(user_name)[source]
user_deleted(user_name)[source]
abstract permission_created(permission)[source]
abstract permission_deleted(permission)[source]
static get_instance()[source]

Return the Catalog singleton instance from the class name used to retrieve the FSMonitor from the DB.

on_created(filename)[source]

Call when a new file is found.

Parameters

filename – Relative filename of a new file

on_deleted(filename)[source]

Call when a file is deleted.

Parameters

filename – Relative filename of the removed file

on_modified(filename)[source]

Call when a file is updated.

Parameters

filename – Relative filename of the updated file