1: # This module defines and implements a class that represents
2: # a connection to a lond daemon.
3: #
4: # $Id: LondTransaction.pm,v 1.2 2003/05/05 23:58:05 foxr Exp $
5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
28:
29: =pod
30: =HEAD1 Synopsis
31: LondTransaction objectifies the state of a transaction between lonc and
32: lond (loncnew really).
33:
34: =cut
35:
36:
37: =pod
38: =head1 Description
39:
40: LondTransaction objects hold the state required to manage a
41: transaction between lonc and lond, from the loncnew point of view.
42: The state consists of the following member data:
43:
44: =item request
45:
46: The text of the request to send to lond.
47:
48: =item active
49:
50: If zero, the request is not active and the londSocket item is not
51: defined.
52:
53: =item londSocket
54:
55: If the request is not a deferred one (deferred = false),
56: this member contains the LondConnection object reference that
57: this request is being processed on.
58:
59: =item deferred
60:
61: True if the request is a deferred (delayed) request.
62: The member data below are either present or not depending on
63: whether or not deferred is true.
64:
65: =item clientSocket
66:
67: If deferred is false, this member data is defined and is the
68: handle to the socket that is connected to the apache child that
69: has requested this transaction.
70:
71: =item DeferredFile
72:
73: If deferred is false, this member data is defined and is the name
74: of the file that contains the deferred request. When the transaction
75: is retired, this file will be deleted.
76:
77: =head1 Member Functions
78:
79: =head2 Operational functions
80:
81: =item new
82:
83: Creates a new transaction object.
84:
85: =item Activate
86:
87: Activates the transaction by assigning it to a LondConnection object
88:
89: =item Retire
90:
91: Retires a transaction after successful completion.
92:
93: =item SetDeferred
94:
95: Sets the state of a transaction to deferred, the deferred member
96: is set true, clientSocket is undefined, and DeferredFile is set.
97:
98: =item SetClient
99:
100: Sets the state of a transaction to not deferred. The deferred member
101: is set false, clientSocket is set and DeferredFile is undefined.
102:
103: =head2 Selectors
104:
105:
106: =item isDeferred
107:
108: Returns the state of the deferred member.
109:
110: =item isActive
111:
112: Returns the staate of the active member.
113:
114: =item getClient
115:
116: if not deferred returns the client socket, else returns undef.
117:
118: =item getFile
119:
120: If deferred, returns the name of the deferred queue file else
121: returns undef.
122:
123: =cut
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>