use of org.jumpmind.symmetric.service.impl.BandwidthService in project symmetric-ds by JumpMind.
the class AbstractSymmetricEngine method init.
protected void init() {
if (propertiesFactory == null) {
this.propertiesFactory = createTypedPropertiesFactory();
}
if (securityService == null) {
this.securityService = SecurityServiceFactory.create(getSecurityServiceType(), propertiesFactory.reload());
}
TypedProperties properties = this.propertiesFactory.reload();
String engineName = properties.get(ParameterConstants.ENGINE_NAME);
if (!StringUtils.contains(engineName, '`') && !StringUtils.contains(engineName, '(')) {
MDC.put("engineName", engineName);
}
this.platform = createDatabasePlatform(properties);
this.parameterService = new ParameterService(platform, propertiesFactory, properties.get(ParameterConstants.RUNTIME_CONFIG_TABLE_PREFIX, "sym"));
boolean parameterTableExists = this.platform.readTableFromDatabase(null, null, TableConstants.getTableName(properties.get(ParameterConstants.RUNTIME_CONFIG_TABLE_PREFIX), TableConstants.SYM_PARAMETER)) != null;
if (parameterTableExists) {
this.parameterService.setDatabaseHasBeenInitialized(true);
this.parameterService.rereadParameters();
}
// So that the key properties are initialized in a predictable order
parameterService.getNodeGroupId();
parameterService.getExternalId();
parameterService.getEngineName();
parameterService.getSyncUrl();
parameterService.getRegistrationUrl();
MDC.put("engineName", parameterService.getEngineName());
this.platform.setMetadataIgnoreCase(this.parameterService.is(ParameterConstants.DB_METADATA_IGNORE_CASE));
this.platform.setClearCacheModelTimeoutInMs(parameterService.getLong(ParameterConstants.CACHE_TIMEOUT_TABLES_IN_MS));
this.symmetricDialect = createSymmetricDialect();
this.extensionService = createExtensionService();
this.extensionService.refresh();
this.symmetricDialect.setExtensionService(extensionService);
this.parameterService.setExtensionService(extensionService);
this.bandwidthService = new BandwidthService(parameterService);
this.sequenceService = new SequenceService(parameterService, symmetricDialect);
this.stagingManager = createStagingManager();
this.nodeService = new NodeService(parameterService, symmetricDialect, securityService, extensionService);
this.configurationService = new ConfigurationService(parameterService, symmetricDialect, nodeService);
this.clusterService = new ClusterService(parameterService, symmetricDialect);
this.statisticService = new StatisticService(parameterService, symmetricDialect);
this.statisticManager = new StatisticManager(parameterService, nodeService, configurationService, statisticService, clusterService);
this.concurrentConnectionManager = new ConcurrentConnectionManager(parameterService, statisticManager);
this.purgeService = new PurgeService(parameterService, symmetricDialect, clusterService, statisticManager, extensionService);
this.transformService = new TransformService(parameterService, symmetricDialect, configurationService, extensionService);
this.loadFilterService = new LoadFilterService(parameterService, symmetricDialect, configurationService);
this.groupletService = new GroupletService(this);
this.triggerRouterService = new TriggerRouterService(this);
this.outgoingBatchService = new OutgoingBatchService(parameterService, symmetricDialect, nodeService, configurationService, sequenceService, clusterService, extensionService);
this.dataService = new DataService(this, extensionService);
this.routerService = buildRouterService();
this.nodeCommunicationService = buildNodeCommunicationService(clusterService, nodeService, parameterService, configurationService, symmetricDialect);
this.incomingBatchService = new IncomingBatchService(parameterService, symmetricDialect, clusterService);
this.dataExtractorService = new DataExtractorService(this);
this.transportManager = new TransportManagerFactory(this).create();
this.offlineTransportManager = new TransportManagerFactory(this).create(Constants.PROTOCOL_FILE);
this.dataLoaderService = new DataLoaderService(this);
this.registrationService = new RegistrationService(this);
this.acknowledgeService = new AcknowledgeService(this);
this.pushService = new PushService(parameterService, symmetricDialect, dataExtractorService, acknowledgeService, transportManager, nodeService, clusterService, nodeCommunicationService, statisticManager, configurationService, extensionService);
this.pullService = new PullService(parameterService, symmetricDialect, nodeService, dataLoaderService, registrationService, clusterService, nodeCommunicationService, configurationService, extensionService);
this.offlinePushService = new OfflinePushService(parameterService, symmetricDialect, dataExtractorService, acknowledgeService, offlineTransportManager, nodeService, clusterService, nodeCommunicationService, statisticManager, configurationService, extensionService);
this.offlinePullService = new OfflinePullService(parameterService, symmetricDialect, nodeService, dataLoaderService, clusterService, nodeCommunicationService, configurationService, extensionService, offlineTransportManager);
this.fileSyncService = buildFileSyncService();
this.fileSyncExtractorService = new FileSyncExtractorService(this);
this.mailService = new MailService(parameterService, symmetricDialect);
this.contextService = new ContextService(parameterService, symmetricDialect);
this.jobManager = createJobManager();
extensionService.addExtensionPoint(new DefaultOfflineServerListener(statisticManager, nodeService, outgoingBatchService));
IOfflineClientListener defaultlistener = new DefaultOfflineClientListener(parameterService, nodeService);
extensionService.addExtensionPoint(defaultlistener);
extensionService.addExtensionPoint(defaultlistener);
if (registerEngine) {
registerHandleToEngine();
}
}
Aggregations