com.preemptive.instrumentation
Class RuntimeIntelligence

java.lang.Object
  extended by com.preemptive.instrumentation.RuntimeIntelligence

public final class RuntimeIntelligence
extends Object

The PreEmptive Analytics System runtime functions.

Related system properties:


Field Summary
static String COMMERCIAL_END_POINT
          Subscription end point.
static int EXCEPTION_CAUGHT
          Exception type : an exception that was caught.
static int EXCEPTION_THROWN
          Exception type : an exception that is being thrown.
static int EXCEPTION_UNCAUGHT
          Exception type : an exception that was not caught or thrown.
static String FREE_END_POINT
          Free end point.
static String RIS_ENDPOINT
          System property name.
static String RIS_FULL_DATA
          System property name.
static String RIS_LOG_MESSAGES
          System property name.
static String RIS_OMIT_PII
          System property name.
static String RIS_OPTIN
          System property name.
static String RIS_SEND_DISABLED
          System property name.
static String RIS_SSL
          System property name.
static String RIS_SUPPORT_OFFLINE
          System property name.
 
Method Summary
static void featureStart(String feature)
          Indicate the start of a feature being used.
static void featureStart(String feature, BinaryInfo binary, Properties properties)
          Indicate the start of a feature being used.
static void featureStart(String feature, Properties properties)
          Indicate the start of a feature being used.
static void featureStop(String feature)
          Indicate the end of a feature being used.
static void featureStop(String feature, BinaryInfo binary, Properties properties)
          Indicate the end of a feature being used.
static void featureStop(String feature, Properties properties)
          Indicate the end of a feature being used.
static void featureTick(String feature)
          Indicate a feature has been used.
static void featureTick(String feature, BinaryInfo binary, Properties properties)
          Indicate a feature has been used.
static void featureTick(String feature, Properties properties)
          Indicate a feature has been used.
static boolean isApplicationStarted()
          Has the application been started?
static boolean isOptIn()
          Return true if the user has opted-in to sending messages.
static void performanceProbe()
          Deprecated. Use performanceProbe(String)
static void performanceProbe(BinaryInfo binary, Properties properties)
          Deprecated. Use performanceProbe(String, BinaryInfo, Properties)
static void performanceProbe(Properties properties)
          Deprecated. Use performanceProbe(String, Properties)
static void performanceProbe(String name)
          Sends performance information.
static void performanceProbe(String name, BinaryInfo binary, Properties properties)
          Sends performance information.
static void performanceProbe(String name, Properties properties)
          Sends performance information.
static void reportException(Throwable exception, int type)
          Send exception information.
static void reportException(Throwable exception, int type, BinaryInfo binary, Properties properties)
          Send exception information.
static void reportException(Throwable exception, int type, Properties properties)
          Send exception information.
static void reportException(Throwable exception, int type, String comment, String contact, BinaryInfo binary, Properties properties)
          Send exception information.
static void reset()
          Reset the state of the system.
static void sendExpiredMessage(Token token)
          Performs an expiration check and sends a message to a PreEmptive Analytics server.
static void sendExpiredMessage(Token token, BinaryInfo binary)
          Performs an expiration check and sends a message to a PreEmptive Analytics server.
static void sendExpiredMessage(Token token, BinaryInfo binary, Properties properties)
          Performs an expiration check and sends a message to a PreEmptive Analytics server.
static void sendExpiredMessage(Token token, Properties properties)
          Performs an expiration check and sends a message to a PreEmptive Analytics server.
static void sendTamperMessage()
          Sends a tamper message to the a PreEmptive Analytics server.
static void sendTamperMessage(BinaryInfo binary)
          Sends a tamper message to a PreEmptive Analytics server.
static void sendTamperMessage(BinaryInfo binary, Properties properties)
          Sends a tamper message to a PreEmptive Analytics server.
static void sendTamperMessage(Properties properties)
          Sends a tamper message to the a PreEmptive Analytics server.
static void setApplicationId(String applicationId)
          Sets the application ID that accompanies the start message.
static void setApplicationInstance(String applicationInstance)
          Sets the optional instance identifier for the application.
static void setApplicationName(String applicationName)
          Sets the optional application name that accompanies the start message.
static void setApplicationType(String applicationType)
          Sets the optional application type.
static void setApplicationVersion(String applicationVersion)
          Sets the optional application version string.
static void setCompanyId(String companyId)
          Sets the company ID that accompanies the start message.
