Inheritance: System.Runtime.ConstrainedExecution.CriticalFinalizerObject, IDisposable
Ejemplo n.º 1
0
		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>();
		}
Ejemplo n.º 3
0
		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;
		}
Ejemplo n.º 8
0
		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;
		}
Ejemplo n.º 10
0
		public SequenceActions(TransactionalStorage storage)
		{
			this.storage = storage;
		}
Ejemplo n.º 11
0
		public static StorageStream Reading(TransactionalStorage transactionalStorage, string fileName)
		{
			return new StorageStream(transactionalStorage, fileName, StorageStreamAccess.Read, null, null, null);
		}
Ejemplo n.º 12
0
		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;
		}
Ejemplo n.º 14
0
		public DeleteWorkItem(string fileName, string sourceServerUrl, TransactionalStorage storage)
			: base(fileName, sourceServerUrl, storage)
		{
		}
Ejemplo n.º 15
0
		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;
		}
Ejemplo n.º 18
0
			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();
			}