cowbird.handlers ================ .. py:module:: cowbird.handlers Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/cowbird/handlers/handler/index /autoapi/cowbird/handlers/handler_factory/index /autoapi/cowbird/handlers/impl/index Attributes ---------- .. autoapisummary:: cowbird.handlers.AnySettingsContainer Classes ------- .. autoapisummary:: cowbird.handlers.Handler cowbird.handlers.HandlerFactory Functions --------- .. autoapisummary:: cowbird.handlers.get_handlers Package Contents ---------------- .. py:class:: Handler(settings: cowbird.typedefs.SettingsType, name: str, **kwargs: Any) Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. :param settings: Cowbird settings for convenience :param name: Handler name :param kwargs: The base class handle, but doesn't require the following variables: :param url: Location of the web service represented by the cowbird handler :param workspace_dir: Workspace directory :param priority: Relative priority between handlers while handling events. Lower value has higher priority, default value is last. .. py:attribute:: __slots__ Handler interface used to notify implemented handlers of users/permissions changes. .. todo:: At some point we will need a consistency function that goes through all Magpie users and make sure that handlers are up-to-date. .. py:property:: required_params :type: List[AnyHandlerParameter] :abstractmethod: .. py:attribute:: settings .. py:attribute:: name .. py:attribute:: priority .. py:attribute:: url .. py:attribute:: workspace_dir .. py:attribute:: ssl_verify :value: False .. py:attribute:: timeout .. py:method:: json() -> cowbird.typedefs.JSON .. py:method:: _user_workspace_dir(user_name: str) -> str .. py:method:: user_created(user_name: str) -> None :abstractmethod: .. py:method:: user_deleted(user_name: str) -> None :abstractmethod: .. py:method:: permission_created(permission: cowbird.permissions_synchronizer.Permission) -> None :abstractmethod: .. py:method:: permission_deleted(permission: cowbird.permissions_synchronizer.Permission) -> None :abstractmethod: .. py:method:: resync() -> None :abstractmethod: .. py:class:: HandlerFactory Create handler instance using handler name. .. py:attribute:: settings .. py:attribute:: handlers_cfg :type: Dict[str, cowbird.typedefs.HandlerConfig] .. py:attribute:: handlers :type: MutableMapping[str, cowbird.handlers.handler.Handler] .. py:method:: create_handler(name: Literal['Catalog']) -> cowbird.handlers.impl.catalog.Catalog create_handler(name: Literal['FileSystem']) -> cowbird.handlers.impl.filesystem.FileSystem create_handler(name: Literal['Geoserver']) -> cowbird.handlers.impl.geoserver.Geoserver create_handler(name: Literal['Magpie']) -> cowbird.handlers.impl.magpie.Magpie create_handler(name: Literal['Nginx']) -> cowbird.handlers.impl.nginx.Nginx create_handler(name: Literal['Thredds']) -> cowbird.handlers.impl.thredds.Thredds create_handler(name: str) -> Optional[cowbird.handlers.handler.Handler] Instantiates a new `Handler` implementation using its name, overwriting an existing instance if required. .. py:method:: get_handler(name: Literal['Catalog']) -> cowbird.handlers.impl.catalog.Catalog get_handler(name: Literal['FileSystem']) -> cowbird.handlers.impl.filesystem.FileSystem get_handler(name: Literal['Geoserver']) -> cowbird.handlers.impl.geoserver.Geoserver get_handler(name: Literal['Magpie']) -> cowbird.handlers.impl.magpie.Magpie get_handler(name: Literal['Nginx']) -> cowbird.handlers.impl.nginx.Nginx get_handler(name: Literal['Thredds']) -> cowbird.handlers.impl.thredds.Thredds get_handler(name: str) -> Optional[cowbird.handlers.handler.Handler] Instantiates a `Handler` implementation using its name if it doesn't exist or else returns the existing one from cache. .. py:method:: get_active_handlers() -> List[cowbird.handlers.handler.Handler] Return a sorted list by priority of `Handler` implementation activated in the config. .. py:data:: AnySettingsContainer .. py:function:: get_handlers(container: Optional[cowbird.typedefs.AnySettingsContainer] = None) -> List[handler.Handler] Obtains the handlers managed by the application.