Beispiel #1
0
 public CoreDataTransferrer(DataLayer _repo, LoggingDataLayer _logging_repo)
 {
     repo         = _repo;
     connString   = repo.ConnString;
     logging_repo = _logging_repo;
     db           = new DBUtilities(connString, logging_repo);
 }
Beispiel #2
0
 public DataTransferBuilder(Source _source, string _schema_name, string _source_conn_string, LoggingDataLayer _logging_repo)
 {
     source             = _source;
     repo               = new DataLayer("mdr");
     logging_repo       = _logging_repo;
     st_tr              = new StudyDataTransferrer(repo, logging_repo);
     ob_tr              = new ObjectDataTransferrer(repo, logging_repo);
     schema_name        = _schema_name;
     source_conn_string = _source_conn_string;
 }
Beispiel #3
0
        public JSONStudyDataLayer(LoggingDataLayer _logging_repo)
        {
            IConfigurationRoot settings = new ConfigurationBuilder()
                                          .SetBasePath(AppContext.BaseDirectory)
                                          .AddJsonFile("appsettings.json")
                                          .Build();

            NpgsqlConnectionStringBuilder builder = new NpgsqlConnectionStringBuilder();

            builder.Host     = settings["host"];
            builder.Username = settings["user"];
            builder.Password = settings["password"];
            builder.Database = "mdr";

            connString = builder.ConnectionString;

            ConstructStudyQueryStrings();
            study_json_folder = settings["study json folder"];
            logging_repo      = _logging_repo;
        }
Beispiel #4
0
        static async Task <int> RunOptionsAndReturnExitCodeAsync(Options opts)
        {
            // N.B. The aggregation process re-aggregates all the data from scratch.

            LoggingDataLayer logging_repo = new LoggingDataLayer();
            Aggregator       ag           = new Aggregator(logging_repo);

            logging_repo.OpenLogFile(opts);

            try
            {
                await ag.AggregateDataAsync(opts);

                return(0);
            }
            catch (Exception e)
            {
                logging_repo.LogError("Unhandled exception: " + e.Message);
                logging_repo.LogLine(e.StackTrace);
                logging_repo.LogLine(e.TargetSite.Name);
                logging_repo.CloseLog();
                return(-1);
            }
        }
 public StudyTableBuilder(string _db_conn, LoggingDataLayer _logging_repo)
 {
     db_conn      = _db_conn;
     logging_repo = _logging_repo;
 }
Beispiel #6
0
 public JSONHelper(string _connString, LoggingDataLayer _logging_repo)
 {
     connString   = _connString;
     logging_repo = _logging_repo;
     db           = new DBUtilities(connString, logging_repo);
 }
 public LinksDataHelper(DataLayer _repo, LoggingDataLayer _logging_repo)
 {
     repo         = _repo;
     connString   = repo.ConnString;
     logging_repo = _logging_repo;
 }
 public Aggregator(LoggingDataLayer _logging_repo)
 {
     logging_repo = _logging_repo;
     agg_event_id = logging_repo.GetNextAggEventId();
 }
 public StatisticsBuilder(int _agg_event_id, LoggingDataLayer _logging_repo)
 {
     logging_repo = _logging_repo;
     agg_event_id = _agg_event_id;
 }
Beispiel #10
0
 public DataTransferBuilder(LoggingDataLayer _logging_repo)
 {
     repo         = new DataLayer("mdr");
     logging_repo = _logging_repo;
     core_tr      = new CoreDataTransferrer(repo, logging_repo);
 }
Beispiel #11
0
 public DBUtilities(string _connstring, LoggingDataLayer _logging_repo)
 {
     connstring   = _connstring;
     logging_repo = _logging_repo;
 }
 public JSONObjectProcessor(JSONObjectDataLayer _repo, LoggingDataLayer _logging_repo)
 {
     repo         = _repo;
     logging_repo = _logging_repo;
 }
 public StudyLinkBuilder(DataLayer _repo, LoggingDataLayer _logging_repo)
 {
     repo         = _repo;
     logging_repo = _logging_repo;
     slh          = new LinksDataHelper(repo, logging_repo);
 }