Example #1
0
        public AzureAtomicReader(IAzureStorageConfig storage, IAtomicStorageStrategy strategy)
        {
            _strategy = strategy;
            var folder = strategy.GetFolderForEntity(typeof(TEntity), typeof(TKey));

            _container = storage.CreateBlobClient().GetContainerReference(folder);
        }
        public AzureAtomicEntityWriter(IAzureStorageConfig storage, IAtomicStorageStrategy strategy)
        {
            _strategy = strategy;
            var containerName = strategy.GetFolderForEntity(typeof(TEntity));

            _container = storage.CreateBlobClient().GetContainerReference(containerName);
        }
        /// <summary>
        /// Creates the simplified nuclear storage wrapper around Atomic storage.
        /// </summary>
        /// <param name="dictionary">The dictionary.</param>
        /// <param name="strategy">The atomic storage strategy.</param>
        /// <returns></returns>
        public static NuclearStorage CreateNuclear(MemStore dictionary, IAtomicStorageStrategy strategy)
        {
            var factory = new MemoryAtomicStorageFactory(dictionary, strategy);

            factory.Initialize();
            return(new NuclearStorage(factory));
        }
Example #4
0
        /// <summary> Creates the simplified nuclear storage wrapper around Atomic storage. </summary>
        /// <param name="storageConfig">The storage config.</param>
        /// <param name="strategy">The atomic storage strategy.</param>
        /// <returns></returns>
        public static NuclearStorage CreateNuclear(this IAzureStorageConfig storageConfig,
                                                   IAtomicStorageStrategy strategy)
        {
            var factory = new AzureAtomicStorageFactory(strategy, storageConfig);

            return(new NuclearStorage(factory));
        }
Example #5
0
        /// <summary>
        /// Creates the simplified nuclear storage wrapper around Atomic storage.
        /// </summary>
        /// <param name="storageFolder">The storage folder.</param>
        /// <param name="strategy">The atomic storage strategy.</param>
        /// <returns></returns>
        public static NuclearStorage CreateNuclear(string storageFolder, IAtomicStorageStrategy strategy)
        {
            var factory = new FileAtomicStorageFactory(storageFolder, strategy);

            factory.Initialize();
            return(new NuclearStorage(factory));
        }
Example #6
0
 public FileAtomicStorageFactory(string folderPath, IAtomicStorageStrategy strategy)
 {
     _folderPath = folderPath;
     _strategy   = strategy;
 }
 public FileAtomicSingletonContainer(string directoryPath, IAtomicStorageStrategy strategy)
 {
     _strategy = strategy;
     _filePath = Path.Combine(directoryPath, strategy.GetFolderForSingleton(),
                              strategy.GetNameForSingleton(typeof(TEntity)));
 }
 protected abstract NuclearStorage Compose(IAtomicStorageStrategy strategy);
Example #9
0
 public MemoryAtomicStorageFactory(ConcurrentDictionary <string, byte[]> store, IAtomicStorageStrategy strategy)
 {
     _store    = store;
     _strategy = strategy;
 }
Example #10
0
 /// <summary>
 /// Creates the simplified nuclear storage wrapper around Atomic storage.
 /// </summary>
 /// <param name="dictionary">The dictionary.</param>
 /// <param name="strategy">The atomic storage strategy.</param>
 /// <returns></returns>
 public static NuclearStorage CreateNuclear(this MemoryAccount dictionary, IAtomicStorageStrategy strategy)
 {
     var factory = new MemoryAtomicStorageFactory(dictionary.Data, strategy);
     factory.Initialize();
     return new NuclearStorage(factory);
 }
 public MemoryAtomicStorageModule(IAtomicStorageStrategy strategy)
 {
     _strategy = strategy;
 }
 protected override NuclearStorage Compose(IAtomicStorageStrategy strategy)
 {
     var dev = AzureStorage.CreateConfigurationForDev();
     WipeAzureAccount.Fast(s => s.StartsWith("test-views"), dev);
     return dev.CreateNuclear(strategy, "test-views");
 }
 public MemoryAtomicSingletonContainer(ConcurrentDictionary <string, byte[]> store, IAtomicStorageStrategy strategy)
 {
     _store    = store;
     _strategy = strategy;
     _key      = _strategy.GetFolderForSingleton() + ":" + _strategy.GetNameForSingleton(typeof(TEntity));
 }
