Development

Configuring Reuters JSFC with Spring

Limitation is that the per service type configuration isn’t supported, but this is a start.

<bean id="reutersConfig" class="net.time4tea.reuters.ReutersConfiguration">
        <property name="serverType" value="sapi"/>
        <property name="serverList" value="xxx"/>
        <property name="serviceName" value="IDN_SELECTFEED"/>
        <property name="username" value="yyy"/>
    </bean>
package net.time4tea.reuters;
 
import com.reuters.utility.ObjectId;
import com.reuters.utility.config.ConfigDb;
import com.reuters.utility.config.ConfigVariable;
import com.reuters.utility.config.XConfigDb;
 
public class ReutersConfiguration implements ConfigDb {
    private XConfigDb config;
 
    public ReutersConfiguration() {
        config = new XConfigDb();
    }
 
    public void setAgentTimeout(int seconds) {
        addVariable("agentTimeout", seconds);
    }
 
    public void setAliasHeadlineRics(String aliasHeadlineRics) {
        addVariable("aliasHeadlineRics", aliasHeadlineRics);
    }
 
    public void setApplication(String application) {
        addVariable("application", application);
    }
 
    public void setAuthURL(String authURL) {
        addVariable("authURL", authURL);
    }
 
    public void setColumnsInPage(int columnsInPage) {
        addVariable("columnsInPage", columnsInPage);
    }
 
    public void setConflationRate(int seconds) {
        addVariable("conflationRate", seconds);
    }
 
    public void setConnectMaxRetryDelay(int connectMaxRetryDelay) {
        addVariable("connectMaxRetryDelay", connectMaxRetryDelay);
    }
 
    public void setConnectionRetryInterval(int connectionRetryInterval) {
        addVariable("connectionRetryInterval", connectionRetryInterval);
    }
 
    public void setConnectionTimeout(int connectionTimeout) {
        addVariable("connectionTimeout", connectionTimeout);
    }
 
    public void setCredential(String credential) {
        addVariable("credential", credential);
    }
 
    public void setDacsDaemon(String dacsDaemon) {
        addVariable("dacsDaemon", dacsDaemon);
    }
 
    public void setDacsPollRate(int dacsPollRate) {
        addVariable("dacsPollRate", dacsPollRate);
    }
 
    public void setDacsRetryRate(int dacsRetryRate) {
        addVariable("dacsRetryRate", dacsRetryRate);
    }
 
    public void setDacsSvcIdMap(String dacsSvcIdMap) {
        addVariable("dacsSvcIdMap", dacsSvcIdMap);
    }
 
    public void setDacsUsagePath(String dacsUsagePath) {
        addVariable("dacsUsagePath", dacsUsagePath);
    }
 
    public void setDacsUsageSize(int dacsUsageSize) {
        addVariable("dacsUsageSize", dacsUsageSize);
    }
 
    public void setDataURL(String url) {
        addVariable("dataURL", url);
    }
 
    public void setDefaultBgColor(int defaultBgColor) {
        addVariable("defaultBgColor", defaultBgColor);
    }
 
    public void setDefaultCharSet(String defaultCharSet) {
        addVariable("defaultCharSet", defaultCharSet);
    }
 
    public void setDefaultExchange(String defaultExchange) {
        addVariable("defaultExchange", defaultExchange);
    }
 
    public void setDefaultFcColor(int defaultFcColor) {
        addVariable("defaultFcColor", defaultFcColor);
    }
 
    public void setDefaultUser(String defaultUser) {
        addVariable("defaultUser", defaultUser);
    }
 
    public void setDictFromFile(boolean dictFromFile) {
        addVariable("dictFromFile", dictFromFile);
    }
 
    public void setDictionaryRpcTimeout(int dictionaryRpcTimeout) {
        addVariable("dictionaryRpcTimeout", dictionaryRpcTimeout);
    }
 
