Breadcrumb
- Sabre Red 360 Software Development Kit Help
- Desktop Red Apps
- Red App Sample Plug-ins
- com.sabre.redapp.example.cf.emu.bridge Sample
com.sabre.redapp.example.cf.emu.bridge Sample
The com.sabre.redapp.example.cf.emu.bridge sample demonstrates the Sabre emulator command intercept and markup services. The functionality of these sample communications services is described as follows:
-
The EMU_COMMAND service intercepts the
1KRKLON
command in Sabre emulator, replaces the command with1KRKMUC
, and then displays the response from the modified command. This service also intercepts commands that start with1LA
, but it does not send these commands to the Sabre GDS (host). -
The EMU_RESPONSE service catches the response from the
6PAX
command from the Sabre host before the response is sent to Sabre emulator. The service then marks up the response by adding a new line, and returns the modified response to Sabre emulator.
The following describes the files that this sample includes:
-
Activator.java
gets an instance of Activator and obtains an authentication token. -
CommandModificationService.java
intercepts an emulator command starting with1KRKLON
and sends the modified command1KRKMUC
to the Sabre host. This class also intercepts command1KRKWAW
, but it does not send them to the Sabre host. -
MarkupService.java
is a markup service that adds a new line before the last line in a response from the emulator. -
redapp.xml
registers the CommandModificationService for all commands that start with1KRK
and the MarkupService for 6`PAX`.
Running the Sample
MySabre API enables the use of the emulator services, however, do not include the sample plug-in in your run configuration at this point in order to demonstrate the emulator commands before and after running the sample.
-
Launch Sabre Red 360 in development mode from Eclipse IDE. Sign in to the Sabre host using Sabre emulator.
-
Type the 1KRKLON command. The host response displays availability from Krakow to London.
-
Type the 1KRKWAW command. The host response displays availability from Krakow to Warsaw.
-
Type the 6PAX command. The host response displays *.
-
Exit Sabre Red 360.
-
In Eclipse, import the com.sabre.redapp.example.cf.emu.bridge 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.
-
Log in to the Sabre host using Sabre emulator.
-
To see the EMU_COMMAND service, type the 1KRKLON command.
-
The sample service modifies this command and returns availability from Krakow to Munich.
-
To see the remaining capability in the EMU_COMMAND service, type the 1KRKWAW command. The service intercepts this command without sending the command to the host.
-
To see the EMU_RESPONSE service, type 6PAX. The sample response inserts a line in the response:
This line was inserted by MarkupService.