You can program FCAS applications to respond to server events as they are generated. Applications respond to a server event by calling a method. You can program methods to perform certain operations (statistics events) when events occur.
To make your application work with statistics events, you:
• normally make the application launch as a server application
Set this on the Project Attribute form's General tab.
• select "Relay statistics packets" on the FCAS Configuration form's Configuration tab.
Event types
FCAS can only trigger statistics events for events that have been selected on the Statistics Control form in the administrator's Reports folder.
The following events can trigger statistics events:
AddUser |
ApplyModel |
Approve |
ASApp |
Attach |
AutoReg |
ChangeUser |
Close |
CommLinkFail |
ConfDelivery |
ConfItemDel |
ConfPermissions |
ConfSubscribe |
Control |
Create |
DeleteUser |
Directory |
Download |
FoldCrt |
FoldDel |
Format |
GetInfo |
History |
Login |
Logout |
MsgDelete |
MsgDelivery |
MsgForward |
MsgReply |
Open |
OpenDeskTop |
Password |
Performance |
Resume |
SaveAttach |
Search |
Spam |
Upload |
Web |
|
Programming methods
To program methods for events, select "Server Statistics Events" on the General tab of the Project Attributes form. This adds a StatsEvent module to the project.
The StatsEvent module contains the methods that you can program. There is also a subroutine named EventMain. EventMain is called each time an event occurs, followed by the event-specific subroutine.
As an example, to display a message on the console each time a new user is added, you would program the appropriate method:
Sub StatsEvent_AddUser (theStatsEvent as StatsEvent)
Console ("Added new user")
End Sub
Each method receives as a parameter theStatsEvent of object type StatEvent. The StatEvent object type contains data and methods that detail the particular event that has occurred, and has the following methods and attributes:
Timestamp |
A date data type that contains the date and time of the statistics event. |
StatsEvent |
The FirstClass statistics event code. |
Delimiter |
The parsing delimiter attribute for the event text. |
Text |
The text of the event as it would be written to the server log file. |
Text(n) |
The text of the "n" column automatically parsed with the delimiter specified by the delimiter attribute. |
NumCols |
The number of columns in the delimited text of the event string (using the delimiter attribute). |
|