Capital Markets Adapters 10.3.1 | Apama Capital Markets Adapters Documentation 10.3.1 | BM+F Bovespa UMDF Adapter | Instrument static data management
 
Instrument static data management
Security Definition records are managed on a per-channel basis by the BVMF_UMDF_SecurityDefinitionManager service monitor. The monitor is controlled and configured by the following configuration event (in package com.apama.bvmf_umdf):

event SecurityDefinitionChannelConfiguration {
string connection;
integer channel;
dictionary<string, string> configuration;

// actions not shown here
}
One of these events should be sent to the correlator to initialise the security definition handler for each channel of interest. The "connection" field should match the session name from the SessionConfiguration event, and the channel should match a ChannelID in the IAF configuration file.
The "extraParams" field recognises the following keys and values:
*"shutdown" (boolean, default is false): If true, delete the handler for this channel.
*"refreshNow" (boolean, default is false): If true, request an immediate refresh of security definitions on this channel from the adapter transport.
*"loadNow" (boolean, default is true on channel creation, false for subsequent configurations): If true, immediately reload the security definitions for the channel from the cache file.
*"saveNow" (boolean, default is false): If true, immediately save the security definitions for the channel to the cache file.
*"enableAutoRefresh" (boolean, default is false): If true, enable scheduled automatic refresh of the security definitions for the channel. Only has any effect if on of "refreshAt" or "refreshEvery" is also specified.
*"refreshAt" (string, default is ""): A string with 5 comma-separated elements to be used as the arguments to an EPL "on all at()" listener(minute,hour,day,month,dayofweek). The listener will request a refresh from the network every time it fires. For example, to refresh every day at midnight, use "0,0,*,*,*".
*"refreshEvery" (float, default is 0.0): A number of seconds to wait between automatic refresh requests. Ignored if "refreshAt" is also specified.
*"enableCache" (boolean, default is true): Enable loading/saving of security definitions for the channel from/to a local cache file.
*"cacheFile" (string, default is <connection>_<channel>_SecurityDefinition_CACHE.dat): The name of the local cache file for security definitions from this channel.
A channel may be reconfigured at any time by sending another SecurityDefinitionChannelConfiguration event with the same connection and channel fields, and a different set of extraParams keys/value. For example, the security definition handlers for channels 1 (FX Futures) and 55 (Stock Indexes and ETFs) might be configured as follows:

com.apama.bvmf_umdf.SecurityDefinitionChannelConfiguration
("UMDF_ADAPTER",1,{"refreshNow":"true","enableAutoRefresh":"true",
"refreshAt":"0,0,*,*,*"})
com.apama.bvmf_umdf.SecurityDefinitionChannelConfiguration
("UMDF_ADAPTER",55,{"enableAutoRefresh":"true","refreshEvery":"3600.0",
"cacheFile":"55.dat"})
Once configured, the handler can be queried for security definitions using the following event (again, in the com.apama.bvmf_umdf package):

event SecurityDefinitionRequest {
string connection;
integer channel;
string symbol;
dictionary<string, string> extraParams;
}
The "connection" and "channel" parameters are the same as for the channel configuration. The "symbol" field holds the symbol description (FIX tag 107) for the security. The "extraParams" field holds any additional data needed for the lookup, although currently no keys are defined for this event. Each lookup request will route a com.apama.bvmf_umdf.SecurityDefinitionResponse event in reply:

event SecurityDefinitionResponse {
string connection;
integer channel;
string symbol;
boolean found;
SecurityDefinition record;
dictionary<string, string> extraParams;
}
The fields of this event will be identical to the request except that the "record" field - holding the returned security definition - is added, and the "found" field is set to "true" if the requested record was found. If the record was *not* found, "found" will be "false" and the "record" field should be ignored.
To make it easier to write monitors that use the security definition manager, one of the following events will be routed whenever a load, refresh or load operation completes, respectively:

event SecurityDefinitionLoadComplete {
string connection;
integer channel;
}

event SecurityDefinitionRefreshComplete {
string connection;
integer channel;
}

event SecurityDefinitionSaveComplete {
string connection;
integer channel;
}
The "connection" and "channel" fields will be identical to those used in the configuration event.