| 1 |
#!/usr/bin/env python |
|---|
| 2 |
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 3 |
##~ License |
|---|
| 4 |
##~ |
|---|
| 5 |
##- The RuneBlade Foundation library is intended to ease some |
|---|
| 6 |
##- aspects of writing intricate Jabber, XML, and User Interface (wxPython, etc.) |
|---|
| 7 |
##- applications, while providing the flexibility to modularly change the |
|---|
| 8 |
##- architecture. Enjoy. |
|---|
| 9 |
##~ |
|---|
| 10 |
##~ Copyright (C) 2002 TechGame Networks, LLC. |
|---|
| 11 |
##~ |
|---|
| 12 |
##~ This library is free software; you can redistribute it and/or |
|---|
| 13 |
##~ modify it under the terms of the BSD style License as found in the |
|---|
| 14 |
##~ LICENSE file included with this distribution. |
|---|
| 15 |
##~ |
|---|
| 16 |
##~ TechGame Networks, LLC can be reached at: |
|---|
| 17 |
##~ 3578 E. Hartsel Drive #211 |
|---|
| 18 |
##~ Colorado Springs, Colorado, USA, 80920 |
|---|
| 19 |
##~ |
|---|
| 20 |
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 21 |
|
|---|
| 22 |
"""RuneBlade Messaging System |
|---|
| 23 |
|
|---|
| 24 |
========================== |
|---|
| 25 |
RuneBlade Messaging System |
|---|
| 26 |
========================== |
|---|
| 27 |
|
|---|
| 28 |
Goal |
|---|
| 29 |
==== |
|---|
| 30 |
In the RuneBlade Messaging System, we aim to create a pure Python |
|---|
| 31 |
implementation of an XML distribution and communication mechanism. This aim is |
|---|
| 32 |
very similar to the roots of Jabber's stream protocol, but has since devolved |
|---|
| 33 |
into a specific implementation for the Jabber protocol. However, we *do not* |
|---|
| 34 |
aim to recreate the Jabber protocol, but rather view it as a protocol that runs |
|---|
| 35 |
atop the XML Router. The Jabber protocol itself is a *wonderful* instance of |
|---|
| 36 |
Open Source Software process, and we support their efforts at Open Instance |
|---|
| 37 |
Messaging. The design is made up of three layers, with the first being Python, |
|---|
| 38 |
providing core functionality, abstraction, and cross platform capabilities. |
|---|
| 39 |
Second layer is a generalized XML Router and connection points, based on an |
|---|
| 40 |
advanced subject/observer pattern; dynamically configurable, yet reasonably |
|---|
| 41 |
minimalistic, allowing for most of the advanced functions to be implemented by |
|---|
| 42 |
clients. The third layer (and more) is designed for, but not be included, as it |
|---|
| 43 |
is the Application specific XML protocols to be routed, of which one instance is |
|---|
| 44 |
the Jabber protocol. |
|---|
| 45 |
|
|---|
| 46 |
Dependencies |
|---|
| 47 |
============ |
|---|
| 48 |
socket module |
|---|
| 49 |
logging package |
|---|
| 50 |
unittest package |
|---|
| 51 |
xml.parsers.expat module |
|---|
| 52 |
RBFoundation package |
|---|
| 53 |
RBFoundation.Aspects package |
|---|
| 54 |
RBFoundation.SubObs package |
|---|
| 55 |
|
|---|
| 56 |
Problems, Solutions, and Requirements |
|---|
| 57 |
===================================== |
|---|
| 58 |
|
|---|
| 59 |
Pythonic Routing |
|---|
| 60 |
................ |
|---|
| 61 |
* Routing of content between different connections. i.e. XML data |
|---|
| 62 |
* Dynamically configurable |
|---|
| 63 |
* Peer-link connections for router chaining |
|---|
| 64 |
+ Requires connection configuration protocol |
|---|
| 65 |
* Hierarchial identifiers of the form: |
|---|
| 66 |
[protocol://][account@]location[/resource][?idquery=info] |
|---|
| 67 |
|
|---|
| 68 |
Connections |
|---|
| 69 |
........... |
|---|
| 70 |
* Configurable in an object-oriented fassion |
|---|
| 71 |
* Pluggable protocol(s) on both client and server sides |
|---|
| 72 |
* Authentication support, including public key cryptogrophy |
|---|
| 73 |
* Connection Types |
|---|
| 74 |
+ User Link |
|---|
| 75 |
+ Device Link |
|---|
| 76 |
+ Services Link |
|---|
| 77 |
+ Router Link |
|---|
| 78 |
+ Hibred Links? |
|---|
| 79 |
|
|---|
| 80 |
Communication Stream |
|---|
| 81 |
.................... |
|---|
| 82 |
* Stream type |
|---|
| 83 |
+ Must support sockets |
|---|
| 84 |
+ Must support ssl-sockets |
|---|
| 85 |
+ Must support live python objects |
|---|
| 86 |
+ Support for stdin/stdout files? |
|---|
| 87 |
+ Support serial? |
|---|
| 88 |
* Security rating -- ssl is great, files are very bad |
|---|
| 89 |
* Statistic gathering -- bytes/sec, burstiness, throughput, etc... |
|---|
| 90 |
* Link monitoring and a decent stab at fault tolerance |
|---|
| 91 |
|
|---|
| 92 |
Miscelanious |
|---|
| 93 |
............ |
|---|
| 94 |
* Jabber component compatable |
|---|
| 95 |
* Configurable logging system (logging package) |
|---|
| 96 |
* Automated test framework (unittest package) |
|---|
| 97 |
* Pure Python implementation, 2.2.2 compatible, +unittest +logging +sets +heapq from 2.3 |
|---|
| 98 |
* Supported on Linux, FreeBSD, OpenBSD, MacOSX, Win 98/2K/WinXP, WinCE |
|---|
| 99 |
|
|---|
| 100 |
Required Services |
|---|
| 101 |
................. |
|---|
| 102 |
* Serivce discovery and registration (persistent or not) |
|---|
| 103 |
* Publish / Subscribe (persistent or not) |
|---|
| 104 |
* Packet Broadcast |
|---|
| 105 |
|
|---|
| 106 |
Potentials |
|---|
| 107 |
.......... |
|---|
| 108 |
* Support for "static" routes? i.e. I want an uninterpreted connection to Jabber |
|---|
| 109 |
==> No |
|---|
| 110 |
* Support for binary transfers? |
|---|
| 111 |
==> Yes |
|---|
| 112 |
* Support for non-xml? |
|---|
| 113 |
==> Definately |
|---|
| 114 |
|
|---|
| 115 |
Cross Cutting Aspects |
|---|
| 116 |
===================== |
|---|
| 117 |
* Dynamic, non-linear, priority-based nomination |
|---|
| 118 |
* Notify, Consume, Hibred, (filters) - Subject/observer based |
|---|
| 119 |
* Hierarchial, Broadcast, Peer-to-Peer |
|---|
| 120 |
* Handoff schemes, guarentees |
|---|
| 121 |
|
|---|
| 122 |
TODO |
|---|
| 123 |
==== |
|---|
| 124 |
Define dynamic behavior of router and connections |
|---|
| 125 |
Define router configuration XML protocol |
|---|
| 126 |
Define connection configuration XML protocol |
|---|
| 127 |
Define broadcast mechism |
|---|
| 128 |
Resource advertisement and discovery protocol |
|---|
| 129 |
""" |
|---|
| 130 |
|
|---|
| 131 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 132 |
|
|---|
| 133 |
__version__ = '0.1.0' |
|---|
| 134 |
__license__ = 'BSD-style (See LICENSE)' |
|---|
| 135 |
__platforms__ ='Linux, BSD, Windows, OSX', |
|---|
| 136 |
__author__ = 'Shane Holloway' |
|---|
| 137 |
__author_email__ = 'shane.holloway@runeblade.com' |
|---|
| 138 |
__url__ = 'http://www.runeblade.com/' |
|---|
| 139 |
__keywords__ = ['sockets', 'IM', 'peer-to-peer', 'P2P'] |
|---|
| 140 |
__packages__ = ['RBTelepathy', |
|---|
| 141 |
'RBTelepathy.Handlers', |
|---|
| 142 |
'RBTelepathy.Routing', |
|---|
| 143 |
'RBTelepathy.Packet', |
|---|
| 144 |
'RBTelepathy.Stream'] |
|---|
| 145 |
|
|---|