TPTP 4.4.0 Platform Project
Public API Specification

org.eclipse.tptp.logging.events.cbe.util
Class EventHelpers

java.lang.Object
  extended byorg.eclipse.tptp.logging.events.cbe.util.EventHelpers

public class EventHelpers
extends java.lang.Object

Miscellaneous routines to support functions such as validation, mapping and comparison.

Since:
1.0.1

Constructor Summary
EventHelpers()
           
 
Method Summary
static boolean compareUnorderedLists(java.util.List listOne, java.util.List listTwo)
          Compare two unordered List objects ignoring order.
static void convertObjectToCommonBaseEvent(CommonBaseEvent commonBaseEvent, java.lang.Object object, int maxReferences)
          Converts the parameter object to a CommonBaseEvent based on the Common Base Event v1.0.1 schema and sets the Common Base Event properties on the parameter Common Base Event.
static CommonBaseEvent convertObjectToCommonBaseEvent(java.lang.Object object, int maxReferences)
          Converts the parameter object to a CommonBaseEvent based on the Common Base Event v1.0.1 schema.
static ExtendedDataElement convertObjectToExtendedDataElement(java.lang.Object object, java.lang.String instanceName, int maxReferences, int currentReferenceCount)
          Converts the parameter object to a ExtendedDataElement using the following rules: The package and class name of the object is the 'name' property of the ExtendedDataElement.
static ExtendedDataElement convertToExtendedDataElement(java.lang.Throwable throwable)
          Maps data of the parameter java.lang.Throwable object to an Extended Data Element.
static ExtendedDataElement convertToExtendedDataElement(java.lang.Throwable throwable, java.lang.String name)
          Maps data of the parameter java.lang.Throwable object to an Extended Data Element with the parameter name.
static long dateToLong(java.lang.String xsdDateTime)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities.convertXsdDateTimeToMilliseconds(String).
static java.lang.String[] getExtendedDataElementValuesArray(java.lang.String values)
          Convenience API to transpose a values string to a values array, thereby ensuring the parameter values string does not exceed the 1024 character limit, as stated in the Common Base Event v1.0.1 specification.
static java.lang.String getFormattedDateString(long milliseconds)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities.getFormattedDateString(long).
static java.lang.String getFormattedDateString(long milliseconds, java.lang.String dateFormatPattern)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities#getFormattedDateString(long, String)).
static java.lang.String getFormattedDateString(java.lang.String xsdDateTime)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities#getFormattedDateString(String)).
static java.lang.String getFormattedDateString(java.lang.String xsdDateTime, java.lang.String dateFormatPattern)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities#getFormattedDateString(String, String))).
static java.lang.String getString(java.lang.String key)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle.getString(String).
static java.lang.String getString(java.lang.String key, java.lang.Object argument)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object)).
static java.lang.String getString(java.lang.String key, java.lang.Object[] arguments)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object[])).
static java.lang.String getString(java.lang.String key, java.lang.Object argumentA, java.lang.Object argumentB)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object, Object)).
static java.lang.String getString(java.lang.String key, java.lang.Object argumentA, java.lang.Object argumentB, java.lang.Object argumentC)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object, Object, Object)).
static java.lang.String getString(java.lang.String key, java.lang.Object argumentA, java.lang.Object argumentB, java.lang.Object argumentC, java.lang.Object argumentD)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object, Object, Object, Object)).
static java.lang.String longToDate(long milliseconds)
          Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities.convertMillisecondsToXsdDateTime(long).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventHelpers

public EventHelpers()
Method Detail

dateToLong

public static long dateToLong(java.lang.String xsdDateTime)
Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities.convertXsdDateTimeToMilliseconds(String).

Converts an XML Schema (XSD) dateTime time stamp to a long time stamp.

The XSD dateTime time stamp represents a finite-length sequence of characters following the following format pattern:

yyyy-MM-dd'T'HH:mm:ss[.SSSS]['Z'|Z]

For more information on the meaning of the individual symbols in the XSD dateTime time stamp format pattern, see the class comment header for SimpleDateFormat.

