public LockFileCleaner( IClock clock, IStorageProvider storageProvider) { _clock = clock; _storageProvider = storageProvider; }
public ImportController(IAppConfigProvider a, IInputConfigProvider i, IScriptProvider s, IStorageProvider t) { appConfigProvider = a; inputConfigProvider = i; scriptProvider = s; storageProvider = t; }
public override bool OnStart() { // Set the maximum number of concurrent connections ServicePointManager.DefaultConnectionLimit = 12; // read storage account configuration settings CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) => { configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)); }); var _azure = new AzureRealm(); // initialize blob storage _storage = _azure.StorageProvider; _storage.CreateBucket("guestbookpics1"); // initialize queue storage _queueProvider = _azure.QueueProvider; _queueProvider.CreateQueue("guestthumbs"); _queue = _queueProvider.GetQueueById("guestthumbs"); Trace.TraceInformation("Creating container and queue..."); return base.OnStart(); }
public PdfOutputController(IHtmlGenerator htmlGenerator, IPdfGenerator pdfGenerator, IStorageProvider storageProvider, IFilenameGenerator filenameGenerator) { this.htmlGenerator = htmlGenerator; this.pdfGenerator = pdfGenerator; this.storageProvider = storageProvider; this.filenameGenerator = filenameGenerator; }
public ImportController() { inputConfigProvider = ObjectFactory.GetProvider<IInputConfigProvider>(); scriptProvider = ObjectFactory.GetProvider<IScriptProvider>(); appConfigProvider = ObjectFactory.GetProvider<IAppConfigProvider>(); storageProvider = ObjectFactory.GetProvider<IStorageProvider>(); }
public ThumbnailsService(ShellSettings settings, IWorkContextAccessor wca, ICacheManager cacheManager, IMediaService mediaService, ISignals signals, IStorageProvider storageProvider) { _wca = wca; _cacheManager = cacheManager; _mediaService = mediaService; _signals = signals; _storageProvider = storageProvider; var appPath = ""; if (HostingEnvironment.IsHosted) { appPath = HostingEnvironment.ApplicationVirtualPath; } if (!appPath.EndsWith("/")) appPath = appPath + '/'; if (!appPath.StartsWith("/")) appPath = '/' + appPath; _publicPath = appPath + "Media/" + settings.Name + "/"; var physPath = ThumbnailsCacheMediaPath.Replace('/', Path.DirectorySeparatorChar); var parent = Path.GetDirectoryName(physPath); var folder = Path.GetFileName(physPath); if (_mediaService.GetMediaFolders(parent).All(f => f.Name != folder)) { _mediaService.CreateFolder(parent, folder); } }
protected virtual void InitialiseStorageProvider() { if (storageProvider == null) { storageProvider = GetStorageFactory().Get(); } }
public ImageDisOptions( IStorageProvider storageProvider, IImageTransformProvider imageTransformProvider, string path = null, ImageType[] allowedImageTypes = null, IKeyGenerator keyGenerator = null) { if (storageProvider == null) throw new ArgumentNullException("storageProvider"); StorageProvider = storageProvider; if (imageTransformProvider == null) throw new ArgumentNullException("imageTransformProvider"); ImageTransformProvider = imageTransformProvider; Path = string.IsNullOrWhiteSpace(path) ? "/imagedis" : path; AllowedImageTypes = allowedImageTypes == null || !allowedImageTypes.Any() ? new[] { ImageTypes.Jpeg, ImageTypes.Png } : allowedImageTypes; KeyGenerator = keyGenerator ?? new RandomKeyGenerator(); }
/// <summary> /// Initializes a new instance of the MediaService class with a given IStorageProvider and IOrchardServices. /// </summary> /// <param name="storageProvider">The storage provider.</param> /// <param name="orchardServices">The orchard services provider.</param> public MediaService(IStorageProvider storageProvider, IOrchardServices orchardServices) { _storageProvider = storageProvider; _orchardServices = orchardServices; T = NullLocalizer.Instance; }
public virtual void InitFixture() { PhotoServer.App_Start.InitializeMapper.MapClasses(); provider = new AzureStorageProvider(@"UseDevelopmentStorage=true", "images"); ObjectMother.ClearDirectory(provider); ObjectMother.CopyTestFiles(provider); }
public GameViewModel(int totalQuestions, IImageProvider imageProvider, IStorageProvider storageProvider) { _imageProvider = imageProvider; _storageProvider = storageProvider; // register all the events CommandEvents.ContinueButtonPressed += new EventHandler(ContinueButtonPressed); CommandEvents.AnswerButtonPressed += new EventHandler(AnswerButtonPressed); CommandEvents.HighScoreContinueButtonPressed += new EventHandler(HighScoreContinueButtonPressed); DisplayHighScore += new EventHandler(DisplayScore); // check to see whether any game state is already loaded if (_storageProvider.GameStateExists()) { _game = _storageProvider.LoadGameState(); // check if the player was in the middle of a question if (_game.CurrentQuestion.Answered) { DisplayQuestion(); ContinueButtonPressed(this, new EventArgs()); } else { DisplayQuestion(); } } else { _game = new Game(totalQuestions); ContinueButtonPressed(this, new EventArgs()); } }
public RecipeJournalManager(IStorageProvider storageProvider) { _storageProvider = storageProvider; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public void Setup() { var request = new HttpRequest("", "http://tempuri.org", ""); var response = new HttpResponse(new StringWriter()); httpContext = new HttpContext(request, response); storageProvider = new HttpContextStorageProvider(httpContext); }
/// <summary> /// Initializes a new instance of the <see cref="ScanManager"/> class. /// </summary> /// <param name="storageProvider"> /// The storage provider to use. /// </param> /// <param name="dataProvider"> /// The data provider to use. /// </param> internal ScanManager(IStorageProvider storageProvider, IDataProvider dataProvider) { this.storageProvider = storageProvider; this.dataProvider = dataProvider; this.settings = Settings.LoadSettings(storageProvider); this.tvShows = TvShow.GetTvShows(storageProvider).ToList(); }
public MainViewModel(IStorageProvider storageProvider) { _storageProvider = storageProvider; _storageProvider.DeleteGameState(); UpdateGameButtonVisibility(this,null); }
/// <summary> /// Loads the provider into the system. /// </summary> /// <param name="provider">The provider to add to the list.</param> public async Task LoadAsync(IStorageProvider provider) { if (provider == null) throw new NullReferenceException(ExceptionMessage.IsNullOrInvalid("provider")); await provider.LoadInfoAsync(); _providers.Add(provider); }
public void Setup() { scriptProviderMock = new Mock<IScriptProvider>(); scriptProvider = scriptProviderMock.Object; storageProviderMock = new Mock<IStorageProvider>(); storageProvider = storageProviderMock.Object; }
public PrettyGalleryService(IMediaService mediaService, IStorageProvider storageProvider, IOrchardServices orchardServices) { _mediaService = mediaService; _storageProvider = storageProvider; _orchardServices = orchardServices; T = NullLocalizer.Instance; }
public LocalBlobClient(IStorageProvider storageProvider, IPathCreator pathCreator) { if (storageProvider == null) throw new ArgumentNullException("storageProvider"); if (pathCreator == null) throw new ArgumentNullException("pathCreator"); _storageProvider = storageProvider; _pathCreator = pathCreator; }
public Label(IDateProvider dateProvider, IIdentityProvider identitiyProvider, IStorageProvider storageProvider) { DateProvider = dateProvider; IdentityProvider = identitiyProvider; StorageProvider = storageProvider; }
public KeeAnywhereWebRequest(IStorageProvider provider, string itemPath) { if (provider == null) throw new ArgumentNullException("provider"); if (itemPath == null) throw new ArgumentNullException("itemPath"); _provider = provider; _itemPath = itemPath; }
internal static void OnStorageActivate(IStorageProvider storage, string grainType, GrainReference grain, TimeSpan latency) { StorageActivateTotal.Increment(); if (latency > TimeSpan.Zero) { StorageReadLatency.AddSample(latency); } }
private void Init(string connectionString, CloudProvider provider) { var catalog = new DirectoryCatalog("."); var container = new CompositionContainer(catalog); container.ComposeExportedValue<string>(connectionString); _provider = container.GetExportedValue<IStorageProvider>(provider.ToString()); }
/// <summary> /// Updates the collection of TVShows. /// </summary> /// <param name="shows"> /// The collection of shows to update. /// </param> /// <param name="storageProvider"> /// The storage provider to use /// </param> /// <param name="dataProvider"> /// The data provider to use. /// </param> internal static void Update( this IList<TvShow> shows, IStorageProvider storageProvider, IDataProvider dataProvider) { foreach (var show in dataProvider.UpdateShows(shows, storageProvider)) { show.LockIfNoEpisodes(storageProvider); show.Save(storageProvider); } }
public LockFileCleaner( IScheduledTaskManager scheduledTaskManager, IClock clock, IStorageProvider storageProvider) { _scheduledTaskManager = scheduledTaskManager; _clock = clock; _storageProvider = storageProvider; }
public IEditingService GetViewingService(string rootStoragePath, IStorageProvider customStorageProvider, string workingDirectoryPath, IStorageProvider customWorkingStorageProvider) { IFileStorage adapter = new FileStorageAdapter(customStorageProvider); IFileStorage tempStorageAdapter = new FileStorageAdapter(customWorkingStorageProvider); IEditingService viewingService = new EditingService(rootStoragePath, adapter, workingDirectoryPath, tempStorageAdapter); return viewingService; }
public IStorageProvider Get() { if (_storageProvider == null) { var type = Type.GetType(_glimpsePerformanceConfiguration.StorageProviderFullyQualifiedName); _storageProvider = (IStorageProvider)Activator.CreateInstance(type.Assembly.FullName, type.FullName).Unwrap(); } return _storageProvider; }
/// <summary> /// Specifies custom storage providers used by Viewer to access files. /// </summary> /// <param name="storageProvider">An implementation of the IFileStorage interface used to access documents.</param> /// <param name="tempStorageProvider">An implementation of the IFileStorage interface used to access Viewer temporary files (page representations, document descriptions).</param> public static void SetStorageProvider(IStorageProvider storageProvider, IStorageProvider tempStorageProvider) { HttpContext context = HttpContext.Current; if (context != null) { HttpApplicationState application = context.Application; application[Constants.CustomStorageProvider] = storageProvider; application[Constants.CustomTempStorageProvider] = tempStorageProvider; } }
public Card(IDateProvider dateProvider, IStorageProvider storageProvider, IIdentityProvider identityProvider, IConfigurationProvider configurationProvider) { DateProvider = dateProvider; StorageProvider = storageProvider; IdentityProvider = identityProvider; ConfigurationProvider = configurationProvider; }
/// <summary> /// Injecting the default orchard media service and storage provider for file handling /// </summary> /// <param name="services"></param> /// <param name="orchardMediaService"></param> public FileSystemQueryFilter( IOrchardServices services, IMediaService orchardMediaService, IStorageProvider storageProvider) { _services = services; // Poss don't need to use this; it's only a thin wrapper around IStorageProvider anyway _orchardMediaService = orchardMediaService; _storageProvider = storageProvider; }
public KatVirtualMachine(IStateProvider stateProvider, IStorageProvider storageProvider, IStateUpdateHashProvider blockhashProvider, ISpecProvider specProvider, ILogManager logManager) : base(stateProvider, storageProvider, blockhashProvider, specProvider, logManager) { }
public BlogProvider(AppDbContext db, IStorageProvider storageProvider) { _db = db; _storageProvider = storageProvider; }
public StructureExporter(IDataProvider dataProvider, IStorageProvider temStorageProvider, ExportContext context) { dataProvider_ = dataProvider; tempStorageProvider_ = temStorageProvider; context_ = context; }
private List <string> RunAssertions(LegacyBlockchainTest test, Block headBlock, IStorageProvider storageProvider, IStateProvider stateProvider) { if (test.PostStateRoot != null) { return(test.PostStateRoot != stateProvider.StateRoot ? new List <string> { "state root mismatch" } : Enumerable.Empty <string>().ToList()); } TestBlockHeaderJson testHeaderJson = test.Blocks .Where(b => b.BlockHeader != null) .SingleOrDefault(b => new Keccak(b.BlockHeader.Hash) == headBlock.Hash)?.BlockHeader ?? test.GenesisBlockHeader; BlockHeader testHeader = JsonToBlockchainTest.Convert(testHeaderJson); List <string> differences = new List <string>(); var deletedAccounts = test.Pre.Where(pre => !test.PostState.ContainsKey(pre.Key)); foreach (KeyValuePair <Address, AccountState> deletedAccount in deletedAccounts) { if (stateProvider.AccountExists(deletedAccount.Key)) { differences.Add($"Pre state account {deletedAccount.Key} was not deleted as expected."); } } foreach (KeyValuePair <Address, AccountState> accountState in test.PostState) { int differencesBefore = differences.Count; if (differences.Count > 8) { Console.WriteLine("More than 8 differences..."); break; } bool accountExists = stateProvider.AccountExists(accountState.Key); BigInteger?balance = accountExists ? stateProvider.GetBalance(accountState.Key) : (BigInteger?)null; BigInteger?nonce = accountExists ? stateProvider.GetNonce(accountState.Key) : (BigInteger?)null; if (accountState.Value.Balance != balance) { differences.Add($"{accountState.Key} balance exp: {accountState.Value.Balance}, actual: {balance}, diff: {balance - accountState.Value.Balance}"); } if (accountState.Value.Nonce != nonce) { differences.Add($"{accountState.Key} nonce exp: {accountState.Value.Nonce}, actual: {nonce}"); } byte[] code = accountExists ? stateProvider.GetCode(accountState.Key) : new byte[0]; if (!Bytes.AreEqual(accountState.Value.Code, code)) { differences.Add($"{accountState.Key} code exp: {accountState.Value.Code?.Length}, actual: {code?.Length}"); } if (differences.Count != differencesBefore) { _logger.Info($"ACCOUNT STATE ({accountState.Key}) HAS DIFFERENCES"); } differencesBefore = differences.Count; KeyValuePair <UInt256, byte[]>[] clearedStorages = new KeyValuePair <UInt256, byte[]> [0]; if (test.Pre.ContainsKey(accountState.Key)) { clearedStorages = test.Pre[accountState.Key].Storage.Where(s => !accountState.Value.Storage.ContainsKey(s.Key)).ToArray(); } foreach (KeyValuePair <UInt256, byte[]> clearedStorage in clearedStorages) { byte[] value = !stateProvider.AccountExists(accountState.Key) ? Bytes.Empty : storageProvider.Get(new StorageCell(accountState.Key, clearedStorage.Key)); if (!value.IsZero()) { differences.Add($"{accountState.Key} storage[{clearedStorage.Key}] exp: 0x00, actual: {value.ToHexString(true)}"); } } foreach (KeyValuePair <UInt256, byte[]> storageItem in accountState.Value.Storage) { byte[] value = !stateProvider.AccountExists(accountState.Key) ? Bytes.Empty : storageProvider.Get(new StorageCell(accountState.Key, storageItem.Key)) ?? new byte[0]; if (!Bytes.AreEqual(storageItem.Value, value)) { differences.Add($"{accountState.Key} storage[{storageItem.Key}] exp: {storageItem.Value.ToHexString(true)}, actual: {value.ToHexString(true)}"); } } if (differences.Count != differencesBefore) { _logger.Info($"ACCOUNT STORAGE ({accountState.Key}) HAS DIFFERENCES"); } } BigInteger gasUsed = headBlock.Header.GasUsed; if ((testHeader?.GasUsed ?? 0) != gasUsed) { differences.Add($"GAS USED exp: {testHeader?.GasUsed ?? 0}, actual: {gasUsed}"); } if (headBlock.Transactions.Any() && testHeader.Bloom.ToString() != headBlock.Header.Bloom.ToString()) { differences.Add($"BLOOM exp: {testHeader.Bloom}, actual: {headBlock.Header.Bloom}"); } if (testHeader.StateRoot != stateProvider.StateRoot) { differences.Add($"STATE ROOT exp: {testHeader.StateRoot}, actual: {stateProvider.StateRoot}"); } if (testHeader.TxRoot != headBlock.Header.TxRoot) { differences.Add($"TRANSACTIONS ROOT exp: {testHeader.TxRoot}, actual: {headBlock.Header.TxRoot}"); } if (testHeader.ReceiptsRoot != headBlock.Header.ReceiptsRoot) { differences.Add($"RECEIPT ROOT exp: {testHeader.ReceiptsRoot}, actual: {headBlock.Header.ReceiptsRoot}"); } if (test.LastBlockHash != headBlock.Hash) { differences.Add($"LAST BLOCK HASH exp: {test.LastBlockHash}, actual: {headBlock.Hash}"); } foreach (string difference in differences) { _logger.Info(difference); } return(differences); }
/// <summary> /// Saves a collection of TVShows. /// </summary> /// <param name="shows"> /// The shows to save. /// </param> /// <param name="provider"> /// The provider to save the shows with. /// </param> internal static void Save(this IEnumerable <TvShow> shows, IStorageProvider provider) { provider.SaveShows(shows); }
/// <summary> /// Creates a new Import URI Task /// </summary> /// <param name="manager">Storage Provider</param> /// <param name="u">URI to import from</param> /// <param name="targetUri">Target Graph URI</param> /// <param name="batchSize">Import Batch Size</param> public ImportUriTask(IStorageProvider manager, Uri u, Uri targetUri, int batchSize) : base("Import URI", manager, targetUri, batchSize) { this._u = u; }
/// <summary> /// Initializes a new instance of the <see cref="UpdaterService" /> class. /// </summary> /// <param name="unpacker">The unpacker.</param> /// <param name="preferencesService">The preferences service.</param> /// <param name="storageProvider">The storage provider.</param> /// <param name="mapper">The mapper.</param> public UpdaterService(IUnpacker unpacker, IPreferencesService preferencesService, IStorageProvider storageProvider, IMapper mapper) : base(storageProvider, mapper) { this.preferencesService = preferencesService; this.unpacker = unpacker; }
/// <summary> /// /// </summary> public StorageUnitTest() : base() { _storageProvider = provider.GetService <IStorageProvider>(); }
/// <summary> /// Creates a new Read-Only connection which is a read-only wrapper around another store. /// </summary> /// <param name="manager">Manager for the Store you want to wrap as read-only.</param> public ReadOnlyConnector(IStorageProvider manager) { _manager = manager; }
private static IEnumerable <Uri> ListGraphs(IStorageProvider storage) { return(storage.ListGraphs()); }
private static void LoadGraph(IStorageProvider storage, IGraph g, Uri graphUri) { storage.LoadGraph(g, graphUri); }
private static void DeleteGraph(IStorageProvider storage, Uri graphUri) { storage.DeleteGraph(graphUri); }
private static void UpdateGraph(IStorageProvider storage, Uri graphUri, IEnumerable <Triple> additions, IEnumerable <Triple> removals) { storage.UpdateGraph(graphUri, additions, removals); }
private static void SaveGraph(IStorageProvider storage, IGraph g) { storage.SaveGraph(g); }
private async Task <GrainState <TestStoreGrainState> > Test_PersistenceProvider_WriteClearRead(string grainTypeName, IStorageProvider store, GrainState <TestStoreGrainState> grainState = null, GrainId grainId = null) { GrainReference reference = this.fixture.InternalGrainFactory.GetGrain(grainId ?? GrainId.NewId()); if (grainState == null) { grainState = TestStoreGrainState.NewRandomState(); } Stopwatch sw = new Stopwatch(); sw.Start(); await store.WriteStateAsync(grainTypeName, reference, grainState); TimeSpan writeTime = sw.Elapsed; sw.Restart(); await store.ClearStateAsync(grainTypeName, reference, grainState); var storedGrainState = new GrainState <TestStoreGrainState> { State = new TestStoreGrainState() }; await store.ReadStateAsync(grainTypeName, reference, storedGrainState); TimeSpan readTime = sw.Elapsed; output.WriteLine("{0} - Write time = {1} Read time = {2}", store.GetType().FullName, writeTime, readTime); Assert.NotNull(storedGrainState.State); Assert.Equal(default(string), storedGrainState.State.A); Assert.Equal(default(int), storedGrainState.State.B); Assert.Equal(default(long), storedGrainState.State.C); return(storedGrainState); }
public MediaService(IStorageProvider storageProvider, IMediaRepository mediaRepo) { _storageProvider = storageProvider; _mediaRepo = mediaRepo; }
public void CanStoreInMemory() { storage_ = new InMemoryStorageProvider(); CanReadAndWriteTestDoc(storage_, NewTestXDocument()); }
private void InitializeTestState(LegacyBlockchainTest test, IStateProvider stateProvider, IStorageProvider storageProvider, ISpecProvider specProvider) { foreach (KeyValuePair <Address, AccountState> accountState in test.Pre) { foreach (KeyValuePair <UInt256, byte[]> storageItem in accountState.Value.Storage) { storageProvider.Set(new StorageCell(accountState.Key, storageItem.Key), storageItem.Value); } stateProvider.CreateAccount(accountState.Key, accountState.Value.Balance); Keccak codeHash = stateProvider.UpdateCode(accountState.Value.Code); stateProvider.UpdateCodeHash(accountState.Key, codeHash, specProvider.GenesisSpec); for (int i = 0; i < accountState.Value.Nonce; i++) { stateProvider.IncrementNonce(accountState.Key); } } storageProvider.Commit(); stateProvider.Commit(specProvider.GenesisSpec); storageProvider.CommitTrees(); stateProvider.CommitTree(); storageProvider.Reset(); stateProvider.Reset(); }
/// <summary> /// Creates a new Import File task /// </summary> /// <param name="manager">Storage Provider</param> /// <param name="file">File to import from</param> /// <param name="targetUri">Target Graph URI</param> /// <param name="batchSize">Import Batch Size</param> public ImportFileTask(IStorageProvider manager, String file, Uri targetUri, int batchSize) : base("Import File", manager, targetUri, batchSize) { this._file = file; }
public ModuleController(ModuleContext moduleContext, IStorageProvider storageProvider) : base(moduleContext, storageProvider) => ((ModuleContext)_itemContext).Database.EnsureCreated();
public ApplicationFacade() { StorageProvider = new XmlFileStorageProvider(); }
public PictureProvider(ILogger <PictureProvider> logger, ALiYunStorageConfig aLiYunStorageConfig) : base( aLiYunStorageConfig) { this._logger = logger; _storageProvider = new StorageProvider(aLiYunStorageConfig, logger); }
public FileFieldDriver(IStorageProvider storageProvider) { _storageProvider = storageProvider; T = NullLocalizer.Instance; }
public void CanStoreInFileSystem() { storage_ = new FileSystemStorageProvider(); CanReadAndWriteTestDoc(storage_, NewTestXDocument()); }
private static void LoadGraph(IStorageProvider storage, IRdfHandler handler, Uri graphUri) { storage.LoadGraph(handler, graphUri); }
/// <summary> /// Creates a new Generic Protocol Processor /// </summary> /// <param name="manager">Generic IO Manager</param> public GenericProtocolProcessor(IStorageProvider manager) { _manager = manager; }
private IStorageProvider InitStorageProvider() { return(_storageProvider = InsideRuntimeClient.Current.Catalog.SetupStorageProvider(typeof(IndexWorkflowQueueSystemTarget))); }
public UserManager(IDomainHub domainHub, IStorageProvider storageProvider) { DomainHub = domainHub; UserTable = storageProvider.GetTable <DataAccess.Model.Storage.User>(); }
public EntriesRepository(IStorageProvider <SQLStorage> storageProvider) { _storageProvider = storageProvider; }
public BlobTestBase(StorageFixture fixture) { BasePath = StorageFixture.BasePath; _provider = new LocalStorageProvider(StorageFixture.BasePath); }