    public void setDisableFieldRipple(boolean disableFieldRipple) {
        addVariable("disableFieldRipple", disableFieldRipple);
    }
 
    public void setDumpFidDb(boolean dumpFidDb) {
        addVariable("dumpFidDb", dumpFidDb);
    }
 
    public void setDumpMessages(boolean dumpMessages) {
        addVariable("dumpMessages", dumpMessages);
    }
 
    public void setDynamicSourceTable(boolean dynamicSourceTable) {
        addVariable("dynamicSourceTable", dynamicSourceTable);
    }
 
    public void setEnableLockGeneration(boolean enableLockGeneration) {
        addVariable("enableLockGeneration", enableLockGeneration);
    }
 
    public void setEnablePermission(boolean enablePermission) {
        addVariable("enablePermission", enablePermission);
    }
 
    public void setEnumExpansion(boolean enumExpansion) {
        addVariable("enumExpansion", enumExpansion);
    }
 
    public void setEnumFilePath(String enumFilePath) {
        addVariable("enum_file_path", enumFilePath);
    }
 
    public void setEventQueueSleepTime(int eventQueueSleepTime) {
        addVariable("eventQueueSleepTime", eventQueueSleepTime);
    }
 
    public void setFidFilePath(String fidFilePath) {
        addVariable("fid_file_path", fidFilePath);
    }
 
    public void setHeadlineRic(String headlineRic) {
        addVariable("headlineRic", headlineRic);
    }
 
    public void setIpcServerName(String ipcServerName) {
        addVariable("ipcServerName", ipcServerName);
    }
 
    public void setIpcTraceFlags(int ipcTraceFlags) {
        addVariable("ipcTraceFlags", ipcTraceFlags);
    }
 
    public void setLazyDictionaryDownload(boolean lazyDictionaryDownload) {
        addVariable("lazyDictionaryDownload", lazyDictionaryDownload);
    }
 
    public void setMaxPendingLimit(int maxPendingLimit) {
        addVariable("maxPendingLimit", maxPendingLimit);
    }
 
    public void setMaxSourceSessions(int maxSourceSessions) {
        addVariable("maxSourceSessions", maxSourceSessions);
    }
 
    public void setMountTrace(boolean mountTrace) {
        addVariable("mountTrace", mountTrace);
    }
 
    public void setNewsSector(String newsSector) {
        addVariable("newsSector", newsSector);
    }
 
    public void setPageServices(String pageServices) {
        addVariable("pageServices", pageServices);
    }
 
    public void setPendingLimit(int pendingLimit) {
        addVariable("pendingLimit", pendingLimit);
    }
 
    public void setPendingRetryLimit(int pendingRetryLimit) {
        addVariable("pendingRetryLimit", pendingRetryLimit);
    }
 
    public void setPendingTimeout(int pendingTimeout) {
        addVariable("pendingTimeout", pendingTimeout);
    }
 
    public void setPermFieldName(String permFieldName) {
        addVariable("permFieldName", permFieldName);
    }
 
    public void setPortNumber(int portNumber) {
        addVariable("portNumber", portNumber);
    }
 
    public void setPosition(String position) {
        addVariable("position", position);
    }
 
    public void setQueueBatchSize(int queueBatchSize) {
        addVariable("queueBatchSize", queueBatchSize);
    }
 
    public void setQueueTimerInterval(int queueTimerInterval) {
        addVariable("queueTimerInterval", queueTimerInterval);
    }
 
    public void setQueueTrace(boolean queueTrace) {
        addVariable("queueTrace", queueTrace);
    }
 
    public void setRealtime(boolean bool) {
        addVariable("realTime", Boolean.toString(bool));
    }
 
    public void setReconnectInterval(int reconnectInterval) {
        addVariable("reconnectInterval", reconnectInterval);
    }
 
    public void setRecoveryEnabled(boolean recoveryEnabled) {
        addVariable("recoveryEnabled", recoveryEnabled);
    }
 
