magpie.adapter.magpieservice

Store adapters to read data from magpie.

Attributes

LOGGER

Classes

ServiceStoreInterface

MagpieServiceStore

Registry for OWS services.

Module Contents

class magpie.adapter.magpieservice.ServiceStoreInterface(request)[source]

Bases: object

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

Bases: twitcher.store.ServiceStoreInterface

Registry for OWS services.

Uses magpie to fetch service url and attributes.

settings[source]
session_factory[source]
magpie_url[source]
twitcher_url[source]
twitcher_ssl_verify[source]
magpie_admin_token[source]
save_service(name: magpie.typedefs.Str, url: magpie.typedefs.Str, *args: Any, **kwargs: Any) NoReturn[source]

Store is read-only, use Magpie API to add services.

Note

Multiple redundant parameters are applied to support different Twitcher versions.

  • Twitcher <=0.5.x uses (service, *args, **kwargs)

  • Twitcher >=0.6.x uses (name, url, *args, **kwargs)

  • Some alternate interfaces also provided extra parameters at some point.

delete_service(name: magpie.typedefs.Str, *args: Any, **kwargs: Any) NoReturn[source]

Store is read-only, use Magpie API to delete services.

list_services() List[twitcher.models.Service][source]

Lists all services registered in Magpie.

_fetch_by_name_cached(service_name: magpie.typedefs.Str) twitcher.models.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(name: magpie.typedefs.Str) twitcher.models.Service[source]

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

fetch_by_url(url: magpie.typedefs.Str) twitcher.models.Service[source]

Gets service for given url from mongodb storage.

abstract clear_services() NoReturn[source]

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