# Class e.p.d.d.DaapConnection(object):

Part of elisa.plugins.daap.daap_connection View In Hierarchy

A DaapConnection holds the connection to a daap server (on one port) and allows you to make requests with the corresponding models. Internally it using the `elisa.plugins.daap.daap_parser.DaapParser` to parse the data into models.

Line # | Kind | Name | Docs
--- | --- | --- | ---
62 | Method | __init__ | Undocumented
69 | Method | login | Try to log into the server. Has to be called before trying to make
127 | Method | request | request the `uri` and wrap the data in the `model`. The parameters

def __init__(self, server='localhost', port=3689):
Undocumented
def login(self, password=None):
Try to log into the server. Has to be called before trying to make request otherwise the request probably fails.

Returns | (type: `twisted.internet.defer.Deferred` )
Raises | LoginFailed | in case the login failed.

def request(self, uri, model):

request the `uri` and wrap the data in the `model`. The parameters 'session-id' and 'revision-id' are overwritten with the values from inside this class.

You need to be logged in before trying to request anything.

FIXME: deferred returned by this method is not cancellable.

Parameters | uri | (type: `elisa.core.media_uri.MediaUri` )
| model | (type: `elisa.plugins.daap.models.DaapModel` @rtype `elisa.twisted.internet.defer.Deferred` )