public void remove(DataSource source) {
    Assert.assertNotNull(source);

    // delete source
    dataSourceRepository.remove(source);

    // delete source db
    dataRepositoryCache.remove(source.getId());
    processorChainManager.removeAll(source);
    dataViewManager.removeAll(source);
    notificationManager.removeAll(source);
    dbConnectorFactory.deleteDatabase(source.getId());
  }
 public DataRepository getDataRepository(DataSource source) {
   Assert.assertNotNull(source);
   return dataRepositoryCache.get(source.getId());
 }
 private DataRepository createDataRepository(DataSource source) {
   DataRepository dataRepository =
       repositoryFactory.createSourceDataRepository(source.getId(), source.getDomainIdKey());
   dataRepositoryCache.put(source.getId(), dataRepository);
   return dataRepository;
 }