static void setCompanyName(String companyName)
          Sets the optional company name that accompanies the start message.
static void setFlowController(FlowController flowController)
          Set the flow controller for message transmission.
static void setFullDataMode(boolean fullDataMode)
          Sets the amount of information to be sent about the user and host.
static void setOmitPersonalInfo(boolean omitPII)
          Sets if Personal Identifiable Information(PII), should be sent with the analytics information.
static void setOptIn(boolean optIn)
          Set whether the user has opted-in to sending messages.
static void setSendDisabled(boolean sendDisabled)
          Set whether messages are sent to the sever.
static void setSendInterval(int sendInterval)
          Set the interval between transmission of messages.
static void setServiceEndpoint(String endPoint)
          Set the location that will receive the generated messages.
static void setSupportOfflineMode(boolean supportOfflineMode)
          Set whether messages that cannot be immediately sent to the server are stored for later transmission.
static void setUseSsl(boolean useSsl)
          Set the method of communication.
static void startApplication()
          Start the application.
static void startApplication(Object context, BinaryInfo binary, Properties properties)
          Start the application.
static void startApplication(Object context, Properties properties)
          Start the application.
static void startApplication(Properties properties)
          Start the application.
static void stopApplication()
          Stop the application.
static void stopApplication(BinaryInfo binary, Properties properties)
          Stop the application.
static void stopApplication(Properties properties)
          Stop the application.
static void systemProfile()
          Send system profile information.
static void systemProfile(BinaryInfo binary, Properties properties)
          Send system profile information.
static void systemProfile(Properties properties)
          Send system profile information.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RIS_OPTIN

public static final String RIS_OPTIN
System property name.


RIS_SEND_DISABLED

public static final String RIS_SEND_DISABLED
System property name.


RIS_LOG_MESSAGES

public static final String RIS_LOG_MESSAGES
System property name.


RIS_SUPPORT_OFFLINE

public static final String RIS_SUPPORT_OFFLINE
System property name.


RIS_SSL

public static final String RIS_SSL
System property name.


RIS_ENDPOINT

public static final String RIS_ENDPOINT
System property name.


RIS_FULL_DATA

public static final String RIS_FULL_DATA
System property name.


RIS_OMIT_PII

public static final String RIS_OMIT_PII
System property name.


EXCEPTION_THROWN

public static final int EXCEPTION_THROWN
Exception type : an exception that is being thrown.

See Also:
Constant Field Values

EXCEPTION_CAUGHT

public static final int EXCEPTION_CAUGHT
Exception type : an exception that was caught.

See Also:
Constant Field Values

EXCEPTION_UNCAUGHT

public static final int EXCEPTION_UNCAUGHT
Exception type : an exception that was not caught or thrown.

See Also:
Constant Field Values

COMMERCIAL_END_POINT

public static final String COMMERCIAL_END_POINT
Subscription end point.


FREE_END_POINT

public static final String FREE_END_POINT
Free end point.

Method Detail

reset

public static void reset()
Reset the state of the system. The reset is ignored if the the application is currently running. All values are set to their initial values.


isApplicationStarted

public static boolean isApplicationStarted()
Has the application been started?

Returns:
true if the application has been started, and is still running. If startApplication() has not yet been called or if stopApplication() has been called this will return false.

setSendInterval

public static void setSendInterval(int sendInterval)
Set the interval between transmission of messages. This value cannot be changed when the application is running. This is used by the default flow control mechanism.

Parameters:
sendInterval - the interval between transmission of messages in milliseconds.
See Also:
setFlowController(FlowController)

setFlowController

public static void setFlowController(FlowController flowController)
Set the flow controller for message transmission. This value cannot be changed when the application is running.

Parameters:
flowController - the new controller. If null, then a default flow controller will be used.

setSendDisabled

public static void setSendDisabled(boolean sendDisabled)
Set whether messages are sent to the sever. This state can be changed at any time even when the application is running. When set to true messages will not be sent to the server. If off-line support has been enabled then the messages may be stored locally and sent to the server. If off-line support is disabled then the messages will be discarded.

Parameters:
sendDisabled - the new value for controlling if messages are sent to the server.
See Also:
ris.send.disabled, setOptIn(boolean), setSupportOfflineMode(boolean)

setSupportOfflineMode