For example, March 14, 2006 11:32:01.001 AM UTC/GMT would be represented as:

2006-03-14T11:32:01.001Z

See the XSD dateTime primitive datatype documentation for more information.

The long time stamp represents the difference, measured in milliseconds, between the current time (Coordinated Universal Time (UTC) or Greenwich Mean Time (GMT)) and the standard base time. The standard base time is known as "the epoch", namely January 1, 1970 12:00:00 AM Coordinated Universal Time (UTC) or Greenwich Mean Time (GMT).

Note: Due to inconsistencies between XSD V1.0 and later versions of the XSD specification on representing zero or negative XSD dateTime time stamps, such as year 0 and year 1 Before Common Era (BCE or BC), this method will throw an IllegalArgumentException for parameter XSD dateTime time stamps before 0001-01-01T00:00:00.000Z or -62135769600000. See the XSD dateTime note for more information.

Parameters:
xsdDateTime - The XSD dateTime time stamp to be converted to a long (milliseconds) time stamp.
Returns:
The long (milliseconds) time stamp representation of the parameter XSD dateTime time stamp.
Throws:
java.lang.IllegalArgumentException - If the parameter XSD dateTime time stamp is not a valid XSD dateTime time stamp.

longToDate

public static java.lang.String longToDate(long milliseconds)
Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities.convertMillisecondsToXsdDateTime(long).

Converts along time stamp to an XML Schema (XSD) dateTime time stamp.

The long time stamp represents the difference, measured in milliseconds, between the current time (Coordinated Universal Time (UTC) or Greenwich Mean Time (GMT)) and the standard base time. The standard base time is known as "the epoch", namely January 1, 1970 12:00:00 AM Coordinated Universal Time (UTC) or Greenwich Mean Time (GMT).

The XSD dateTime time stamp represents a finite-length sequence of characters following the following format pattern:

yyyy-MM-dd'T'HH:mm:ss[.SSSS]['Z'|Z]

For more information on the meaning of the individual symbols in the XSD dateTime time stamp format pattern, see the class comment header for SimpleDateFormat.

For example, March 14, 2006 11:32:01.001 AM UTC/GMT would be represented as:

2006-03-14T11:32:01.001Z

See the XSD dateTime primitive datatype documentation for more information.

Note: Due to inconsistencies between XSD V1.0 and later versions of the XSD specification on representing zero or negative XSD dateTime time stamps, such as year 0 and year 1 Before Common Era (BCE or BC), this method will return a positive XSD dateTime time stamp for parameter long (milliseconds) time stamps before -62135769600000 or 0001-01-01T00:00:00.000Z. See the XSD dateTime note for more information.

Parameters:
milliseconds - The long (milliseconds) time stamp to be converted to an XSD dateTime time stamp.
Returns:
The XSD dateTime time stamp representation of the parameter long (milliseconds) time stamp .

getFormattedDateString

public static java.lang.String getFormattedDateString(long milliseconds)
                                               throws java.lang.IllegalArgumentException
Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities.getFormattedDateString(long).

Converts a long representing a Coordinated Universal Time (UTC) date in milliseconds to a formatted string using the default date format pattern.

The default date format is:

MMMM d, yyyy h:mm:ss.SSS a z

For more information on the meaning of the individual symbols in the default date format pattern, see the class comment header for java.util.SimpleDateFormat.

The time zone of the returned string is Coordinated Universal Time (UTC), represented as Greenwich Mean Time (GMT).

Parameters:
milliseconds - A long representing a Coordinated Universal Time (UTC) time stamp in milliseconds.
Returns:
The date as a formatted string using the default date format pattern (e.g. MMMM d, yyyy h:mm:ss.SSS a z).
Throws:
java.lang.IllegalArgumentException - If the long representing a Coordinated Universal Time (UTC) time stamp in milliseconds is negative.
See Also:
java.util.SimpleDateFormat

getFormattedDateString

public static java.lang.String getFormattedDateString(long milliseconds,
                                                      java.lang.String dateFormatPattern)
                                               throws java.lang.IllegalArgumentException
Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities#getFormattedDateString(long, String)).

