Package elisa :: Package core :: Package components :: Module metadata_capability :: Class MetadataCapability

Class MetadataCapability

source code


A metadata capability is a special type of capability that provides metadata retrieval services on top of a given resource provider.

For example, this could be a music album cover retriever built on top of the Amazon resource provider.

A metadata capability has a rank that determines the level of confidence the metadata manager should give it when retrieving metadata. It allows to give a capability a higher priority over another one.

Instance Methods
bool
able_to_handle(self, model)
Test whether the capability is able to handle a metadata request on the given model.
source code
twisted.internet.defer.Deferred
get_metadata(self, model)
Try to retrieve metadata and populate the model with it.
source code

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from component.Component
twisted.internet.defer.Deferred
clean(self)
Clean the component.
source code
twisted.internet.defer.Deferred
initialize(self, **kwargs)
Initialize the component.
source code
 
name__get(self) source code
 
name__set(self, value) source code
    Inherited from log.Loggable
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
Class Methods
    Inherited from component.Component
elisa.core.component.Component or a subclass
create(cls, config_section=None, **kwargs)
Create and initialize the component.
source code
Class Variables
positive int rank = 0
the rank of the capability for the metadata manager

Inherited from extern.log.log.Loggable: logCategory

    Inherited from component.Component
  config_doc = {}
  default_config = {}
  name = property(fget= name__get, fset= name__set)
  path = PathDescriptor()
Instance Variables
    Inherited from capability.Capability
elisa.core.components.resource_provider.ResourceProvider provider
the provider this capability belongs to
Properties

Inherited from object: __class__

Method Details

able_to_handle(self, model)

source code 

Test whether the capability is able to handle a metadata request on the given model.

Parameters:
Returns: bool
True if the capability is able to handle the given model, False otherwise

get_metadata(self, model)

source code 

Try to retrieve metadata and populate the model with it.

Parameters:
Returns: twisted.internet.defer.Deferred
a deferred fired when the metadata retrieval is complete