Changeset 1795


Ignore:
Timestamp:
02/10/10 07:14:49 (5 years ago)
Author:
lowjoel
Message:

Renamed ManagerLibrary?.*Manager => ManagerLibrary?.*Registrar for consistency. Addresses #276: Implement Eraser Registrar Interface

Location:
branches/eraser6/CodeReview
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/Custom.cs

    r1792 r1795  
    5656            { 
    5757                CustomErasureMethod method = methods[guid]; 
    58                 ManagerLibrary.Instance.ErasureMethodManager.Add(new EraseCustom(method)); 
     58                ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new EraseCustom(method)); 
    5959            } 
    6060        } 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/DoD.cs

    r1793 r1795  
    5050            { 
    5151                //Set passes 1, 4 and 5 to be a random value 
    52                 Prng prng = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     52                Prng prng = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    5353                int rand = prng.Next(); 
    5454 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/FirstLast16KB.cs

    r1792 r1795  
    4040                //Try to retrieve the set erasure method 
    4141                if (DefaultPlugin.Settings.FL16Method != Guid.Empty) 
    42                     method = ManagerLibrary.Instance.ErasureMethodManager[ 
     42                    method = ManagerLibrary.Instance.ErasureMethodRegistrar[ 
    4343                        DefaultPlugin.Settings.FL16Method]; 
    4444                else if (ManagerLibrary.Settings.DefaultFileErasureMethod != Guid) 
    45                     method = ManagerLibrary.Instance.ErasureMethodManager[ 
     45                    method = ManagerLibrary.Instance.ErasureMethodRegistrar[ 
    4646                        ManagerLibrary.Settings.DefaultFileErasureMethod]; 
    4747                else 
    48                     method = ManagerLibrary.Instance.ErasureMethodManager[new Gutmann().Guid]; 
     48                    method = ManagerLibrary.Instance.ErasureMethodRegistrar[new Gutmann().Guid]; 
    4949            } 
    5050            catch (ErasureMethodNotFoundException) 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/RCMP_TSSIT_OPS_II.cs

    r1793 r1795  
    5252            get 
    5353            { 
    54                 Prng prng = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     54                Prng prng = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    5555                int rand = prng.Next(); 
    5656 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/USAF5020.cs

    r1793 r1795  
    5252            get 
    5353            { 
    54                 Prng prng = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     54                Prng prng = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    5555                int rand = prng.Next(); 
    5656 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/ErasureMethods/USArmyAR380_19.cs

    r1793 r1795  
    5252            get 
    5353            { 
    54                 Prng prng = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     54                Prng prng = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    5555                int rand = prng.Next(); 
    5656 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/FileSystems/Fat.cs

    r1793 r1795  
    6060                    //Then erase the file. 
    6161                    method.Erase(strm, long.MaxValue, 
    62                         ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng], 
     62                        ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng], 
    6363                        callback 
    6464                    ); 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/FileSystems/Ntfs.cs

    r1793 r1795  
    7171                                //Then run the erase task 
    7272                                method.Erase(strm, long.MaxValue, 
    73                                     ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng], 
     73                                    ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng], 
    7474                                    null); 
    7575 
     
    170170                { 
    171171                    method.Erase(strm, long.MaxValue, 
    172                         ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng], 
     172                        ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng], 
    173173                        null); 
    174174                } 
     
    192192                //Then erase the file. 
    193193                method.Erase(strm, long.MaxValue, 
    194                     ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng], 
     194                    ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng], 
    195195                    callback 
    196196                ); 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/FileSystems/Windows.cs

    r1793 r1795  
    300300                    //Erase the file 
    301301                    method.Erase(stream, long.MaxValue, 
    302                         ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng], 
     302                        ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng], 
    303303                        null); 
    304304                } 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/Plugin.cs

    r1793 r1795  
    3838 
    3939            //Then register the erasure methods et al. 
    40             ManagerLibrary.Instance.ErasureMethodManager.Add(new Gutmann());            //35 passes 
    41             ManagerLibrary.Instance.ErasureMethodManager.Add(new GutmannLite());        //10 passes 
    42             ManagerLibrary.Instance.ErasureMethodManager.Add(new DoD_EcE());            //7 passes 
    43             ManagerLibrary.Instance.ErasureMethodManager.Add(new RCMP_TSSIT_OPS_II());  //7 passes 
    44             ManagerLibrary.Instance.ErasureMethodManager.Add(new Schneier());           //7 passes 
    45             ManagerLibrary.Instance.ErasureMethodManager.Add(new VSITR());              //7 passes 
    46             ManagerLibrary.Instance.ErasureMethodManager.Add(new DoD_E());              //3 passes 
    47             ManagerLibrary.Instance.ErasureMethodManager.Add(new HMGIS5Enhanced());     //3 passes 
    48             ManagerLibrary.Instance.ErasureMethodManager.Add(new USAF5020());           //3 passes 
    49             ManagerLibrary.Instance.ErasureMethodManager.Add(new USArmyAR380_19());     //3 passes 
    50             ManagerLibrary.Instance.ErasureMethodManager.Add(new GOSTP50739());         //2 passes 
    51             ManagerLibrary.Instance.ErasureMethodManager.Add(new HMGIS5Baseline());     //1 pass 
    52             ManagerLibrary.Instance.ErasureMethodManager.Add(new Pseudorandom());       //1 pass 
     40            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new Gutmann());          //35 passes 
     41            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new GutmannLite());      //10 passes 
     42            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new DoD_EcE());          //7 passes 
     43            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new RCMP_TSSIT_OPS_II());    //7 passes 
     44            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new Schneier());         //7 passes 
     45            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new VSITR());                //7 passes 
     46            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new DoD_E());                //3 passes 
     47            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new HMGIS5Enhanced());       //3 passes 
     48            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new USAF5020());         //3 passes 
     49            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new USArmyAR380_19());       //3 passes 
     50            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new GOSTP50739());           //2 passes 
     51            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new HMGIS5Baseline());       //1 pass 
     52            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new Pseudorandom());     //1 pass 
    5353            EraseCustom.RegisterAll(); 
    54             ManagerLibrary.Instance.ErasureMethodManager.Add(new FirstLast16KB()); 
     54            ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new FirstLast16KB()); 
    5555 
    56             ManagerLibrary.Instance.PRNGManager.Add(new RngCrypto()); 
     56            ManagerLibrary.Instance.PrngRegistrar.Add(new RngCrypto()); 
    5757 
    58             ManagerLibrary.Instance.FileSystemManager.Add(new Fat12FileSystem()); 
    59             ManagerLibrary.Instance.FileSystemManager.Add(new Fat16FileSystem()); 
    60             ManagerLibrary.Instance.FileSystemManager.Add(new Fat32FileSystem()); 
    61             ManagerLibrary.Instance.FileSystemManager.Add(new NtfsFileSystem()); 
     58            ManagerLibrary.Instance.FileSystemRegistrar.Add(new Fat12FileSystem()); 
     59            ManagerLibrary.Instance.FileSystemRegistrar.Add(new Fat16FileSystem()); 
     60            ManagerLibrary.Instance.FileSystemRegistrar.Add(new Fat32FileSystem()); 
     61            ManagerLibrary.Instance.FileSystemRegistrar.Add(new NtfsFileSystem()); 
    6262        } 
    6363 
  • branches/eraser6/CodeReview/Eraser.DefaultPlugins/SettingsForm.cs

    r1792 r1795  
    4242 
    4343            //Populate the list of erasure passes, except the FL16KB. 
    44             foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodManager) 
     44            foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 
    4545                if (method.Guid != new Guid("{0C2E07BF-0207-49a3-ADE8-46F9E1499C01}")) 
    4646                    fl16MethodCmb.Items.Add(method); 
     
    161161            { 
    162162                customMethods.Remove(guid); 
    163                 ManagerLibrary.Instance.ErasureMethodManager.Remove(guid); 
     163                ManagerLibrary.Instance.ErasureMethodRegistrar.Remove(guid); 
    164164            } 
    165165 
     
    168168            { 
    169169                customMethods.Add(method.Guid, method); 
    170                 ManagerLibrary.Instance.ErasureMethodManager.Add(new EraseCustom(method)); 
     170                ManagerLibrary.Instance.ErasureMethodRegistrar.Add(new EraseCustom(method)); 
    171171            } 
    172172 
  • branches/eraser6/CodeReview/Eraser.Manager/DirectExecutor.cs

    r1793 r1795  
    405405            DirectoryInfo info = new DirectoryInfo(target.Drive); 
    406406            VolumeInfo volInfo = VolumeInfo.FromMountPoint(target.Drive); 
    407             FileSystem fsManager = ManagerLibrary.Instance.FileSystemManager[volInfo]; 
     407            FileSystem fsManager = ManagerLibrary.Instance.FileSystemRegistrar[volInfo]; 
    408408 
    409409            //Start sampling the speed of the task. 
     
    506506                        //Then run the erase task 
    507507                        method.Erase(stream, long.MaxValue, 
    508                             ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng], 
     508                            ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng], 
    509509                            delegate(long lastWritten, long totalData, int currentPass) 
    510510                            { 
     
    625625 
    626626                //Get the filesystem provider to handle the secure file erasures 
    627                 FileSystem fsManager = ManagerLibrary.Instance.FileSystemManager[ 
     627                FileSystem fsManager = ManagerLibrary.Instance.FileSystemRegistrar[ 
    628628                    VolumeInfo.FromMountPoint(info.DirectoryName)]; 
    629629 
     
    729729                //Remove all subfolders which are empty. 
    730730                FolderTarget fldr = (FolderTarget)target; 
    731                 FileSystem fsManager = ManagerLibrary.Instance.FileSystemManager[VolumeInfo.FromMountPoint(fldr.Path)]; 
     731                FileSystem fsManager = ManagerLibrary.Instance.FileSystemRegistrar[VolumeInfo.FromMountPoint(fldr.Path)]; 
    732732                Action<DirectoryInfo> eraseEmptySubFolders = null; 
    733733                eraseEmptySubFolders = delegate(DirectoryInfo info) 
  • branches/eraser6/CodeReview/Eraser.Manager/EntropySource.cs

    r1792 r1795  
    402402                // Send entropy to the PRNGs for new seeds. 
    403403                if (DateTime.Now - lastAddedEntropy > managerEntropySpan) 
    404                     ManagerLibrary.Instance.PRNGManager.AddEntropy(GetPool()); 
     404                    ManagerLibrary.Instance.PrngRegistrar.AddEntropy(GetPool()); 
    405405            } 
    406406        } 
  • branches/eraser6/CodeReview/Eraser.Manager/FileSystem.cs

    r1793 r1795  
    4444        { 
    4545            //Get a random file name 
    46             Prng prng = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     46            Prng prng = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    4747            string resultPrefix = info == null ? string.Empty : info.FullName + 
    4848                Path.DirectorySeparatorChar; 
     
    8989 
    9090            //Find a random entry. 
    91             Prng prng = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     91            Prng prng = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    9292            string result = string.Empty; 
    9393            while (result.Length == 0) 
     
    115115                List<string> entries = new List<string>( 
    116116                    ManagerLibrary.Settings.PlausibleDeniabilityFiles); 
    117                 Prng prng = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     117                Prng prng = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    118118                do 
    119119                { 
  • branches/eraser6/CodeReview/Eraser.Manager/ManagerLibrary.cs

    r1793 r1795  
    4242            SettingsManager = settings; 
    4343 
    44             EntropySourceManager = new EntropySourceRegistrar(); 
    45             PRNGManager = new PrngRegistrar(); 
    46             ErasureMethodManager = new ErasureMethodRegistrar(); 
    47             FileSystemManager = new FileSystemRegistrar(); 
     44            EntropySourceRegistrar = new EntropySourceRegistrar(); 
     45            PrngRegistrar = new PrngRegistrar(); 
     46            ErasureMethodRegistrar = new ErasureMethodRegistrar(); 
     47            FileSystemRegistrar = new FileSystemRegistrar(); 
    4848            Host = new Plugin.DefaultHost(); 
    4949            Host.Load(); 
     
    6262            if (disposing) 
    6363            { 
    64                 EntropySourceManager.Poller.Abort(); 
     64                EntropySourceRegistrar.Poller.Abort(); 
    6565                Host.Dispose(); 
    6666                SettingsManager.Save(); 
     
    8585        /// The global instance of the EntropySource Manager 
    8686        /// </summary> 
    87         public EntropySourceRegistrar EntropySourceManager { get; private set; } 
     87        public EntropySourceRegistrar EntropySourceRegistrar { get; private set; } 
    8888 
    8989        /// <summary> 
    9090        /// The global instance of the PRNG Manager. 
    9191        /// </summary> 
    92         public PrngRegistrar PRNGManager { get; private set; } 
     92        public PrngRegistrar PrngRegistrar { get; private set; } 
    9393 
    9494        /// <summary> 
    9595        /// The global instance of the Erasure method manager. 
    9696        /// </summary> 
    97         public ErasureMethodRegistrar ErasureMethodManager { get; private set; } 
     97        public ErasureMethodRegistrar ErasureMethodRegistrar { get; private set; } 
    9898 
    9999        /// <summary> 
    100100        /// The global instance of the File System manager. 
    101101        /// </summary> 
    102         public FileSystemRegistrar FileSystemManager { get; private set; } 
     102        public FileSystemRegistrar FileSystemRegistrar { get; private set; } 
    103103 
    104104        /// <summary> 
  • branches/eraser6/CodeReview/Eraser.Manager/Method.cs

    r1793 r1795  
    127127 
    128128            //Randomize. 
    129             Prng rand = ManagerLibrary.Instance.PRNGManager[ManagerLibrary.Settings.ActivePrng]; 
     129            Prng rand = ManagerLibrary.Instance.PrngRegistrar[ManagerLibrary.Settings.ActivePrng]; 
    130130            for (int i = 0; i < result.Length; ++i) 
    131131            { 
  • branches/eraser6/CodeReview/Eraser.Manager/PRNG.cs

    r1793 r1795  
    151151        internal void AddEntropy(byte[] entropy) 
    152152        { 
    153             lock (ManagerLibrary.Instance.PRNGManager) 
    154                 foreach (Prng prng in ManagerLibrary.Instance.PRNGManager) 
     153            lock (ManagerLibrary.Instance.PrngRegistrar) 
     154                foreach (Prng prng in ManagerLibrary.Instance.PrngRegistrar) 
    155155                    prng.Reseed(entropy); 
    156156        } 
     
    162162        internal static byte[] GetEntropy() 
    163163        { 
    164             return ManagerLibrary.Instance.EntropySourceManager.Poller.GetPool(); 
     164            return ManagerLibrary.Instance.EntropySourceRegistrar.Poller.GetPool(); 
    165165        } 
    166166    } 
  • branches/eraser6/CodeReview/Eraser.Manager/Task.cs

    r1792 r1795  
    316316                method = ErasureMethodRegistrar.Default; 
    317317            else 
    318                 method = ManagerLibrary.Instance.ErasureMethodManager[methodGuid]; 
     318                method = ManagerLibrary.Instance.ErasureMethodRegistrar[methodGuid]; 
    319319        } 
    320320 
     
    496496                if (base.MethodDefined) 
    497497                    return base.Method; 
    498                 return ManagerLibrary.Instance.ErasureMethodManager[ 
     498                return ManagerLibrary.Instance.ErasureMethodRegistrar[ 
    499499                    ManagerLibrary.Settings.DefaultFileErasureMethod]; 
    500500            } 
     
    566566                if (base.MethodDefined) 
    567567                    return base.Method; 
    568                 return ManagerLibrary.Instance.ErasureMethodManager[ 
     568                return ManagerLibrary.Instance.ErasureMethodRegistrar[ 
    569569                    ManagerLibrary.Settings.DefaultUnusedSpaceErasureMethod]; 
    570570            } 
  • branches/eraser6/CodeReview/Eraser/Program.cs

    r1792 r1795  
    263263 
    264264            //Refresh the list of erasure methods 
    265             foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodManager) 
     265            foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 
    266266            { 
    267267                Console.WriteLine(methodFormat, (method is UnusedSpaceErasureMethod) ? 
     
    283283            ErasureMethod method = arguments.ErasureMethod == Guid.Empty ? 
    284284                ErasureMethodRegistrar.Default : 
    285                 ManagerLibrary.Instance.ErasureMethodManager[arguments.ErasureMethod]; 
     285                ManagerLibrary.Instance.ErasureMethodRegistrar[arguments.ErasureMethod]; 
    286286            switch (arguments.Schedule.ToUpperInvariant()) 
    287287            { 
  • branches/eraser6/CodeReview/Eraser/SettingsPanel.cs

    r1794 r1795  
    4646            //For new plugins, register the callback. 
    4747            Host.Instance.PluginLoaded += OnNewPluginLoaded; 
    48             ManagerLibrary.Instance.ErasureMethodManager.Registered += OnMethodRegistered; 
    49             ManagerLibrary.Instance.ErasureMethodManager.Unregistered += OnMethodUnregistered; 
     48            ManagerLibrary.Instance.ErasureMethodRegistrar.Registered += OnMethodRegistered; 
     49            ManagerLibrary.Instance.ErasureMethodRegistrar.Unregistered += OnMethodUnregistered; 
    5050 
    5151            //Load the values 
     
    130130 
    131131            //Refresh the list of erasure methods 
    132             foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodManager) 
     132            foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 
    133133            { 
    134134                eraseFilesMethod.Items.Add(method); 
     
    138138 
    139139            //Refresh the list of PRNGs 
    140             foreach (Prng prng in ManagerLibrary.Instance.PRNGManager) 
     140            foreach (Prng prng in ManagerLibrary.Instance.PrngRegistrar) 
    141141                erasePRNG.Items.Add(prng); 
    142142        } 
  • branches/eraser6/CodeReview/Eraser/TaskDataSelectionForm.cs

    r1792 r1795  
    8585            //And the methods list 
    8686            this.method.Items.Add(ErasureMethodRegistrar.Default); 
    87             foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodManager) 
     87            foreach (ErasureMethod method in ManagerLibrary.Instance.ErasureMethodRegistrar) 
    8888                this.method.Items.Add(method); 
    8989            if (this.method.Items.Count != 0) 
Note: See TracChangeset for help on using the changeset viewer.