public static void setSupportOfflineMode(boolean supportOfflineMode)
Set whether messages that cannot be immediately sent to the server are stored for later transmission. This state can be changed at any time even when the application is running. When set to true messages that cannot be sent to the server due to network failures or having send disabled are stored locally for later transmission. When false those messages that cannot be sent are discarded.

Parameters:
supportOfflineMode - the new value for controlling the storing of messages that cannot be immediately sent to the server.
Since:
6.4.1
See Also:
setSendDisabled(boolean)

setOptIn

public static void setOptIn(boolean optIn)
Set whether the user has opted-in to sending messages. This state can be changed at any time even when the application is running. When set to false messages will not be sent to the server. Setting the value to false does not end a running application - you must call stopApplication(). Setting the value to true does not start the application - you must call startApplication().

Parameters:
optIn - the new value for the opting-in to sending messages.
See Also:
ris.optin, setSendDisabled(boolean), isOptIn()

isOptIn

public static boolean isOptIn()
Return true if the user has opted-in to sending messages.

Returns:
true if the user has opted-in to sending messages.
See Also:
ris.optin, setOptIn(boolean)

setUseSsl

public static void setUseSsl(boolean useSsl)
Set the method of communication. This value cannot be changed when the application is running.

Parameters:
useSsl - true if SSL should be used for transmission of messages.
See Also:
ris.ssl

setServiceEndpoint

public static void setServiceEndpoint(String endPoint)
Set the location that will receive the generated messages. This value cannot be changed when the application is running.

Parameters:
endPoint - the location that will receive the messages. This is a partial URL that includes the host and file portion but not the protocol. If null then the default end point is used.
Since:
6.4.1
See Also:
ris.endpoint

setCompanyName

public static void setCompanyName(String companyName)
Sets the optional company name that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
companyName - the optional company name.

setCompanyId

public static void setCompanyId(String companyId)
Sets the company ID that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
companyId - the ID for the company that produced the application. The format of the value is a GUID.

setApplicationName

public static void setApplicationName(String applicationName)
Sets the optional application name that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
applicationName - the optional name of the application.

setApplicationId

public static void setApplicationId(String applicationId)
Sets the application ID that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
applicationId - the ID for the application. The format of the value is a GUID.

setApplicationVersion

public static void setApplicationVersion(String applicationVersion)
Sets the optional application version string. This value cannot be changed when the application is running.

Parameters:
applicationVersion - the version string for the application. This may take any user defined form.

setApplicationType

public static void setApplicationType(String applicationType)
Sets the optional application type. This value cannot be changed when the application is running.

Parameters:
applicationType - the type of the application. This may take any user defined form.

setApplicationInstance

public static void setApplicationInstance(String applicationInstance)
Sets the optional instance identifier for the application. This value is typically a serial or registration number. This value cannot be changed when the application is running. If not provided, the API may generate a unique string which will be used.

Parameters:
applicationInstance - the instance identifier string for the application. This may take any user defined form.

setFullDataMode

public static void setFullDataMode(boolean fullDataMode)
Sets the amount of information to be sent about the user and host. On some platforms the operations required to gather the full information on the user and host can be time consuming. By setting this value to false the gathering of the optional information will be skipped.

Parameters:
fullDataMode - if true then all possible information about the user and host will be sent. If false then a minimal set of information will be sent.

setOmitPersonalInfo

public static void setOmitPersonalInfo(boolean omitPII)
Sets if Personal Identifiable Information(PII), should be sent with the analytics information. PII includes information like IP addresses, MAC identifiers, and names that could be used to identify the user or machine. This value must be set prior to application start.

Parameters:
omitPII - if true then no PII will be sent. false then PII will be sent.

startApplication

public static void startApplication()
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started. If instrumenting a mobile application you should use one of the methods with a context parameter.

See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setFullDataMode(boolean), setOptIn(boolean), setOmitPersonalInfo(boolean), setSendDisabled(boolean), ris.log.messages

startApplication

public static void startApplication(Properties properties)
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started. If instrumenting a mobile application you should use one of the methods with a context parameter.

Parameters:
properties - optional properties to be sent with the message
See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setFullDataMode(boolean), setOptIn(boolean), setOmitPersonalInfo(boolean), setSendDisabled(boolean), ris.log.messages

startApplication

public static void startApplication(Object context,
                                    Properties properties)
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started.

Parameters:
context - optional context object.
properties - optional properties to be sent with the message
See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setFullDataMode(boolean), setOptIn(boolean), setOmitPersonalInfo(boolean), setSendDisabled(boolean), ris.log.messages