    public void setRecoveryRetryLimit(int recoveryRetryLimit) {
        addVariable("recoveryRetryLimit", recoveryRetryLimit);
    }
 
    public void setRecoveryRetryTime(int recoveryRetryTime) {
        addVariable("recoveryRetryTime", recoveryRetryTime);
    }
 
    public void setRowsInPage(int rowsInPage) {
        addVariable("rowsInPage", rowsInPage);
    }
 
    public void setRvDaemon(String rvDaemon) {
        addVariable("rvDaemon", rvDaemon);
    }
 
    public void setRvNetwork(String rvNetwork) {
        addVariable("rvNetwork", rvNetwork);
    }
 
    public void setRvPubDaemon(String rvPubDaemon) {
        addVariable("rvPubDaemon", rvPubDaemon);
    }
 
    public void setRvPubNetwork(String rvPubNetwork) {
        addVariable("rvPubNetwork", rvPubNetwork);
    }
 
    public void setRvPubService(String rvPubService) {
        addVariable("rvPubService", rvPubService);
    }
 
    public void setRvService(String rvService) {
        addVariable("rvService", rvService);
    }
 
    public void setRvUpdateDaemon(String rvUpdateDaemon) {
        addVariable("rvUpdateDaemon", rvUpdateDaemon);
    }
 
    public void setRvUpdateNetwork(String rvUpdateNetwork) {
        addVariable("rvUpdateNetwork", rvUpdateNetwork);
    }
 
    public void setRvUpdateService(String rvUpdateService) {
        addVariable("rvUpdateService", rvUpdateService);
    }
 
    public void setSectorList(String sectorList) {
        addVariable("sectorList", sectorList);
    }
 
    public void setServerList(String serverList) {
        addVariable("serverList", serverList);
    }
 
    public void setServerType(String type) {
        addVariable("serverType", type);
    }
 
    public void setSourceTable(String sourceTable) {
        addVariable("sourceTable", sourceTable);
    }
 
    public void setTibCustomer(String tibCustomer) {
        addVariable("tibCustomer", tibCustomer);
    }
 
    public void setTraceItemMessages(boolean traceItemMessages) {
        addVariable("traceItemMessages", traceItemMessages);
    }
 
    public void setTraceMessageRate(int traceMessageRate) {
        addVariable("traceMessageRate", traceMessageRate);
    }
 
    public void setUseFlavoredLicense(boolean useFlavoredLicense) {
        addVariable("useFlavoredLicense", useFlavoredLicense);
    }
 
    public void setUseSass3Java(boolean useSass3Java) {
        addVariable("useSass3Java", useSass3Java);
    }
 
    public void setUseSeparatePubSession(boolean useSeparatePubSession) {
        addVariable("useSeparatePubSession", useSeparatePubSession);
    }
 
    public void setUseSeparateUpdateSession(boolean useSeparateUpdateSession) {
        addVariable("useSeparateUpdateSession", useSeparateUpdateSession);
    }
 
    public void setServiceName(String serviceName) {
           addVariable("serviceName", serviceName);
    }
 
    public void setUsername(String username) {
        addVariable("username", username);
    }
 
    public boolean has(ObjectId objectid, String s) {
        return config.has(objectid, s);
    }
 
    public ConfigVariable variable(ObjectId objectid, String s) {
        return config.variable(objectid, s);
    }
 
    public ConfigVariable variable(ObjectId objectid, String s, String s1) {
        return config.variable(objectid, s, s1);
    }
 
    private void addVariable(String name, String value) {
        config.addVariable("*", name, value);
    }
 
    private void addVariable(String name, int value) {
        config.addVariable("*", name, Integer.toString(value));
    }
 
    private void addVariable(String name, boolean value) {
        config.addVariable("*", name, Boolean.toString(value));
    }
}
comments powered by Disqus