Converts a long representing a Coordinated Universal Time (UTC) date in milliseconds to a formatted string using the parameter date format pattern.

When the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, date formatting is done by the SimpleDateFormat class using the ULocale (parameter Locale converted to a ULocale - see ULocale.forLocale(Locale)), GregorianCalendar and TimeZone (parameter time zone ID converted to a TimeZone - see TimeZone.getTimeZone(String)) classes, otherwise date formatting is done by the SimpleDateFormat class using the Locale, GregorianCalendar and TimeZone classes. That is, if the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, the parameter date format pattern is based on the syntax and symbols as specified in the class comment header of the SimpleDateFormat class, otherwise the parameter date format pattern is based on the syntax and symbols as specified in the class comment header of the java.util.SimpleDateFormat class.

The time zone of the returned string is Coordinated Universal Time (UTC), represented as Greenwich Mean Time (GMT).

Parameters:
milliseconds - A long representing a Coordinated Universal Time (UTC) time stamp in milliseconds.
dateFormatPattern - The date format pattern.
Returns:
The date as a formatted string using the parameter date format pattern.
Throws:
java.lang.IllegalArgumentException - If the date format pattern invalid.
See Also:
SimpleDateFormat, Locale, GregorianCalendar, TimeZone, SimpleDateFormat, ULocale, GregorianCalendar, TimeZone

getFormattedDateString

public static java.lang.String getFormattedDateString(java.lang.String xsdDateTime)
                                               throws java.lang.IllegalArgumentException
Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities#getFormattedDateString(String)).

Converts a string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date to a formatted string using the default date format pattern.

For more information on the XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date, see http://www.w3.org/TR/NOTE-datetime.

The default date format is:

MMMM d, yyyy h:mm:ss.SSS a z

For more information on the meaning of the individual symbols in the default date format pattern, see the class comment header for java.util.SimpleDateFormat.

If the parameter string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date does not contain any time zone information, the time zone of the returned string is Coordinated Universal Time (UTC), represented as Greenwich Mean Time (GMT). Otherwise, the time zone of the returned string is represented as a signed offset from Greenwich Mean Time (GMT). For example, 'GMT-05:00' for Eastern Standard Time.

Parameters:
xsdDateTime - A string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date.
Returns:
The date as a formatted string using the default date format pattern (e.g. MMMM d, yyyy h:mm:ss.SSS a z).
Throws:
java.lang.IllegalArgumentException - If the string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date is invalid.
See Also:
java.util.SimpleDateFormat

getFormattedDateString

public static java.lang.String getFormattedDateString(java.lang.String xsdDateTime,
                                                      java.lang.String dateFormatPattern)
                                               throws java.lang.IllegalArgumentException
Deprecated. As of TPTP V4.2.0, use LoggingCoreUtilities#getFormattedDateString(String, String))).

Converts a string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date to a formatted string using the parameter date format pattern.

For more information on the XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date, see http://www.w3.org/TR/NOTE-datetime.

When the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, date formatting is done by the SimpleDateFormat class using the ULocale (parameter Locale converted to a ULocale - see ULocale.forLocale(Locale)), GregorianCalendar and TimeZone (parameter time zone ID converted to a TimeZone - see TimeZone.getTimeZone(String)) classes, otherwise date formatting is done by the SimpleDateFormat class using the Locale, GregorianCalendar and TimeZone classes. That is, if the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, the parameter date format pattern is based on the syntax and symbols as specified in the class comment header of the SimpleDateFormat class, otherwise the parameter date format pattern is based on the syntax and symbols as specified in the class comment header of the java.util.SimpleDateFormat class.

If the parameter string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date does not contain any time zone information, the time zone of the returned string is Coordinated Universal Time (UTC), represented as Greenwich Mean Time (GMT). Otherwise, the time zone of the returned string is represented as a signed offset from Greenwich Mean Time (GMT). For example, 'GMT-05:00' for Eastern Standard Time.

