Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 104 lines (85 sloc) 3.307 kb
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
1 ;;; rudel-protocol.el --- Interface implemented by Rudel protocol backends
2 ;;
3 ;; Copyright (C) 2009 Jan Moringen
4 ;;
5 ;; Author: Jan Moringen <scymtym@users.sourceforge.net>
6 ;; Keywords: Rudel, backend, protocol
7 ;; X-RCS: $Id:$
8 ;;
9 ;; This file is part of Rudel.
10 ;;
11 ;; Rudel is free software: you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
15 ;;
16 ;; Rudel is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
20 ;;
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with Rudel. If not, see <http://www.gnu.org/licenses>.
23
24
25 ;;; Commentary:
26 ;;
27 ;; This file contains the interface for Rudel protocol backends. This
28 ;; interface consists of the following functions:
29 ;;
30 ;; + joining sessions
31 ;; + `rudel-ask-join-info'
32 ;; + `rudel-join'
33 ;; + hosting sessions
34 ;; + `rudel-ask-host-info'
35 ;; + `rudel-host'
36 ;; + factory functions
37 ;; + `rudel-make-document'
38
39
40 ;;; History:
41 ;;
259d5a7 @scymtym added initial support for the transport abstraction to affected
scymtym authored
42 ;; 0.1 - Initial version
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
43
44
45 ;;; Code:
46 ;;
47
48 (require 'eieio)
49
50 (require 'rudel-backend)
51
52
53 ;;; Class rudel-protocol-backend
54 ;;
55
56 (defclass rudel-protocol-backend (rudel-backend)
57 ()
58 "Interface implemented by protocol backends."
59 :abstract t)
60
abb2343 @scymtym * socket/rudel-socket.el (rudel-socket-listener): new class;
scymtym authored
61 (defgeneric rudel-ask-connect-info ((this rudel-protocol-backend)
62 &optional info)
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
63 "Retrieve information for joining a session from user.
abb2343 @scymtym * socket/rudel-socket.el (rudel-socket-listener): new class;
scymtym authored
64 When INFO is non-nil, augment INFO to produce new list.
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
65 Return a property list that contains the collected information.")
66
5f792b9 @scymtym * rudel.el (rudel-join-session): do not call `rudel-ask-connect-info'
scymtym authored
67 (defgeneric rudel-connect ((this rudel-protocol-backend) transport
68 info info-callback
69 &optional progress-callback)
259d5a7 @scymtym added initial support for the transport abstraction to affected
scymtym authored
70 "Create a new connection through TRANSPORT according to the data in INFO.
71 TRANSPORT has to be an object of a class derived from `rudel-transport'.
72 INFO has to be a property list.
5f792b9 @scymtym * rudel.el (rudel-join-session): do not call `rudel-ask-connect-info'
scymtym authored
73 INFO-CALLBACK has to be a function of two arguments which will be
74 bound to THIS and INFO. When called, INFO-CALLBACK should return
75 a modified version of the INFO argument in which no information
76 is missing.
77 When non-nil, PROGRESS-CALLBACK has to be a function that may be
78 called repeatedly while the connection is established.
259d5a7 @scymtym added initial support for the transport abstraction to affected
scymtym authored
79
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
80 Implementations can rely on the fact that the property :session
259d5a7 @scymtym added initial support for the transport abstraction to affected
scymtym authored
81 in INFO contains the `rudel-session' object to which the new
82 connection will be associated.")
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
83
abb2343 @scymtym * socket/rudel-socket.el (rudel-socket-listener): new class;
scymtym authored
84 (defgeneric rudel-ask-host-info ((this rudel-protocol-backend)
85 &optional info)
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
86 "Retrieve information for hosting a session from user.
abb2343 @scymtym * socket/rudel-socket.el (rudel-socket-listener): new class;
scymtym authored
87 When INFO is non-nil, augment INFO to produce new list.
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
88 Return a property list that contains the collected information.")
89
2fd925d @scymtym * rudel.el (rudel-host-session): determine a transport and a protocol
scymtym authored
90 (defgeneric rudel-host ((this rudel-protocol-backend) backend
91 info)
92 "Create a new session according to the property list INFO.
93 BACKEND has to be an object of a class derived from
94 `rudel-transport-backend' and has to have the listen
95 capability.
96 The created session object is returned.")
f6a2db0 * rudel-protocol.el (new file): interface for Rudel protocol backends
jan authored
97
98 (defgeneric rudel-make-document ((this rudel-protocol-backend)
99 name session)
100 "Create a new document object named NAME for SESSION.")
101
102 (provide 'rudel-protocol)
103 ;;; rudel-protocol.el ends here
Something went wrong with that request. Please try again.