コード例 #1
0
        public void SaveReplicationFolder(IReplicationFolderMetadata replicationFolder)
        {
            if (replicationFolder == null)
            {
                throw new ArgumentNullException("replicationFolder");
            }

            ReplicationFolderMetadata typedReplicationFolder = (ReplicationFolderMetadata)replicationFolder;

            this.ReplicationFolderAdapter.UpdateReplicationFolder(typedReplicationFolder);
        }
コード例 #2
0
        public IReplicationFolderMetadata CreateReplicationFolder(IFolderMetadata folder, IStorageMetadata targetStorage)
        {
            if (folder == null)
            {
                throw new ArgumentNullException("folder");
            }

            if (targetStorage == null)
            {
                throw new ArgumentNullException("targetStorage");
            }

            ReplicationFolderMetadata metadata = new ReplicationFolderMetadata(folder, targetStorage);

            return(metadata);
        }
コード例 #3
0
        /// <summary>
        /// Возвращает метаданные папки репликации. Если ее не существует, то создает ее.
        /// </summary>
        /// <param name="folder">Папка.</param>
        /// <param name="sourceStorage">Узел источник для репликации.</param>
        /// <returns></returns>
        public IReplicationFolderMetadata EnsureReplicationFolder(IFolderMetadata folder, IStorageMetadata sourceStorage)
        {
            if (folder == null)
            {
                throw new ArgumentNullException("folder");
            }

            if (sourceStorage == null)
            {
                throw new ArgumentNullException("sourceStorage");
            }

            IReplicationFolderMetadata replicationFolder = this.GetReplicationFolder(folder, sourceStorage);

            if (replicationFolder == null)
            {
                replicationFolder = new ReplicationFolderMetadata(folder, sourceStorage);
                this.SaveReplicationFolder(replicationFolder);
            }

            return(replicationFolder);
        }