Indy 9 | Content | Index | Reference

TIdHTTPCustomSessionList
Hierarchy, Properties, Methods, Events, Unit: IdCustomHTTPServer
Specifies an abstract container for persistent HTTP sessions.

    TIdHTTPCustomSessionList = class(TComponent)

Unit
IdCustomHTTPServer
Description
TIdHTTPCustomSessionList is a TComponent descendant that specifies a pure virtual class providing the container framework for HTTP sessions in a TIdHTTPServer implementation.

TIdHTTPCustomSessionList declares procedures and methods needed to add an create TIdHTTPSession persistent session objects, retrieve session objects by an identifier and remote IP address, and clear sessions form the container.

All methods in TIdHTTPCustomSessionList are declared as virtual abstract procedures and functions, and must be overridden in a descendant class to provide the session management capabilities required.

TIdHTTPCustomSessionList is used as the ancestor for Indy classes, like TIdHTTPDefaultSessionList, that manage persistent session information using TIdHTTPSession object instances.

TIdHTTPCustomSessionList also implements propeties and event handlers needed to specifiy the default itmeout value for sessions in the container, and to respond top events triggered when a persistent session is started or completed.

TIdHTTPCustomSessionList is the type used to represent the TIdHTTPSession.Owner property established in the contructor for the session object.

TIdHTTPCustomSessionList.SessionTimeout
TIdHTTPCustomSessionList
Specifies the time-to-live for a HTTP session.

    property SessionTimeout: Integer;

Description
SessionTimeout is a Cardinal property that specifies the time-to-live for a persistent HTTP session expressed in milliseconds. SessionTimeout is used to determine when a TIdHTTPSession is stale (the LastTimeStamp indicates that the SessionTimeOut has expired).

TIdHTTPCustomSessionList.Add
TIdHTTPCustomSessionList, See Also
Specifies the mechanism used to add an HTTP session to the session list.

    procedure Add(ASession: TIdHTTPSession); virtual; abstract;

Parameters
ASession: TIdHTTPSession
HTTP session to add to the session list.
Description
Add specifies the method used to add the HTTP session represented in ASession to the session list. Note: All methods in TIdHTTPCustomSessionList are declared as virtual abstract procedures and functions, and must be overridden in a descendant class to provide the session management capabilities required.

TIdHTTPCustomSessionList.Clear
TIdHTTPCustomSessionList, See Also
Specifies the mechanism used to free HTTP sessions in the session list.

    procedure Clear; virtual; abstract;

Description
Clear is an abstract virtual procedure that specifies the mechanism used to remove all TIdHTTPSession objects in the session list. Note: All methods in TIdHTTPCustomSessionList are declared as virtual abstract procedures and functions, and must be overridden in a descendant class to provide the session management capabilities required.

TIdHTTPCustomSessionList.CreateSession
TIdHTTPCustomSessionList, See Also
Specifies the mechanism to create a new HTTP session.

    function CreateSession(const RemoteIP: String; const SessionID: String): TIdHTTPSession; virtual; abstract;

Parameters
const RemoteIP: String
The peer IP address for the session.
const SessionID: String
The identifier for the session.
Return Value
TIdHTTPSession - The session object reference.
Description
CreateSession is an abstract virtual TIdHTTPSession function that specifies the mechanism used to create a new HTTP session, and add the new session to the session list.

RemoteIP is the IP address of the remote computer system that is the endpoint for the HTTP session.

SessionID is the identifier for the new HTTP session.

Note: All methods in TIdHTTPCustomSessionList are declared as virtual abstract procedures and functions, and must be overridden in a descendant class to provide the session management capabilities required.

TIdHTTPCustomSessionList.CreateUniqueSession
TIdHTTPCustomSessionList, See Also
Specifies the mechanism used to create a new HTTP asession with a unique session ID and remote IP address.

    function CreateUniqueSession(const RemoteIP: String): TIdHTTPSession; virtual; abstract;

Parameters
const RemoteIP: String
IP address or host name for the remote connection.
Return Value
TIdHTTPSession - new HTTP session created for a client connection.
Description
CreateUniqueSession is an abstract virtual TIdHTTPSession function that specifies the mechanism used to insure a new HTTP session is created for a client connection having the remote IP address specified in RemoteIP.

Note: All methods in TIdHTTPCustomSessionList are declared as virtual abstract procedures and functions, and must be overridden in a descendant class to provide the session management capabilities required.

TIdHTTPCustomSessionList.GetSession
TIdHTTPCustomSessionList, See Also
Retrieves a HTTP session from the session list.

    function GetSession(const SessionID: string; const RemoteIP: string): TIdHTTPSession; virtual; abstract;

Parameters
const SessionID: string
The identifier for the session.
const RemoteIP: string
The remote IP address for the session.
Return Value
TIdHTTPSession - The session object reference, or Nil.
Description
GetSession is an abstract virtual TIdHTTPSessionList function that specifies the mechanism used to retrieve an existing HTTP session from the session list using values specified in SessionID and RemoteIP.

Note: All methods in TIdHTTPCustomSessionList are declared as virtual abstract procedures and functions, and must be overridden in a descendant class to provide the session management capabilities required.

TIdHTTPCustomSessionList.PurgeStaleSessions
TIdHTTPCustomSessionList, See Also
Removes expired sessions from the session list.

    procedure PurgeStaleSessions(PurgeAll: Boolean = false); virtual; abstract;

Parameters
PurgeAll: Boolean = false
Indicates all stale sessions are to be removed.
Description
PurgeStaleSessions is an abstract virtual procedure that specifies the mechanism used to remove HTTP session where the LastTimestamp and SessionTimeout properties indicate that the session has expired. Note: All methods in TIdHTTPCustomSessionList are declared as virtual abstract procedures and functions, and must be overridden in a descendant class to provide the session management capabilities required.

TIdHTTPCustomSessionList.OnSessionEnd
TIdHTTPCustomSessionList
Specifies the event handler for a terminating HTTP session.

    property OnSessionEnd: TOnSessionEndEvent;

Parameters
Sender
HTTP session for the event notification.
Description
OnSessionEnd is a TOnSessionEndEvent property that represents the event handler signalled when an HTTP session will be terminated. Applications must assign a procedure to the event handler to respond to the event notification.

TIdHTTPCustomSessionList.OnSessionStart
TIdHTTPCustomSessionList
Specifies the event handler for a terminating HTTP session.

    property OnSessionStart: TOnSessionStartEvent;

Parameters
Sender
HTTP session for the event notification.
Description
OnSessionStart is a TOnSessionStartEvent property that represents the event handler signalled when an HTTP session will be activated. Applications must assign a procedure to the event handler to respond to the event notification.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.