[TransWarp] peak.naming .. first contact

Ulrich Eck ueck at net-labs.de
Fri Feb 14 10:27:43 EST 2003

Hi Phillip,

as you could see from my other mail today i'm playing with the peak.naming
system and try to build a provider/context/url/... for imap-connections.

However i'm not sure that it's the job of the naming system or storage ...

Imap is somewhat special, cause is has basically 3 different types of

1. Connection: The Connection is the root object that does basically all
   all the work.
   it should be accessible through an URL like: "imap://user:auth@host.name:port"

2. Folder: Folders can contain other Folders and Messages. Folders should
   probably be Contexts that allow retrieval of child-Folders and Messages
   as well as creating child-Folders and Messages.
   a FolderURL would look like this: "imap://user:auth@host.name:port/folder.path"

3. Message: The Message is the "Leaf" of that tree that represent the actual message
   given an MessageUrl the message should be retrieved from the server.
   a MessageURL would look like this: "imap://user:auth@host.name:port/folder.path/123"

What i have now:

1. an imapURL(naming.ParsedURL) class that does the parsing of that url correctly.
   the retrieve method currently returns:
   - a connection-object if no folder/message was given
   - a connection-object with the selected Folder if folder given but not message
   - an email.Message-object if folder/messageid is given.

2. an imapFolderPath(naming.CompoundName) that defines that a folder-path is seperated
   with a "." and left-to-right.

what i think i need (but don't know how to implement):

 - ImapFolderContext: a naming.NameContext that represents that actual folder
   hierarchy and has methods to lookup/bind other contexts and leafs.

i've had a look at the Property-Context impl, where the URL doesn't implement the
"retrieve" method but the context has _get/_contextNNS methods implemented.

Am I on the right path ??

I also thought about building datamanagers for imap-access, but i have no
idea how to setup tree-like dm-structures. Setting up datamangers would
have the advantage of being able to cache results and more ..

can you give a hint how the structure of such a namingContext should be,
to be able to return Folder/Messages and create new childs ??
(preferably with a short description of the methods i need to implement and
what they should actually do :)

or (if more appropriate) how to build dm's for tree-like content?
(i could imagine using a tuple(<folder>,[None|messageid]) as key for the dm.)

thanks for your help.

Ulrich Eck
net-labs Systemhaus GmbH
Ebersberger Str. 46
85570 Markt Schwaben
fon:   +49-8121-4747-11
fax:   +49-8121-4747-77
email: ueck at net-labs.de

More information about the PEAK mailing list