The com.sabre.redapp.example.cf.event sample demonstrates asynchronous listening for events.
The following describes the files that this sample includes:
Activator.javagets an Activator instance and obtains a logger service.
EmuResponseHandler.javalistens for a response from Sabre emulator and logs both the command and response.
HotelEventHandler.javalistens for commands in Sabre emulator that begin with
HOT. If the command is equal to or greater than 6 characters, this plug-in opens igougo.com with a search string for city in a browser window.
redapp.xmlfile registers two event listeners. The event filter EMU_COMMAND listens for commands before they are marked up. The EMU_RESPONSE filter listens for responses before markup. This file is a partial example.
Running the Sample
In Eclipse, import the com.sabre.redapp.example.cf.event plug-in into your workspace and add it to your run configuration.
Launch Sabre Red 360 from your run configuration, and log in with your CERT Sabre ID.
Login to Sabre emulator. Type a command HOTLAX in Sabre emulator to open the igougo.com website in a tab.
The following figure shows the response that the sample service catches and returns in