Cisco Cisco Unified Customer Voice Portal 11.0(1) Developer's Guide

Page of 103
C
HAPTER 
13:
 
L
OGGERS
 
 
P
ROGRAMMING 
G
UIDE FOR 
C
ISCO 
U
NIFIED 
CVP
 
VXML
 
S
ERVER 
 
 
 
AND 
C
ISCO 
U
NIFIED 
C
ALL 
S
TUDIO 
R
ELEASE 
4.1(1) 
 
 
 
 
75 
Aside from initializing the logger, this method is also responsible for configuring which events 
the logger instance is to handle. This is done by setting the value of the member variable 
eventsToListenFor
. This variable is a 
HashSet
 that must contain all the event IDs that the 
logger listens for. VXML Server accesses this 
HashSet
 to determine if a new event should be 
sent to the logger. When an event occurs, 
eventsToListenFor
 is accessed to see if the event ID 
can be found. If so, the logger will be notified of the event. The IDs for the events are defined in 
the interface 
IEventIDs.
 
ApplicationLoggerBase
 implements this interface so the event IDs 
are available directly within the logger class. 
void destroy(LoggerApplicationAPI api) 
This method is called by VXML Server when an application is released. This occurs in four 
different situations: the application server is shut down, VXML Server web application is 
restarted, the application the logger instance belongs to is released, and the application is 
updated. These situations are the same as those for when the application end class is called (see 
Chapter 11:  Application End Classes for more on these situations). 
The method also receives a 
LoggerApplicationAPI
 object, which is used to access the 
GlobalAPI. The GlobalAPI provides access to application data and global data (see the User 
Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio
 Chapter 2 in the 
section entitled Variables for more on application and global data).  
The purpose of this method is to give the logger the opportunity to perform clean up operations. 
Typically, this would involve closing database connections or files that were opened by the 
logger in its initialize method or while handling calls. A logger that does not have that 
requirement must still implement the destroy method but can define an empty implementation. 
void log(ApplicationEvent event) 
This method is the execution method for the logger and is called by VXML Server when a new 
event has occurred that the logger must handle. This method is called only if VXML Server has 
found the event’s ID in the 
eventsToListenFor HashSet
Only one object is passed to this method, an 
ApplicationEvent
. This object encapsulates all the 
information about the event and provides access to other environment information depending on 
the type of event. 
ApplicationEvent
 is a base class for all application-level events and the 
logger will typically check for the event type and cast to the appropriate event to get its 
information. All event classes are found in the 
com.audium.server.logger.events
 package. 
Referencing Figure 13-1 for application events, the following notes must be given: 
 
All application events have access to the Global API to get application and global data (see 
the User Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Chapter 
2 in the section entitled Variables for more on application and global data).  
 
Application events are defined at two levels: call-level, and application-level.