Verastream SDK for Airlines
Java Sample Code

The following Java-based sample applications are provided:

Application Description
Console A console-based Java application that connects to a host session, creates a screen object, sends data to the host, and receives events. This application is designed to handle more than one session.

To run the sample application:
  1. Create one or more configuration files in the folder <Installation Location>\samples\xml, and name them DemoConfig1.xml through DemoConfign.xml (with n being equal to the number of sessions you plan to open).

    You may create your own or use one of the provided sample configuration files as long as you modify it by replacing the host address, terminal ID, terminal address, etc. with values appropriate for your host.
    Note This application uses specific configuration file names in order to allow you to open multiple sessions without rewriting the sample code. For this reason, you must name the configuration file(s) as specified.

     

  2. Add the following SDK .jar files to your classpath:
    • SessionLoader.jar
    • Mutable.jar
    • ObjectManager.jar
    • jScreentype.jar, where type corresponds to the screen type your application uses, such as T27 or ALC.

      See Using the Verastream SDK with Eclipse for directions.
  3. Run SDKConsoleDemo.

The application will ask how many sessions to open, and you will use the configuration files you created to open the sessions.

Location: <Installation Location>\samples\Java\Console
JSP A JSP application that demonstrates how to connect to the host from a JSP page. The application captures a terminal emulation screen and sends it to the browser via HTML.

In order to use this application, you must modify the source code to point to a valid configuration file on your web application server (one that you created, or a sample configuration file that you have modified with your connection information).

Note This sample is to be deployed as a web application, so the SDK must be installed on your web server in order for this sample to work properly.

Location: <Installation Location>\samples\Java\JSP

For instructions that show how to set up and run this sample, see the readme file provided with this sample.
Servlet This application demonstrates how to develop an SDK servlet. It opens a host connection and sends the first screen of data from the host to the terminal via HTML.

In order to use this application, you must modify the source code to point to a valid configuration file on your web application server (one that you created, or a sample configuration file that you have modified with your connection information).
Note This sample is to be deployed as a web application, so the SDK must be installed on your web server in order for this sample to work properly.

Location: <Installation Location>\samples\Java\Servlet

For instructions that show how to set up and run this sample, see the readme file provided with the sample.

 

For more information on creating XML configurations, see Defining an XML Configuration.

Related Topics
ActiveX Technologies Supported
Development Tools Supported
Deploying SDK Applications in Tomcat Environments