This directory contains the PreEmptive Analytics Java API, its documentation, and some samples. We especially appreciate your suggestions to how we can improve the API to meet your needs. Please send your comments or suggestions to

Important Links

PreEmptive Analytics

The APIs in this directory support PreEmptive Analytics which can be used to give application authors and users insight into how their applications are being used.

The PreEmptive Analytics API is just any other Java library. Choose the JAR for your application and add it to your project:

The Javadoc for these APIs are included in this directory.

To use the API you will need two GUIDs:

You want to use the same Application ID for the entire applications lifetime, even when you release new versions: PreEmptive Analytics has a separate method to track your application's versions.

Depending upon your PreEmptive contract you may be assigned a non-default server endpoint where your messages will be sent. If assigned, you will need to use this value when configuring your application so that your can retrieve your data.

API Usage Pattern

The general usage pattern of the API is:

Observing Generated Data

PreEmptive Analytic's Runtime Intelligence server does not process your data in real-time. To aid in the quick testing of your use of the APIs this directory includes a WAR file that you can deploy locally for testing purposes. The sink.war contains a simple servlet that prints out the headers and the body of HTTP requests. To use this for testing you need to perform the following steps:

  1. Deploy the WAR file to a servlet contain such as Apache Tomcat on your local machine
  2. Use HTTP rather that HTTPS by calling setUseSsl(false)
  3. Set the endpoint to point to the machine and port where the WAR file is deployed by calling setServiceEndpoint("host:port/sink/Sink")

Messages that your application generates will be echoed by the servlet rather than being sent to the PA Server.

Remember to comment out or remove the calls to setUseSsl() and setServiceEndpoint() before releasing your application!


Provided are some samples which use the PreEmptive Analytics APIs.