magpie.adapter.magpieservice

Store adapters to read data from magpie.

Module Contents

Classes

MagpieServiceStore

Registry for OWS services.

Attributes

LOGGER

magpie.adapter.magpieservice.LOGGER[source]
class magpie.adapter.magpieservice.MagpieServiceStore(: pyramid.request.Request, request)[source]

Bases: twitcher.store.ServiceStoreInterface

Registry for OWS services.

Uses magpie to fetch service url and attributes.

abstract save_service(self, service, overwrite=True, request=None)[source]

Magpie store is read-only, use magpie api to add services.

abstract delete_service(self, name, request=None)[source]

Magpie store is read-only, use magpie api to delete services.

list_services(self, request=None)[source]

Lists all services registered in magpie.

_fetch_by_name_cached(self: magpie.typedefs.Str, service_name)twitcher.datatype.Service[source]

Cache this method with beaker based on the provided caching key parameters.

If the cache is not hit (expired timeout or new key entry), calls fetch_by_name() to retrieve the actual twitcher.datatype.Service definition. Otherwise, returns the cached item to avoid SQL queries.

Note

Function arguments are required to generate caching keys by which cached elements will be retrieved.

Note

Method fetch_by_name() gets triggered by twitcher.owsproxy.owsproxy_view() after successful validation of granted access for Logged User to the service / resources following call to magpie.adapter.magpieowssecurity.MagpieOWSSecurity.check_request() in order to send and retrieve the actual response of that proxied service and forward it back to the requesting user. Caching helps greatly reduce recurrent SQL queries to convert Twitcher to Magpie service.

fetch_by_name(self: magpie.typedefs.Str, name)twitcher.datatype.Service[source]

Gets twitcher.datatype.Service corresponding to magpie.models.Service by name.

fetch_by_url(self, url, request=None)[source]

Gets service for given url from mongodb storage.

abstract clear_services(self, request=None)[source]

Magpie store is read-only, use magpie api to delete services.