Part of elisa.core.resource_manager View In Hierarchy
ResourceProvider
components that make use of various data
sources.Line # | Kind | Name | Docs |
---|---|---|---|
60 | Method | __init__ | Undocumented |
66 | Method | register_component | Register a new component. |
78 | Method | unregister_component | Unregister a component. |
94 | Method | get_resource_provider_by_path | Return the registered resource provider that corresponds to the given |
149 | Method | get | Return a resource that uri is pointing to. A URI can point
to |
178 | Method | post | Update the resource pointed by uri with
parameters . |
195 | Method | put | Put one resource into another. Both resources are identified with URIs. |
225 | Method | delete | Delete the resource that uri is pointing to. |
112 | Method | _get_resource_provider | Retrieve the ResourceProvider able to handle uri . |
141 | Method | _proxy | Undocumented |
Inherited from Manager:
Line # | Kind | Name | Docs |
---|---|---|---|
73 | Method | clean | Undocumented |
194 | Method | plugin_status_changed_cb | Callback meant to be invoked (by the plugin registry) when the status |
70 | Method | _clean_component | Undocumented |
77 | Method | _load_components | Asynchronously load and register a list of components. |
117 | Method | _unload_components | Asynchronously unregister and unload a list of components. |
When trying to register a component twice, an AlreadyRegistered failure will be returned.
Parameters | component | the component to register
(type: elisa.core.component.Component
) |
Returns | a deferred fired when the component is registered
(type: elisa.core.utils.defer.Deferred
) |
When trying to unregister a component that is not registered, a CannotUnregister failure will be returned.
Parameters | component | the component to unregister
(type: elisa.core.component.Component
) |
Returns | a deferred fired when the component is unregistered
(type: elisa.core.utils.defer.Deferred
) |
This method should not be called to gain direct access to a resource provider, it is meant to be called only by capabilities at initialization time (capabilities need a reference to their "parent" resource provider).
Parameters | path | the full component path for the resource provider
(type: str
) |
uri
. If
multiple ResourceProviders support it, the first one found is returned.Parameters | uri | location that will be passed to the resource provider returned
(type: elisa.core.media_uri.MediaUri
) |
Returns | (type: elisa.core.components.resource_provider.ResourceProvider
) | |
Raises | NoMatchingResourceProvider | in case no ResourceProvider has a matching regular expression |
uri
is pointing to. A URI can point
to any kind of resource. Resources are returned as models.
The model that is returned does not always already contain all the resource. The deferred is fired when the resource loading is complete.
Parameters | uri | URI pointing to the resource
(type: elisa.core.media_uri.MediaUri
) |
context_model | the URI often comes from a certain context. For example a URI pointing to a
MusicAlbum can come from a Model that could contain the album cover or the
album name. If the context_model is provided the resource_provider should
try to reuse its data if possible.
(type: elisa.core.components.model.Model
) | |
Returns | a new model and a deferred fired when the model is fully loaded
(type: tuple of elisa.core.components.model.Model
elisa.core.utils.defer.Deferred
) | |
Raises | NoMatchingResourceProvider | in case no ResourceProvider has a matching regular expression for
uri
|
uri
with
parameters
.Parameters | uri | URI pointing to the resource to update
(type: elisa.core.media_uri.MediaUri
) |
parameters | parameters of the resource that should be updated | |
Returns | a deferred fired when the parameters got posted
(type: elisa.core.utils.defer.Deferred
) | |
Raises | NoMatchingResourceProvider | in case no ResourceProvider has a matching regular expression for
uri
|
Parameters | source_uri | URI pointing to the resource that should be put into the other one
(type: elisa.core.media_uri.MediaUri
) |
container_uri | URI pointing to the resource that should receive the resource
(type: elisa.core.media_uri.MediaUri
) | |
source_model | Often the resource behind the source_uri already exists as a
Model. In order to avoid retrieving the resource pointed by
source_uri that model can be passed to the put request
(type: elisa.core.components.model.Model
) | |
kwargs | resource provider specific keyword options | |
Returns | a deferred fired when the resource got put
(type: elisa.core.utils.defer.Deferred
) | |
Raises | NoMatchingResourceProvider | in case no ResourceProvider has a matching regular expression for the
container_uri
|
uri
is pointing to.Parameters | uri | URI pointing to the resource that should be deleted
(type: elisa.core.media_uri.MediaUri
) |
Returns | a deferred fired when the resource got deleted
(type: elisa.core.utils.defer.Deferred
) | |
Raises | NoMatchingResourceProvider | in case no ResourceProvider has a matching regular expression for
uri
|