Example #14
0
 public static NuclearStorage CreateNuclear(this FileStorageConfig config, IAtomicStorageStrategy strategy, string subfolder)
 {
     return CreateNuclear(config.SubFolder(subfolder), strategy);
 }
Example #15
0
 public static NuclearStorage CreateNuclear(this FileStorageConfig config, IAtomicStorageStrategy strategy)
 {
     var factory = new FileAtomicContainer(config.FullPath, strategy);
     return new NuclearStorage(factory);
 }
Example #16
0
 /// <summary>
 /// Creates the simplified nuclear storage wrapper around Atomic storage.
 /// </summary>
 /// <param name="storageFolder">The storage folder.</param>
 /// <param name="strategy">The atomic storage strategy.</param>
 /// <returns></returns>
 public static NuclearStorage CreateNuclear(string storageFolder, IAtomicStorageStrategy strategy)
 {
     var factory = new FileAtomicStorageFactory(storageFolder, strategy);
     factory.Initialize();
     return new NuclearStorage(factory);
 }
Example #17
0
 public static void AtomicIsInSql(this StorageModule self, ISqlStorageConfig config, IAtomicStorageStrategy strategy)
 {
     self.AtomicIs(new SqlAtomicStorageFactory(config, strategy));
 }
 protected override NuclearStorage Compose(IAtomicStorageStrategy strategy)
 {
     return new MemoryStorageConfig().CreateNuclear(strategy);
 }
 public static void AtomicIsInAzure(this StorageModule self, IAzureStorageConfig storage, IAtomicStorageStrategy strategy)
 {
     self.AtomicIs(new AzureAtomicStorageFactory(strategy, storage));
 }
Example #20
0
 /// <summary> Creates the simplified nuclear storage wrapper around Atomic storage. </summary>
 /// <param name="storageConfig">The storage config.</param>
 /// <param name="strategy">The atomic storage strategy.</param>
 /// <returns></returns>
 public static NuclearStorage CreateNuclear(IAzureStorageConfig storageConfig, IAtomicStorageStrategy strategy)
 {
     var factory = new AzureAtomicStorageFactory(strategy, storageConfig);
     factory.Initialize();
     return new NuclearStorage(factory);
 }
 public AzureAtomicStorageFactory(IAtomicStorageStrategy strategy, IAzureStorageConfig storage)
 {
     _strategy = strategy;
     _storage  = storage;
 }
Example #22
0
 public AzureAtomicSingletonReader(IAzureStorageConfig storage, IAtomicStorageStrategy strategy)
 {
     _storage  = storage;
     _strategy = strategy;
 }
Example #23
0
 public MemoryAtomicContainer(ConcurrentDictionary <string, byte[]> store, IAtomicStorageStrategy strategy)
 {
     _store        = store;
     _strategy     = strategy;
     _entityPrefix = _strategy.GetFolderForEntity(typeof(TEntity), typeof(TKey)) + ":";
 }
Example #24
0
        public static NuclearStorage CreateNuclear(this FileStorageConfig config, IAtomicStorageStrategy strategy)
        {
            var factory = new FileAtomicStorageFactory(config.FullPath, strategy);

            return(new NuclearStorage(factory));
        }
 protected override NuclearStorage Compose(IAtomicStorageStrategy strategy)
 {
     return _config.CreateNuclear(strategy);
 }
Example #26
0
 public FileAtomicEntityContainer(string directoryPath, IAtomicStorageStrategy strategy)
 {
     _strategy   = strategy;
     _folderPath = Path.Combine(directoryPath, _strategy.GetFolderForEntity(typeof(TEntity)));
 }
Example #27
0
 public static void AtomicIsInAzure(this StorageModule self, IAzureStorageConfig storage, IAtomicStorageStrategy strategy)
 {
     self.AtomicIs(new AzureAtomicStorageFactory(strategy, storage));
 }