Parameters:
xsdDateTime - A string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date.
dateFormatPattern - The date format pattern.
Returns:
The date as a formatted string using the parameter date format pattern.
Throws:
java.lang.IllegalArgumentException - If the string representing an XML Schema dateTime (e.g. yyyy-MM-ddTHH:mm:ss) date is invalid or the date format pattern is invalid.
See Also:
SimpleDateFormat, Locale, GregorianCalendar, TimeZone, SimpleDateFormat, ULocale, GregorianCalendar, TimeZone

getString

public static java.lang.String getString(java.lang.String key)
Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle.getString(String).

Resolves the localized message associated with the parameter key from the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes.

If the key does not exist in the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes, the key is returned.

Noteworthy, the resultant message is not formatted (e.g. no message parameter substitution).

Parameters:
key - The key of the message in the resource bundle.
Returns:
The localized message associated with the parameter key from the resource bundle, otherwise the key.

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.Object argument)
Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object)).

Resolves the localized and formatted message associated with the parameter key and message parameter from the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes.

When the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, message formatting is done by the MessageFormat class using the ULocale class, otherwise message formatting is done by the MessageFormat class using the Locale class.

If the key does not exist in the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes, the key is returned.

Parameters:
key - The key of the message in the resource bundle.
argument - The first message parameter for formatting in the localized and formatted message.
Returns:
The localized and formatted message associated with the parameter key from the resource bundle, otherwise the key.
See Also:
MessageFormat, Locale, MessageFormat, ULocale

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.Object argumentA,
                                         java.lang.Object argumentB)
Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object, Object)).

Resolves the localized and formatted message associated with the parameter key and message parameters from the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes.

When the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, message formatting is done by the MessageFormat class using the ULocale class, otherwise message formatting is done by the MessageFormat class using the Locale class.

If the key does not exist in the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes, the key is returned.

Parameters:
key - The key of the message in the resource bundle.
argumentA - The first message parameter for formatting in the localized and formatted message.
argumentB - The second message parameter for formatting in the localized and formatted message.
Returns:
The localized and formatted message associated with the parameter key from the resource bundle, otherwise the key.
See Also:
MessageFormat, Locale, MessageFormat, ULocale

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.Object argumentA,
                                         java.lang.Object argumentB,
                                         java.lang.Object argumentC)
Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object, Object, Object)).

Resolves the localized and formatted message associated with the parameter key and message parameters from the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes.

When the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, message formatting is done by the MessageFormat class using the ULocale class, otherwise message formatting is done by the MessageFormat class using the Locale class.

If the key does not exist in the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes, the key is returned.

Parameters:
key - The key of the message in the resource bundle.
argumentA - The first message parameter for formatting in the localized and formatted message.
argumentB - The second message parameter for formatting in the localized and formatted message.
argumentC - The third message parameter for formatting in the localized and formatted message.
Returns:
The localized and formatted message associated with the parameter key from the resource bundle, otherwise the key.
See Also:
MessageFormat, Locale, MessageFormat, ULocale

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.Object argumentA,
                                         java.lang.Object argumentB,
                                         java.lang.Object argumentC,
                                         java.lang.Object argumentD)
Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object, Object, Object, Object)).

Resolves the localized and formatted message associated with the parameter key and message parameters from the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes.

When the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, message formatting is done by the MessageFormat class using the ULocale class, otherwise message formatting is done by the MessageFormat class using the Locale class.

If the key does not exist in the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes, the key is returned.

Parameters:
key - The key of the message in the resource bundle.
argumentA - The first message parameter for formatting in the localized and formatted message.
argumentB - The second message parameter for formatting in the localized and formatted message.
argumentC - The third message parameter for formatting in the localized and formatted message.
argumentD - The fourth message parameter for formatting in the localized and formatted message.
Returns:
The localized and formatted message associated with the parameter key from the resource bundle, otherwise the key.
See Also:
MessageFormat, Locale, MessageFormat, ULocale

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.Object[] arguments)
Deprecated. As of TPTP V4.2.0, use LoggingCoreResourceBundle#getString(String, Object[])).

Resolves the localized and formatted message associated with the parameter key and message parameters from the plugin[_<language code>[_<country code>]].properties resource bundle for the org.eclipse.hyades.logging.* classes.

