File 'net/pop3/client.cls' (part of 'Pool_Net')

Description (short)
Core of a POP3 client
Written by
Andreas Kupries
Description
Pop3 client core built upon the base connection management
See also
general POP3 background information, or POP3 client core for more specific info
Keywords
POP3, POP3 client

Class 'pop3Client'

Description
Full fledged POP3 client. The only parts not covered in this class are message classification and storage. These are delegated to external objects, see classificator and storage. A state machine is built on top of the low level methods in pop3Connection.
Superclasses
pop3Connection
Options
auth
storage
classificator
on-connect
on-login
done
Methods
public
ClearSocket ()
CloseDone (seq)
DeleDone (seq)
Goto (newstate)
Init ()
InitScheduler (seq)
InitiateRecovery ()
Logon (seq)
Off (seq)
RetrDone (seq)
Schedule ()
Task (task)
TopDone (seq)
WakeScheduler ()
msgDelete (msg)
msgIgnore (msg)
msgRetrieve (msg)
run ()
Membervariables
public
cState
after
queue
deleted
retrieved
pending
skip
lock

Options

-auth
Defines the mode to use during login into the pop3 server, either 'apop' or 'user'. The latter uses USER/PASS to send the password in the clear, and is therefore less secure than APOP, which sends a hashvalue created from the timestamp used by the server to greet us and the password itself. On the other hand, every server has to support USER/PASS, APOP-support is optional.
default value: apop
-storage
The name of the object handling the storing of incoming mails. Has to support the interface defined by popClientStorageBase, i.e. its class should be derived from that class.
-classificator
The name of the object handling the classification of incoming mails. Has to support the interface defined by popClientMsgClassificatorBase, i.e. its class should be derived from that class.
-on-connect
The script evaluate after a succesful connect.
-on-login
The script evaluate after a successful login.
-done
The script evaluate after the connection was closed.

Methods

ClearSocket ()

Overrides pop3Connection:ClearSocket
Closes the connection to the pop3 server described by this object.

CloseDone (seq)

Callback of standard shutdown. May restart the client, to proceed in error recovery.
Argument: seq Handle of the close sequencer created by Close.

DeleDone (seq)

Called after completion of a message deletion. Initiates emergency recovery in case of problems. Awakes the scheduler to start the next job.
Argument: seq Handle of the delete sequencer created by Dele.

Goto (newstate)

Jumps the client into the given state. Will behave like builtin 'return' in the calling procedure.
Argument: newstate The state to jump to.

Init ()

(Re)Initializes the state of the finite automaton.

InitScheduler (seq)

Callback of 'login' operation. Initializes the scheduler task queue with header retrieval operations, then starts the real work.
Argument: seq Handle of the 'login' sequencer created by LoginUser (or LoginApop.

InitiateRecovery ()

Does everything required to recover from line or server problems. Things include:
Execution of commit run to remove all messages which were already deleted and/or retrieved, but not committed by server.
Skipping over messages making trouble multiple times.

Logon (seq)

Callback of 'open connection' operation. Initiates logon in case of sucess.
Argument: seq Handle of the 'open' sequencer created by Open.

Off (seq)

Callback of definite shutdown.
Argument: seq Handle of the close sequencer created by Close.

RetrDone (seq)

Called after completion of message retrieval. Initiates emergency recovery in case of problems. Awakes the scheduler to start the next job. The received information is given to the storage facility.
Argument: seq Handle of the delete sequencer created by Retr.

Schedule ()

The scheduler. Executed semi-periodically to launch the tasks waiting in the internal queue. Automatically injects a connection shutdown in case of nothing more waiting to be done.

Task (task)

Adds a new task to the scheduler queue, starts the scheduler, if necessary. Deletions are added to the front, to give them priority.
Argument: task Text describing a task to be done by the client

TopDone (seq)

Called after completion of a header retrieval. Initiates emergency recovery in case of problems. The received information is given to the classificator for determination of further action. Awakes the scheduler to start the next job.
Argument: seq Handle of the top sequencer created by Top

WakeScheduler ()

Starts the scheduler, if not already waiting for execution.

msgDelete (msg)

Classificator callback. The specified message shall be deleted at the server, without retrieval.
Argument: msg Id of the message to delete.

msgIgnore (msg)

Classificator callback. The specified message shall be neither deleted nor retrieved. It will sit in the server awaiting action of the user.
Argument: msg Id of the message to ignore.

msgRetrieve (msg)

Classificator callback. The specified message shall be retrieved from the server.
Argument: msg Id of the message to retrieve.

run ()

Starts a retrieval cycle of the specified client.


Membervariables

cState
The state of the finite automaton. Could not use 'state' as this is used by the base class to record the state of the last low-level operation.
initial value: waiting
after
The id of the idle-handler used to schedule and execute the next task on the queue.
queue
A list of tasks to do, operated in a FIFO manner.
deleted
A list containing the index numbers of the sucessfully deleted messages. Used during recovery to enforce the state of the server at the time of the loss of the connection.
retrieved
A list containing the index numbers of the sucessfully state of the server at the time of the loss of the connection.
pending
The number of messages sent to the classificator we have no decision about (yet).
initial value: 0
skip
The number of messages to skip during recovery.
initial value: 0
lock
Activity flag. As long as it is true the system will ignore any attempt to start another session.
initial value: 0

Generated by AutoDoc 2.4 at 09/14/2000, invoked by Andreas Kupries