magpie.adapter.magpieservice¶
Store adapters to read data from magpie.
Attributes¶
Classes¶
Registry for OWS services. |
Module Contents¶
- 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.
- 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.
- _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 actualtwitcher.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 bytwitcher.owsproxy.owsproxy_view()
after successful validation of granted access for Logged User to the service / resources following call tomagpie.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 tomagpie.models.Service
byname
.