File:  [LON-CAPA] / loncom / LondTransaction.pm
Revision 1.2: download - view: text, annotated - select for diffs
Mon May 5 23:58:05 2003 UTC (20 years, 11 months ago) by foxr
Branches: MAIN
CVS tags: HEAD
Planned functionality.

#   This module defines and implements a class that represents
#   a connection to a lond daemon.
#
# $Id: LondTransaction.pm,v 1.2 2003/05/05 23:58:05 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
#
# LON-CAPA is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LON-CAPA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# /home/httpd/html/adm/gpl.txt
#
# http://www.lon-capa.org/
#

=pod
=HEAD1 Synopsis
  LondTransaction objectifies the state of a transaction between lonc and
  lond (loncnew really).  

=cut


=pod
=head1 Description

LondTransaction objects hold the state required to manage a 
transaction between lonc and lond, from the loncnew point of view.
The state consists of the following member data:

=item request

The text of the request to send to lond.

=item active

If zero, the request is not active and the londSocket item is not
defined.

=item londSocket

If the request is not a deferred one (deferred = false),
this member contains the LondConnection object reference that
this request is being processed on.

=item deferred

True if the request is a deferred (delayed) request.
The member data below are either present or not depending on 
whether or not deferred is true.

=item clientSocket
   
If deferred is false, this member data is defined and is the 
handle to the socket that is connected to the apache child that
has requested this transaction.

=item DeferredFile

If deferred is false, this member data is defined and is the name
of the file that contains the deferred request.  When the transaction
is retired, this file will be deleted.

=head1 Member Functions

=head2  Operational functions

=item new

Creates a new transaction object.

=item Activate

Activates the transaction by assigning it to a LondConnection object

=item Retire

Retires a transaction after successful completion.

=item SetDeferred

Sets the state of a transaction to deferred, the deferred member
is set true, clientSocket is undefined, and DeferredFile is set.

=item SetClient

Sets the state of a transaction to not deferred.  The deferred member
is set false, clientSocket is set and DeferredFile is undefined.

=head2  Selectors


=item isDeferred

Returns the state of the deferred member.

=item isActive

Returns the staate of the active member.

=item getClient

if not deferred returns the client socket, else returns undef.

=item getFile

If deferred, returns the name of the deferred queue file else
returns undef.

=cut

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>