Esempio n. 1
0
    public void Configure(object config)
    {
        string yaml = YamlHelpers.Serialize(config);
        FileSystemDalConfig fileSystemDalConfig = YamlHelpers.Deserialize <FileSystemDalConfig>(yaml);

        Configure(fileSystemDalConfig);
    }
Esempio n. 2
0
    public Dictionary <string, string> Configure(ISynapseDalConfig conifg)
    {
        if (conifg != null)
        {
            string s = YamlHelpers.Serialize(conifg.Config);
            FileSystemDalConfig fsds = YamlHelpers.Deserialize <FileSystemDalConfig>(s);

            _planPath = fsds.PlanFolderPath;
            _histPath = fsds.HistoryFolderPath;
            _splxPath = fsds.Security.FilePath;

            EnsurePaths();

            ProcessPlansOnSingleton   = fsds.ProcessPlansOnSingleton;
            ProcessActionsOnSingleton = fsds.ProcessActionsOnSingleton;

            LoadSuplex();

            if (_splxDal == null && fsds.Security.IsRequired)
            {
                throw new Exception($"Security is required.  Could not load security file: {_splxPath}.");
            }

            if (_splxDal != null)
            {
                _splxDal.LdapRoot = conifg.LdapRoot;
                _splxDal.GlobalExternalGroupsCsv = fsds.Security.GlobalExternalGroupsCsv;
            }
        }
        else
        {
            ConfigureDefaults();
        }

        string name = nameof(FileSystemDal);
        Dictionary <string, string> props = new Dictionary <string, string>
        {
            { name, CurrentPath },
            { $"{name} Plan path", _planPath },
            { $"{name} History path", _histPath },
            { $"{name} Security path", _splxPath }
        };

        return(props);
    }
Esempio n. 3
0
 public void Configure(FileSystemDalConfig fileSystemDalConfig)
 {
     FromYamlFile(fileSystemDalConfig.FilePath);
     AutomaticallyPersistChanges = fileSystemDalConfig.AutomaticallyPersistChanges;
     SerializeAsJson             = fileSystemDalConfig.SerializeAsJson;
 }