Getting Configuration Parameters
The JavaScript interface enables you to get two different sets of configuration properties, the filter specific properties, and the general replicator properties. The filter specific properties should be used to configure and specify configuration information unique to that instance of the filter configuration. Since multiple filter configurations using the same filter definition can be created, using the filter-specific content is the simplest method for obtaining this information.
Getting Filter Properties
To obtain the properties configured for the filter within the static configuration file according to the context of the filter configuration, use the
filterPropertiesclass with thegetString()method. For example, thedbrenamefilter uses two properties,dbsourceanddbtargetto identify the database to be renamed and the new name. The definition for the filter within the configuration file might be:replicator.filter.jsdbrename=com.continuent.tungsten.replicator.filter.JavaScriptFilterreplicator.filter.jsdbrename.script=${replicator.home.dir}/support/filters-javascript/dbrename.jsreplicator.filter.jsdbrename.dbsource=contactsreplicator.filter.jsdbrename.dbtarget=nyc_contactsWithin the JavaScript filter, they are retrieved using:
sourceName = filterProperties.getString("dbsource");targetName = filterProperties.getString("dbtarget");Generic Replicator Properties
General properties can be retrieved using the
propertiesclass and thegetString()method:master = properties.getString("replicator.thl.remote_uri");