When the International Components for Unicode (ICU) JAR(s) are available on the class path at run-time, message formatting is done by the MessageFormat class using the ULocale class, otherwise message formatting is done by the MessageFormat class using the Locale class.

If the key does not exist in the plugin[_<language code>[_<country code>]].properties resource bundle for org.eclipse.hyades.logging.* classes, the key is returned.

Parameters:
key - The key of the message in the resource bundle.
arguments - The array of message parameters for formatting in the localized and formatted message.
Returns:
The localized and formatted message associated with the parameter key from the resource bundle, otherwise the key.
See Also:
MessageFormat, Locale, MessageFormat, ULocale

convertToExtendedDataElement

public static ExtendedDataElement convertToExtendedDataElement(java.lang.Throwable throwable)
Maps data of the parameter java.lang.Throwable object to an Extended Data Element.

This API provides a structured representation of the parameter java.lang.Throwable object as an Extended Data Element with the following advantages:

NOTE: This API invoked in JRE 1.3.x and below run-time environments parses the stack trace produced by the java.lang.Throwable 'sprintStackTrace() API (e.g. no causal java.lang.Throwable (s)). Alternatively, this API invoked in JRE 1.4.x and above run-time environments utilizes the java.lang.Throwable's causal java.lang.Throwable and StackTraceElement (s) properties.

This API uses the following mapping to convert the parameter java.lang.Throwable object to an Extended Data Element:

This API uses the following mapping to convert the parameter java.lang.Throwable object to an Extended Data Element if the parameter java.lang.Throwable object is null:

Causal java.lang.Throwable s are recursively converted to Extended Data Elements using the following mapping:

...

NOTE: When the java.lang.Throwable's class name and localized message are greater than 1024 characters, the resultant class name and localized message string is segmented into a the first 1024-character elements of the values property. As such, the java.lang.Throwable's stack trace elements are transposed by the number of 1024-character elements in the values property.

Parameters:
throwable - The java.lang.Throwable object to be converted to an Extended Data Element.
Returns:
The Extended Data Element representation of the parameter java.lang.Throwable object.

convertToExtendedDataElement

public static ExtendedDataElement convertToExtendedDataElement(java.lang.Throwable throwable,
                                                               java.lang.String name)
Maps data of the parameter java.lang.Throwable object to an Extended Data Element with the parameter name.

This API provides a structured representation of the parameter java.lang.Throwable object as an Extended Data Element with the following advantages:

NOTE: This API invoked in JRE 1.3.x and below run-time environments parses the stack trace produced by the java.lang.Throwable 'sprintStackTrace() API (e.g. no causal java.lang.Throwable (s)). Alternatively, this API invoked in JRE 1.4.x and above run-time environments utilizes the java.lang.Throwable's causal java.lang.Throwable and StackTraceElement (s) properties.

This API uses the following mapping to convert the parameter java.lang.Throwable object to an Extended Data Element:

This API uses the following mapping to convert the parameter java.lang.Throwable object to an Extended Data Element if the parameter java.lang.Throwable object is null:

Causal java.lang.Throwable s are recursively converted to Extended Data Elements using the following mapping:

...

NOTE: When the java.lang.Throwable's class name and localized message are greater than 1024 characters, the resultant class name and localized message string is segmented into a the first 1024-character elements of the values property. As such, the java.lang.Throwable's stack trace elements are transposed by the number of 1024-character elements in the values property.

Parameters:
throwable - The java.lang.Throwable object to be converted to an Extended Data Element.
name - The name property of the Extended Data Element.
Returns:
The Extended Data Element representation of the parameter java.lang.Throwable object.

getExtendedDataElementValuesArray

public static java.lang.String[] getExtendedDataElementValuesArray(java.lang.String values)
Convenience API to transpose a values string to a values array, thereby ensuring the parameter values string does not exceed the 1024 character limit, as stated in the Common Base Event v1.0.1 specification.

If the parameter values property is larger than 1024 characters, the string is segmented into a String array of 1024-character elements. However, if the parameter values property is 1024 or less characters or null, the string is set directly on the first element a String array.

Parameters:
values - The values string to be transposed to a values array.

