public LocalRdcManager(ISignatureRepository signatureRepository, TransactionalStorage transactionalStorage, SigGenerator sigGenerator) { _signatureRepository = signatureRepository; _transactionalStorage = transactionalStorage; _sigGenerator = sigGenerator; }
public StorageSignatureRepository(TransactionalStorage storage, string fileName) { _tempDirectory = TempDirectoryTools.Create(); _storage = storage; _fileName = fileName; _createdFiles = new Dictionary<string, FileStream>(); }
protected StorageStream(TransactionalStorage transactionalStorage, string fileName, StorageStreamAccess storageStreamAccess, NameValueCollection metadata, IndexStorage indexStorage, StorageOperationsTask operations) { TransactionalStorage = transactionalStorage; StorageStreamAccess = storageStreamAccess; Name = fileName; switch (storageStreamAccess) { case StorageStreamAccess.Read: TransactionalStorage.Batch(accessor => fileHeader = accessor.ReadFile(fileName)); if (fileHeader.TotalSize == null) { throw new FileNotFoundException("File is not uploaded yet"); } Metadata = fileHeader.Metadata; Seek(0, SeekOrigin.Begin); break; case StorageStreamAccess.CreateAndWrite: TransactionalStorage.Batch(accessor => { operations.IndicateFileToDelete(fileName); accessor.PutFile(fileName, null, metadata); indexStorage.Index(fileName, metadata); }); Metadata = metadata; break; default: throw new ArgumentOutOfRangeException("storageStreamAccess", storageStreamAccess, "Unknown value"); } }
public StorageOperationsTask(TransactionalStorage storage, IndexStorage search, INotificationPublisher notificationPublisher) { this.storage = storage; this.search = search; this.notificationPublisher = notificationPublisher; InitializeTimer(); }
public SynchronizationTask(TransactionalStorage storage, SigGenerator sigGenerator, NotificationPublisher publisher, InMemoryConfiguration systemConfiguration) { this.storage = storage; this.publisher = publisher; this.systemConfiguration = systemConfiguration; synchronizationQueue = new SynchronizationQueue(); synchronizationStrategy = new SynchronizationStrategy(storage, sigGenerator); InitializeTimer(); }
protected SynchronizationWorkItem(string fileName, string sourceServerUrl, TransactionalStorage storage) { Storage = storage; FileName = fileName; FileAndPages fileAndPages = null; Storage.Batch(accessor => fileAndPages = accessor.GetFile(fileName, 0, 0)); FileMetadata = fileAndPages.Metadata; ServerInfo = new ServerInfo { Id = Storage.Id, Url = sourceServerUrl }; conflictDetector = new ConflictDetector(); conflictResolver = new ConflictResolver(); }
public ContentUpdateWorkItem(string file, string sourceServerUrl, TransactionalStorage storage, SigGenerator sigGenerator) : base(file, sourceServerUrl, storage) { this.sigGenerator = sigGenerator; }
public StorageTest() { IOExtensions.DeleteDirectory("test"); transactionalStorage = new TransactionalStorage("test", new NameValueCollection()); transactionalStorage.Initialize(); }
public ConflictArtifactManager(TransactionalStorage storage, IndexStorage index) { this.storage = storage; this.index = index; }
public SequenceActions(TransactionalStorage storage) { this.storage = storage; }
public static StorageStream Reading(TransactionalStorage transactionalStorage, string fileName) { return new StorageStream(transactionalStorage, fileName, StorageStreamAccess.Read, null, null, null); }
public RenameWorkItem(string name, string rename, string sourceServerUrl, TransactionalStorage storage) : base(name, sourceServerUrl, storage) { this.rename = rename; }
public SynchronizationStrategy(TransactionalStorage storage, SigGenerator sigGenerator) { this.storage = storage; this.sigGenerator = sigGenerator; }
public DeleteWorkItem(string fileName, string sourceServerUrl, TransactionalStorage storage) : base(fileName, sourceServerUrl, storage) { }
public static StorageStream CreatingNewAndWritting(TransactionalStorage transactionalStorage, IndexStorage indexStorage, StorageOperationsTask operations, string fileName, NameValueCollection metadata) { if (indexStorage == null) throw new ArgumentNullException("indexStorage", "indexStorage == null"); return new StorageStream(transactionalStorage, fileName, StorageStreamAccess.CreateAndWrite, metadata, indexStorage, operations); }
public SynchronizationHiLo(TransactionalStorage storage) { this.storage = storage; }
public MetadataUpdateWorkItem(string fileName, string sourceServerUrl, NameValueCollection destinationMetadata, TransactionalStorage storage) : base(fileName, sourceServerUrl, storage) { this.destinationMetadata = destinationMetadata; }
public ReadFileToDatabase(BufferPool bufferPool, TransactionalStorage storage, Stream inputStream, string filename) { this.bufferPool = bufferPool; this.inputStream = inputStream; this.storage = storage; this.filename = filename; buffer = bufferPool.TakeBuffer(StorageConstants.MaxPageSize); md5Hasher = new MD5CryptoServiceProvider(); }