private readonly Cfg.Configuration _configuration;         //for serialization

        private AuditConfiguration(Cfg.Configuration cfg, IMetaDataProvider metaDataProvider)
        {
            //this might be over kill - move back into MetaDataStore later if not needed for other stuff...
            var metaDataAdders = new List <IMetaDataAdder> {
                new AuditMappedByMetaDataAdder(cfg)
            };

            var mds        = new MetaDataStore(cfg, metaDataProvider, metaDataAdders);
            var properties = cfg.Properties;

            GlobalCfg = new GlobalConfiguration(this, properties);

            var revInfoCfg       = new RevisionInfoConfiguration(GlobalCfg, mds);
            var revInfoCfgResult = revInfoCfg.Configure(cfg);

            AuditEntCfg         = new AuditEntitiesConfiguration(properties, revInfoCfgResult.RevisionInfoEntityName);
            AuditProcessManager = new AuditProcessManager(revInfoCfgResult.RevisionInfoGenerator);

            RevisionTimestampGetter = ReflectionTools.GetGetter(revInfoCfgResult.RevisionInfoClass, revInfoCfgResult.RevisionInfoTimestampData);

            RevisionInfoQueryCreator  = revInfoCfgResult.RevisionInfoQueryCreator;
            RevisionInfoNumberReader  = revInfoCfgResult.RevisionInfoNumberReader;
            ModifiedEntityNamesReader = revInfoCfgResult.ModifiedEntityNamesReader;
            EntCfg = new EntitiesConfigurator()
                     .Configure(cfg, mds, GlobalCfg, AuditEntCfg, revInfoCfgResult.RevisionInfoXmlMapping, revInfoCfgResult.RevisionInfoRelationMapping);
            _configuration = cfg;
        }
        //public AuditEntitiesConfiguration getAuditEntCfg() {
        //    return auditEntCfg;
        //}

        //public AuditSyncManager getSyncManager() {
        //    return auditSyncManager;
        //}

        //public GlobalConfiguration getGlobalCfg() {
        //    return globalCfg;
        //}

        //public EntitiesConfigurations getEntCfg() {
        //    return entCfg;
        //}

        //public RevisionInfoQueryCreator getRevisionInfoQueryCreator() {
        //    return revisionInfoQueryCreator;
        //}

        //public RevisionInfoNumberReader getRevisionInfoNumberReader() {
        //    return revisionInfoNumberReader;
        //}

        //TODO Simon @SuppressWarnings({"unchecked"})

        public AuditConfiguration(NHibernate.Cfg.Configuration cfg) {
            IDictionary<string,string> properties = cfg.Properties;

            //ReflectionManager reflectionManager = ((AnnotationConfiguration) cfg).getReflectionManager();
            RevisionInfoConfiguration revInfoCfg = new RevisionInfoConfiguration();
            RevisionInfoConfigurationResult revInfoCfgResult = revInfoCfg.configure(cfg);
            AuditEntCfg = new AuditEntitiesConfiguration(properties, revInfoCfgResult.RevisionInfoEntityName);
            GlobalCfg = new GlobalConfiguration(properties);
            AuditSyncManager = new AuditSyncManager(revInfoCfgResult.RevisionInfoGenerator);
            RevisionInfoQueryCreator = revInfoCfgResult.RevisionInfoQueryCreator;
            RevisionInfoNumberReader = revInfoCfgResult.RevisionInfoNumberReader;
            EntCfg = new EntitiesConfigurator().Configure(cfg, GlobalCfg, AuditEntCfg,
                    revInfoCfgResult.RevisionInfoXmlMapping, revInfoCfgResult.RevisionInfoRelationMapping);
        }
Пример #3
0
        //public AuditEntitiesConfiguration getAuditEntCfg() {
        //    return auditEntCfg;
        //}

        //public AuditSyncManager getSyncManager() {
        //    return auditSyncManager;
        //}

        //public GlobalConfiguration getGlobalCfg() {
        //    return globalCfg;
        //}

        //public EntitiesConfigurations getEntCfg() {
        //    return entCfg;
        //}

        //public RevisionInfoQueryCreator getRevisionInfoQueryCreator() {
        //    return revisionInfoQueryCreator;
        //}

        //public RevisionInfoNumberReader getRevisionInfoNumberReader() {
        //    return revisionInfoNumberReader;
        //}

        //TODO Simon @SuppressWarnings({"unchecked"})

        public AuditConfiguration(NHibernate.Cfg.Configuration cfg)
        {
            IDictionary <string, string> properties = cfg.Properties;

            //ReflectionManager reflectionManager = ((AnnotationConfiguration) cfg).getReflectionManager();
            RevisionInfoConfiguration       revInfoCfg       = new RevisionInfoConfiguration();
            RevisionInfoConfigurationResult revInfoCfgResult = revInfoCfg.configure(cfg);

            AuditEntCfg              = new AuditEntitiesConfiguration(properties, revInfoCfgResult.RevisionInfoEntityName);
            GlobalCfg                = new GlobalConfiguration(properties);
            AuditSyncManager         = new AuditSyncManager(revInfoCfgResult.RevisionInfoGenerator);
            RevisionInfoQueryCreator = revInfoCfgResult.RevisionInfoQueryCreator;
            RevisionInfoNumberReader = revInfoCfgResult.RevisionInfoNumberReader;
            EntCfg = new EntitiesConfigurator().Configure(cfg, GlobalCfg, AuditEntCfg,
                                                          revInfoCfgResult.RevisionInfoXmlMapping, revInfoCfgResult.RevisionInfoRelationMapping);
        }