startApplication

public static void startApplication(Object context,
                                    BinaryInfo binary,
                                    Properties properties)
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started.

Parameters:
context - optional context object.
binary - optional information about the program element requesting the start
properties - optional properties to be sent with the message
See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setFullDataMode(boolean), setOptIn(boolean), setOmitPersonalInfo(boolean), setSendDisabled(boolean), ris.log.messages

stopApplication

public static void stopApplication()
Stop the application. This causes a stop message to be sent if the application is running.

See Also:
startApplication()

stopApplication

public static void stopApplication(Properties properties)
Stop the application. This causes a stop message to be sent if the application is running.

Parameters:
properties - optional properties to be sent with the message
See Also:
startApplication()

stopApplication

public static void stopApplication(BinaryInfo binary,
                                   Properties properties)
Stop the application. This causes a stop message to be sent if the application is running.

Parameters:
binary - optional information about the program element requesting the stop
properties - optional properties to be sent with the message
See Also:
startApplication()

sendTamperMessage

public static void sendTamperMessage()
Sends a tamper message to the a PreEmptive Analytics server.


sendTamperMessage

public static void sendTamperMessage(Properties properties)
Sends a tamper message to the a PreEmptive Analytics server.

Parameters:
properties - optional properties to be sent with the message

sendTamperMessage

public static void sendTamperMessage(BinaryInfo binary)
Sends a tamper message to a PreEmptive Analytics server.

Parameters:
binary - optional information about the program element sending the message

sendTamperMessage

public static void sendTamperMessage(BinaryInfo binary,
                                     Properties properties)
Sends a tamper message to a PreEmptive Analytics server.

Parameters:
binary - optional information about the program element sending the message
properties - optional properties to be sent with the message

sendExpiredMessage

public static void sendExpiredMessage(Token token)
Performs an expiration check and sends a message to a PreEmptive Analytics server.

Parameters:
token - the token that defines the application's expiration time. If null then application is considered expired.

sendExpiredMessage

public static void sendExpiredMessage(Token token,
                                      Properties properties)
Performs an expiration check and sends a message to a PreEmptive Analytics server.

Parameters:
token - the token that defines the application's expiration time. If null then application is considered expired.
properties - optional properties to be sent with the message

sendExpiredMessage

public static void sendExpiredMessage(Token token,
                                      BinaryInfo binary)
Performs an expiration check and sends a message to a PreEmptive Analytics server.

Parameters:
token - the token that defines the application's expiration time. If null then application is considered expired.
binary - optional information about the program element sending the message

sendExpiredMessage

public static void sendExpiredMessage(Token token,
                                      BinaryInfo binary,
                                      Properties properties)
Performs an expiration check and sends a message to a PreEmptive Analytics server.

Parameters:
token - the token that defines the application's expiration time. If null then application is considered expired.
binary - optional information about the program element sending the message
properties - optional properties to be sent with the message

featureTick

public static void featureTick(String feature)
Indicate a feature has been used. This sends a feature tick message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
See Also:
featureStart(String), featureStop(String)

featureTick

public static void featureTick(String feature,
                               Properties properties)
Indicate a feature has been used. This sends a feature tick message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
properties - optional properties to be sent with the message
See Also:
featureStart(String), featureStop(String)

featureTick

public static void featureTick(String feature,
                               BinaryInfo binary,
                               Properties properties)
Indicate a feature has been used. This sends a feature tick message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
binary - optional information about the program element generating the tick
properties - optional properties to be sent with the message
See Also:
featureStart(String), featureStop(String)

featureStart

public static void featureStart(String feature)
Indicate the start of a feature being used. This sends a feature start message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
See Also:
featureStop(String)

featureStart

public static void featureStart(String feature,
                                Properties properties)
Indicate the start of a feature being used. This sends a feature start message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
properties - optional properties to be sent with the message
See Also:
featureStop(String)

featureStart

public static void featureStart(String feature,
                                BinaryInfo binary,
                                Properties properties)
Indicate the start of a feature being used. This sends a feature start message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
binary - optional information about the program element generating the feature start
properties - optional properties to be sent with the message
See Also:
featureStop(String)

featureStop

public static void featureStop(String feature)
Indicate the end of a feature being used. This sends a feature stop message if the application is running. The stop message must be paired with a previously sent start so that duration information can be computed.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
See Also:
featureStart(String)