compareUnorderedLists

public static boolean compareUnorderedLists(java.util.List listOne,
                                            java.util.List listTwo)
Compare two unordered List objects ignoring order.

Parameters:
listOne - The first list in the comparison.
listTwo - The second list in the comparison.
Returns:
True if both parameter lists are equal ignoring order, otherwise false.

convertObjectToCommonBaseEvent

public static CommonBaseEvent convertObjectToCommonBaseEvent(java.lang.Object object,
                                                             int maxReferences)
Converts the parameter object to a CommonBaseEvent based on the Common Base Event v1.0.1 schema.

This method uses the following rules:

  1. The creationTime Common Base Event property is set to the current time.
  2. The globalInstanceId Common Base Event property is set to a unique GUID.
  3. The situation Common Base Event property is set to an internal, log and report situation.
  4. The sourceComponentId Common Base Event property is set to a default component ID for the calling logging facility.
  5. All simple instance properties of the object are the value(s) of a ExtendedDataElement with the package and class name of the object as the 'name' property of the ExtendedDataElement.
  6. All complex instance properties of the object are child ExtendedDataElement(s) of a ExtendedDataElement with the package and class name of the object as the 'name' property of the ExtendedDataElement.

Simple type of objects include:

If the parameter object is an instance of a CommonBaseEvent, it is cast to a CommonBaseEvent and returned.

Parameters:
object - The object to be converted to a Common Base Event.
maxReferences - The maximum number of referenced complex objects traversed.
Returns:
The generated Common Base Event from the parameter object.

convertObjectToCommonBaseEvent

public static void convertObjectToCommonBaseEvent(CommonBaseEvent commonBaseEvent,
                                                  java.lang.Object object,
                                                  int maxReferences)
Converts the parameter object to a CommonBaseEvent based on the Common Base Event v1.0.1 schema and sets the Common Base Event properties on the parameter Common Base Event.

This method uses the following rules:

  1. The creationTime Common Base Event property is set to the current time, if not previously set.
  2. The globalInstanceId Common Base Event property is set to a unique GUID, if not previously set.
  3. The situation Common Base Event property is set to an internal, log and report situation, if not previously set.
  4. The sourceComponentId Common Base Event property is set to a default component ID for the calling logging facility, if not previously set.
  5. All simple instance properties of the object are the value(s) of a ExtendedDataElement with the package and class name of the object as the 'name' property of the ExtendedDataElement.
  6. All complex instance properties of the object are child ExtendedDataElement(s) of a ExtendedDataElement with the package and class name of the object as the 'name' property of the ExtendedDataElement.

Simple type of objects include:

If the parameter object is an instance of a CommonBaseEvent, its properties are set on the parameter CommonBaseEvent using the precedence rules defined org.eclipse.hyades.logging.events.cbe.impl.TemplateContentHandlerImpl.

NOTE: The parameter CommonBaseEvent's existing ContentHandler, if any, is preserved for future use.

Parameters:
commonBaseEvent - The Common Base Event generated from converting the parameter object.
object - The object to be converted to a Common Base Event.
maxReferences - The maximum number of referenced complex objects traversed.

convertObjectToExtendedDataElement

public static ExtendedDataElement convertObjectToExtendedDataElement(java.lang.Object object,
                                                                     java.lang.String instanceName,
                                                                     int maxReferences,
                                                                     int currentReferenceCount)
Converts the parameter object to a ExtendedDataElement using the following rules:

  1. The package and class name of the object is the 'name' property of the ExtendedDataElement.
  2. All simple instance properties of the object are the value(s) of the ExtendedDataElement.
  3. All complex instance properties of the object are child ExtendedDataElement(s) of the ExtendedDataElement.

Simple type of objects include:

Parameters:
object - The complex object to be converted to an Extended Data Element.
instanceName - The instance name of the complex object to be converted to an Extended Data Element.
maxReferences - The maximum number of referenced complex objects traversed.
currentReferenceCount - The current number of referenced complex objects traversed.
Returns:
The generated Extended Data Element of the parameter complex object.

TPTP 4.4.0 Platform Project
Public API Specification