com.apama.eda
Event CustomHeader


Utility Event to work with custom EDA headers.

Example usage:

 CustomHeader cu := CustomHeader(myDictionary); //create CustomHeader event to add headers into myDictionary
cu.setString("StringHeader", "string1");

Member summary
 dictionary<stringstring>headers

Dictionary which holds standard headers, custom headers and filterable properties.
 
Action summary
 booleangetBoolean(string key)

Returns the boolean value of custom header if header is present and value can be parsed as boolean else false.
 floatgetDateTime(string key)

Returns the date-time string stored as number of seconds and fractional seconds elapsed since midnight, January 1, 1970 UTC. Return NaN if date-time string is not valid or does not contains timezone information.
 decimalgetDecimal(string key)

Returns the decimal value of custom header if header is present and value can be parsed as decimal value else 0.0d.
 floatgetFloat(string key)

Returns the float value of custom header if header is present and value can be parsed as float else 0.0.
 integergetInteger(string key)

Returns the integer value of custom header if header is present and value can be parsed as integer else 0.
 stringgetString(string key)

Returns the value of custom header as string if present else default empty string.
 booleanhasKey(string key)

Checks if specified custom header is present. The key is automatically prefixed with "$Event$Custom$" before checking.
 voidremoveKey(string key)

Removes the specified custom header if present.
 voidsetBoolean(string key, boolean value)

Sets the value of custom header to the specified value.
 voidsetDateTime(string key, float value)

Convert the float value to date-time string with UTC timezone and store. The float value is number of seconds and fractional seconds elapsed since midnight, January 1, 1970 UTC.
 voidsetDecimal(string key, decimal value)

Sets the value of custom header to the specified value.
 voidsetFloat(string key, float value)

Sets the value of custom header to the specified value.
 voidsetInteger(string key, integer value)

Sets the value of custom header to the specified value.
 voidsetString(string key, string value)

Sets the value of custom header to the specified value.
 
Member detail

headers

dictionary<stringstringheaders
Dictionary which holds standard headers, custom headers and filterable properties.
Action detail

getBoolean

boolean getBoolean(string key)
Returns the boolean value of custom header if header is present and value can be parsed as boolean else false.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.

getDateTime

float getDateTime(string key)
Returns the date-time string stored as number of seconds and fractional seconds elapsed since midnight, January 1, 1970 UTC. Return NaN if date-time string is not valid or does not contains timezone information.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.

getDecimal

decimal getDecimal(string key)
Returns the decimal value of custom header if header is present and value can be parsed as decimal value else 0.0d.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.

getFloat

float getFloat(string key)
Returns the float value of custom header if header is present and value can be parsed as float else 0.0.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.

getInteger

integer getInteger(string key)
Returns the integer value of custom header if header is present and value can be parsed as integer else 0.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.

getString

string getString(string key)
Returns the value of custom header as string if present else default empty string.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.

hasKey

boolean hasKey(string key)
Checks if specified custom header is present. The key is automatically prefixed with "$Event$Custom$" before checking.
Parameters:
key - The name of custom header

removeKey

void removeKey(string key)
Removes the specified custom header if present.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before checking and removing from the dictionary.

setBoolean

void setBoolean(string key, boolean value)
Sets the value of custom header to the specified value.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.
value - The boolean value

setDateTime

void setDateTime(string key, float value)
Convert the float value to date-time string with UTC timezone and store. The float value is number of seconds and fractional seconds elapsed since midnight, January 1, 1970 UTC.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.
value - Number of seconds and fractional seconds elapsed since midnight, January 1, 1970 UTC.

setDecimal

void setDecimal(string key, decimal value)
Sets the value of custom header to the specified value.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.
value - The decimal value

setFloat

void setFloat(string key, float value)
Sets the value of custom header to the specified value.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.
value - The float value

setInteger

void setInteger(string key, integer value)
Sets the value of custom header to the specified value.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.
value - The integer value

setString

void setString(string key, string value)
Sets the value of custom header to the specified value.
Parameters:
key - The name of custom header. The key is prefixed with "$Event$Custom$" before adding into the dictionary.
value - The string value