featureStop

public static void featureStop(String feature,
                               Properties properties)
Indicate the end of a feature being used. This sends a feature stop message if the application is running. The stop message must be paired with a previously sent start so that duration information can be computed.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
properties - optional properties to be sent with the message
See Also:
featureStart(String)

featureStop

public static void featureStop(String feature,
                               BinaryInfo binary,
                               Properties properties)
Indicate the end of a feature being used. This sends a feature stop message if the application is running. The stop message must be paired with a previously sent start so that duration information can be computed.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
binary - optional information about the program element generating the feature stop
properties - optional properties to be sent with the message
See Also:
featureStart(String)

systemProfile

public static void systemProfile()
Send system profile information. This sends a system profile message if the application is running. The profile contains information about the user and various aspects of the system.


systemProfile

public static void systemProfile(Properties properties)
Send system profile information. This sends a system profile message if the application is running. The profile contains information about the user and various aspects of the system.

Parameters:
properties - optional properties to be sent with the message

systemProfile

public static void systemProfile(BinaryInfo binary,
                                 Properties properties)
Send system profile information. This sends a system profile message if the application is running. The profile contains information about the user and various aspects of the system.

Parameters:
binary - optional information about the program element requesting the profile
properties - optional properties to be sent with the message

performanceProbe

@Deprecated
public static void performanceProbe()
Deprecated. Use performanceProbe(String)

Sends performance information. This sends a performance probe message if the application is running. The information contains information about CPU and memory utilization.


performanceProbe

public static void performanceProbe(String name)
Sends performance information. This sends a performance probe message if the application is running. The information contains information about CPU and memory utilization.

Parameters:
name - the name for the location of the probe. This can be used to aggregate performance information.

performanceProbe

@Deprecated
public static void performanceProbe(Properties properties)
Deprecated. Use performanceProbe(String, Properties)

Sends performance information. This sends a performance probe message if the application is running. The information contains information about CPU and memory utilization.

Parameters:
properties - optional properties to be sent with the message

performanceProbe

public static void performanceProbe(String name,
                                    Properties properties)
Sends performance information. This sends a performance probe message if the application is running. The information contains information about CPU and memory utilization.

Parameters:
name - the name for the location of the probe. This can be used to aggregate performance information.
properties - optional properties to be sent with the message

performanceProbe

@Deprecated
public static void performanceProbe(BinaryInfo binary,
                                               Properties properties)
Deprecated. Use performanceProbe(String, BinaryInfo, Properties)

Sends performance information. This sends a performance probe message if the application is running. The information contains information about CPU and memory utilization.

Parameters:
binary - optional information about the program element requesting the probe
properties - optional properties to be sent with the message

performanceProbe

public static void performanceProbe(String name,
                                    BinaryInfo binary,
                                    Properties properties)
Sends performance information. This sends a performance probe message if the application is running. The information contains information about CPU and memory utilization.

Parameters:
name - the name for the location of the probe. This can be used to aggregate performance information.
binary - optional information about the program element requesting the probe
properties - optional properties to be sent with the message

reportException

public static void reportException(Throwable exception,
                                   int type)
Send exception information. This sends information about an exception to the server.

Parameters:
exception - the exception to be reported
type - the context type of the exception:

reportException

public static void reportException(Throwable exception,
                                   int type,
                                   Properties properties)
Send exception information. This sends information about an exception to the server.

Parameters:
exception - the exception to be reported
type - the context type of the exception:
properties - optional properties to be sent with the message

reportException

public static void reportException(Throwable exception,
                                   int type,
                                   BinaryInfo binary,
                                   Properties properties)
Send exception information. This sends information about an exception to the server.

Parameters:
exception - the exception to be reported
type - the context type of the exception:
binary - optional information about the program element where the exception was encountered
properties - optional properties to be sent with the message

reportException

public static void reportException(Throwable exception,
                                   int type,
                                   String comment,
                                   String contact,
                                   BinaryInfo binary,
                                   Properties properties)
Send exception information. This sends information about an exception to the server.

Parameters:
exception - the exception to be reported
type - the context type of the exception:
comment - user provided information describing the circumstances when the exception occurred
contact - user provided contact information, such as a name, email, phone number, etc.
binary - optional information about the program element where the exception was encountered
properties - optional properties to be sent with the message


Copyright © 2013 PreEmptive Solutions, LLC. All Rights Reserved.