public EsasSyncStrategy(SyncStrategySettings syncStrategySettings, IEsasEntitiesLoaderStrategy esasEntitiesLoaderStrategy, IEsasSyncDestination syncDestination, ISyncResultsDestination syncResultsDestination, ILogger logger)
 {
     _syncResultsDestination = syncResultsDestination;
     _logger = logger;
     SyncStrategySettings       = syncStrategySettings;
     EsasEntitiesLoaderStrategy = esasEntitiesLoaderStrategy;
     _esasSyncDestination       = syncDestination;
 }
Exemple #2
0
        private static List <IEsasSyncStrategy> CreateStandardEntitiesSyncs(EsasWsContextFactory esasWsContextFactory, ISyncResultsDestination whereToSendTheSyncResults, ILoadTimeStrategy loadTimeStrategy, ILogger logger, IEsasSyncDestination stagingDbDestination)
        {
            // let's hook up some sync-strategies
            List <IEsasSyncStrategy> standardEntitiesSyncs = new List <IEsasSyncStrategy>();

            // Virksomheds- og person-oplysninger
            IEsasSyncStrategy LandSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 30
            }, new LandLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(LandSync);
            IEsasSyncStrategy KommuneSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 35
            }, new KommuneLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(KommuneSync);
            IEsasSyncStrategy PostNrSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 40
            }, new PostnummerLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(PostNrSync);
            IEsasSyncStrategy BrancheSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 45
            }, new BrancheLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(BrancheSync);

            IEsasSyncStrategy InstitutionsVirksomhedSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 50
            }, new InstitutionVirksomhedLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(InstitutionsVirksomhedSync);
            IEsasSyncStrategy InstInstitutionsoplysningerSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 60
            }, new InstitutionsoplysningerLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(InstInstitutionsoplysningerSync);
            IEsasSyncStrategy AAfdelingsniveauSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 65
            }, new AfdelingsniveauLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AAfdelingsniveauSync);
            IEsasSyncStrategy AfdelingSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 70
            }, new AfdelingLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AfdelingSync);

            IEsasSyncStrategy PersonSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 75
            }, new PersonLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(PersonSync);
            IEsasSyncStrategy PersonOplysningSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 80
            }, new PersonoplysningLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(PersonOplysningSync);

            // opsætningstabeller, som øvrige syncs er afhængige af.
            IEsasSyncStrategy AnsøgningskortopsætningSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 90
            }, new AnsoegningskortOpsaetningLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AnsøgningskortopsætningSync);
            IEsasSyncStrategy PubliceringsSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 91
            }, new PubliceringLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(PubliceringsSync);
            IEsasSyncStrategy AdgangskravSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 92
            }, new AdgangskravLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AdgangskravSync);


            // Uddannelsesaktiviteter
            IEsasSyncStrategy UddannelsesaktivitetSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 100
            }, new UddannelsesaktivitetLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(UddannelsesaktivitetSync);
            IEsasSyncStrategy UddannelsesstrukturSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 200
            }, new UddannelsesstrukturLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(UddannelsesstrukturSync); // Uddannelsesstrukturen består af strukturelle uddannelseselementer på bekendtgørelsesniveau og på studieordningsniveau.
            IEsasSyncStrategy SueSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 250
            }, new StruktureltUddannelseselementLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(SueSync); // Et strukturelt uddannelseselement er enten et semester, et f*g eller en gruppering
            IEsasSyncStrategy AktivitetsUdbudSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 300
            }, new AktivitetsudbudLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AktivitetsUdbudSync);

            // PUE//Hold
            IEsasSyncStrategy PueSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 400
            }, new PlanlaegningsUddannelseselementLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(PueSync);
            IEsasSyncStrategy HoldSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 410
            }, new HoldLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(HoldSync);
            IEsasSyncStrategy SamlæsningSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 420
            }, new SamlaesningLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(SamlæsningSync);

            // Ansøgninger
            IEsasSyncStrategy RekvirenttypeSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 490
            }, new RekvirenttypeLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(RekvirenttypeSync);
            IEsasSyncStrategy AnsøgerSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 500
            }, new AnsoegerLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AnsøgerSync);

            IEsasSyncStrategy AnsøgningsopsætningSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 520
            }, new AnsoegningsopsaetningLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AnsøgningsopsætningSync);

            IEsasSyncStrategy AnsøgningsKorttekstSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 530
            }, new AnsoegningskortTekstLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AnsøgningsKorttekstSync);

            IEsasSyncStrategy AnsøgningskortSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 540
            }, new AnsoegningskortLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AnsøgningskortSync);

            IEsasSyncStrategy EksamenstypeSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 550
            }, new EksamenstypeLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(EksamenstypeSync);

            IEsasSyncStrategy OmrådenummerSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 555
            }, new OmraadenummerLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(OmrådenummerSync);

            IEsasSyncStrategy Områdenummeropsætningsync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 560
            }, new OmraadenummeropsaetningLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(Områdenummeropsætningsync);

            IEsasSyncStrategy OmrådeSpecialiseringSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 570
            }, new OmraadespecialiseringLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(OmrådeSpecialiseringSync);

            IEsasSyncStrategy SpecialiseringSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 580
            }, new SpecialiseringLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(SpecialiseringSync);

            IEsasSyncStrategy AfslagsbegrundelseSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 590
            }, new AfslagsbegrundelseLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AfslagsbegrundelseSync);

            IEsasSyncStrategy AnsøgningSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 600
            }, new AnsoegningLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AnsøgningSync);

            IEsasSyncStrategy AnsøgninghandlingSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 610
            }, new AnsoegningshandlingLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(AnsøgninghandlingSync);

            IEsasSyncStrategy BilagSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 620
            }, new BilagLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(BilagSync);

            IEsasSyncStrategy NationalAfgangsårsagSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 630
            }, new NationalAfgangsaarsagLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(NationalAfgangsårsagSync);

            IEsasSyncStrategy EnkeltfagSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 640
            }, new EnkeltfagLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(EnkeltfagSync);


            // GUEer/Studieforløb
            IEsasSyncStrategy IndskrivningsformSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 695
            }, new IndskrivningsformLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(IndskrivningsformSync);

            IEsasSyncStrategy StudieforløbSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 700
            }, new StudieforloebLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(StudieforløbSync);

            IEsasSyncStrategy BedømmelsesrundeSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 720
            }, new BedoemmelsesrundeLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(BedømmelsesrundeSync);
            IEsasSyncStrategy KarakterSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 740
            }, new KarakterLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(KarakterSync);

            IEsasSyncStrategy GueSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 750
            }, new GennemfoerelsesUddannelseselementLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(GueSync);

            IEsasSyncStrategy Bedømmelsesync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 760
            }, new BedoemmelseLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(Bedømmelsesync);

            // TODO: Fraværsårsag mangler endpoint - afvent SIU
            IEsasSyncStrategy FravaersaarsagSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 770
            }, new FravaersaarsagLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(FravaersaarsagSync);

            IEsasSyncStrategy StudieinaktivPeriodeSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 780
            }, new StudieinaktivPeriodeLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(StudieinaktivPeriodeSync);

            IEsasSyncStrategy MeritRegistreringSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 790
            }, new MeritRegistreringLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(MeritRegistreringSync);

            IEsasSyncStrategy PraktikomraadeSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 800
            }, new PraktikomraadeLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(PraktikomraadeSync);
            IEsasSyncStrategy PraktikopholdSync = new EsasSyncStrategy(new SyncStrategySettings {
                SyncPriorityNumber = 810
            }, new PraktikopholdLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);

            standardEntitiesSyncs.Add(PraktikopholdSync);

            //IEsasSyncStrategy BevisgrundlagSync = new EsasSyncStrategy(new SyncStrategySettings { SyncPriorityNumber = 820 }, new BevisgrundlagLoadStrategy(esasWsContextFactory, loadTimeStrategy, logger), stagingDbDestination, whereToSendTheSyncResults, logger);
            //standardEntitiesSyncs.Add(BevisgrundlagSync); // Meget stor og omfattende tabel, er ikke sikker på dens forretningsværdi. Undlader den, for now.

            return(standardEntitiesSyncs);
        }