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

Description (short)
Storage facility, forwards incoming data to another facility
Written by
Andreas Kupries
Description
Storage facility, forwards incoming data to another facility, triggers external command after delivery of the last mail.
Keywords
storage facility

Class 'triggerStorage'

Description
Storage system usable by the pop client in pop3Client. Incoming mails are forward to a predefined storage facility, see target. This class offers the functionality to detect the completion of storing the last mail which came in via pop3Client and act upon that, via command. This is currently used in my pop client (apps/popeye) to trigger a flist operation in my mailreader, which is ExMH, created by Brent Welch, also written in Tcl. This operation scans all known mail folders for new mail which is then displayed. Without that ExMH would have to poll every so often to be up to date.
Superclasses
popClientStorageBase
Options
target
command
Methods
public
Reset ()
SubDone (command state msg)
Trigger ()
clientDone (args)
storeMessage (command message)
Membervariables
public
in
stored
cDone

Options

-target
The handle of the storage facility to forward incoming mails to.
-command
The command to evaluate after the storing of the last incoming mail completed. Called with ourselves as first and only argument.

Methods

Reset ()

Enforces the initial state of the object.

SubDone (command state msg)

Callback for target. Counts the completion of the storage process, forwards the state and error information to our caller, and acts if the last mail was stored.
Argument: command The script evaluate. Allowed to be empty, nothing is done in that case. Gets either 'error' or 'done' as first argument. In case of an 'error' msg is given to as well.
Argument: state Completion state, either 'done' or 'error'.
Argument: msg (= {}) The error text to add as 2nd argument to command.

Trigger ()

Checks wether the last mails was stored or not. If so, command is evaluated, using ourselves as its first and only argument.

clientDone (args)

Calling this method signals that the pop client completed its retrieval session and that no more mails will be coming,
Argument: args Ignored. Added to allow immediate usage by pop3Client:done.

storeMessage (command message)

Overrides popClientStorageBase:storeMessage
Forward the given message to the configured storage facility, and counts that too
Argument: command The script evaluate after completion of the process (use Done to accomplish this). Allowed to be empty, nothing is done in that case. Gets either 'error' or 'done' as first argument.
Argument: message The text of the message to store.


Membervariables

in
The number mails which came in so far.
initial value: 0
stored
The number of mails which were stored using target.
initial value: 0
cDone
Set by clientDone, signals that there will be no more mails coming in.
initial value: 0

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