コード例 #1
0
        public void OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            this.cancellationToken = new CancellationTokenSource();
            this.Configuration     = new ManagementAgentParameters(configParameters);
            this.DeltaPath         = Path.Combine(MAUtils.MAFolder, ManagementAgent.DeltaFile);

            Logger.LogPath = this.Configuration.MALogFile;
            Logger.WriteLine("Opening export connection");
            this.SetHttpDebugMode();

            this.timer = new Stopwatch();

            ManagementAgent.Schema    = SchemaBuilder.GetSchema(this.Configuration);
            this.operationSchemaTypes = types;

            CSEntryChangeQueue.LoadQueue(this.DeltaPath);

            this.LoadInternalDomainsIfRequired(types);
            this.timer.Start();
        }
コード例 #2
0
        public OpenImportConnectionResults OpenImportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenImportConnectionRunStep importRunStep)
        {
            try
            {
                this.cancellationToken = new CancellationTokenSource();
                this.Configuration     = new ManagementAgentParameters(configParameters);
                Logger.LogPath         = this.Configuration.MALogFile;

                this.importRunStep        = importRunStep;
                this.operationSchemaTypes = types;
                this.timer = new Stopwatch();

                this.DeltaPath = Path.Combine(MAUtils.MAFolder, ManagementAgent.DeltaFile);

                Logger.WriteLine("Opening import connection. Page size {0}", this.importRunStep.PageSize);

                if (this.importRunStep.ImportType == OperationType.Delta)
                {
                    CSEntryChangeQueue.LoadQueue(this.DeltaPath);
                    Logger.WriteLine("Delta full import from file started. {0} entries to import", CSEntryChangeQueue.Count);
                }
                else
                {
                    this.OpenImportConnectionFull(types);

                    Logger.WriteLine("Background full import from Google started");
                }

                this.timer.Start();
                return(new OpenImportConnectionResults("<placeholder>"));
            }
            catch (Exception ex)
            {
                Logger.WriteException(ex);
                throw;
            }
        }