示例#1
0
文件: CDATA.cs 项目: fujie/apiserver
 //
 // Export
 //
 // OpenExportConnection
 public void OpenExportConnection(KeyedCollection <string, ConfigParameter> _configParameters,
                                  Schema _types,
                                  OpenExportConnectionRunStep _exportRunStep)
 {
     utils.Logger(TraceEventType.Information,
                  ConstDefinition.ID0700_START_OPENEXPORTCONNECTION,
                  ConstDefinition.MSG0700_START_OPENEXPORTCONNECTION);
     resource_uri = _configParameters[ConstDefinition.CFG_RESOURCE_URI].Value.ToString();
     auth_token   = _configParameters[ConstDefinition.CFG_AUTH_TOKEN].Value.ToString();
 }
示例#2
0
        public void OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            try
            {
                this.GetMAConfig(configParameters);

                this.OpenRSAConnection();
            }
            catch (Exception ex)
            {
                EmailError(ex);
                throw ex;
            }
        }
示例#3
0
        /// <summary>
        /// Begins an export session
        /// </summary>
        /// <param name="configParameters">The configuration parameters supplied to this management agent</param>
        /// <param name="types">The schema types that apply to this export run</param>
        /// <param name="exportRunStep">The definition of the current run step</param>
        public void OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            try
            {
                this.suppliedConfigParameters = configParameters;
                Logger.LogPath = this.LogPath;
                Logger.WriteSeparatorLine('*');
                Logger.WriteLine("Starting Export");

                this.client = new AcmaSyncServiceClient();
                this.client.Open();

                this.client.ExportStart();
            }
            catch (Exception ex)
            {
                Logger.WriteException(ex);
                throw;
            }
        }
        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();
        }
示例#5
0
        void IMAExtensible2CallExport.OpenExportConnection(System.Collections.ObjectModel.KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            Tracer.IndentLevel = 0;
            Tracer.Enter("openexportconnection");
            Tracer.Indent();
            try
            {
                InitializeConfigParameters(configParameters);

                OpenRunspace();
                schema = types;

                exportType = exportRunStep.ExportType;
                Tracer.TraceInformation("export-type '{0}'", exportType);
                exportBatchSize = exportRunStep.BatchSize;
                Tracer.TraceInformation("export-batch-size '{0}'", exportBatchSize);
            }
            catch (Exception ex)
            {
                Tracer.TraceError("openexportconnection", ex);
                throw new TerminateRunException(ex.Message);
            }
            finally
            {
                Tracer.Unindent();
                Tracer.Exit("openexportconnection");
            }
        }
示例#6
0
        public void OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            // The schema types are required for serialization, so save them into a local variable for use in CloseExportConnection
            this.operationSchema = types;

            // Load the existing items from the queue. We want to add to this collection, rather than overwrite it as an import operation may not have been run yet
            CSEntryChangeQueue.LoadQueue(this.filename);

            // ... Export initialization code
        }
示例#7
0
        public void OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            Logging.SetupLogger(configParameters);

            this.exportContext = new ExportContext()
            {
                ConfigParameters = configParameters
            };

            try
            {
                logger.Info("Starting export");
                this.exportContext.ConnectionContext = InterfaceManager.GetProviderOrDefault <IConnectionContextProvider>()?.GetConnectionContext(configParameters, ConnectionContextOperationType.Export);
                this.InitializeProviders(this.exportContext);
                this.exportContext.Timer.Start();
            }
            catch (Exception ex)
            {
                logger.Error(ex.UnwrapIfSingleAggregateException());
                throw;
            }
        }
示例#8
0
        public void OpenExportConnectionDetached(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            Tracer.Enter(nameof(OpenExportConnectionDetached));
            try
            {
                InitializeConfigParameters(configParameters);

                Schema = types;

                ExportType = exportRunStep.ExportType;
                Tracer.TraceInformation("step-partition-id {0}", exportRunStep.StepPartition.Identifier);
                Tracer.TraceInformation("step-partition-dn {0}", exportRunStep.StepPartition.DN);
                Tracer.TraceInformation("step-partition-name {0}", exportRunStep.StepPartition.Name);
                Tracer.TraceInformation("export-type {0}", ExportType);
                ExportBatchSize = exportRunStep.BatchSize;
                Tracer.TraceInformation("export-batch-size {0:n0}", ExportBatchSize);

                methods.OpenConnection();

                if (Configuration.RunBeforeExport)
                {
                    List <SqlParameter> parameters = new List <SqlParameter>();
                    parameters.Add(new SqlParameter("exporttype", ExportType.ToString()));
                    methods.RunStoredProcedure(Configuration.ExportCommandBefore, parameters);
                }
            }
            catch (Exception ex)
            {
                Tracer.TraceError(nameof(OpenExportConnectionDetached), ex);
                throw new TerminateRunException(ex.Message);
            }
            finally
            {
                Tracer.Exit(nameof(OpenExportConnectionDetached));
            }
        }
 //Export Region
 public void OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
 {
     this.exUrl = configParameters["exUrl"].Value;
     this.webServiceUsername = configParameters["webServiceUsername"].Value;
     this.webServicePassword = configParameters["webServicePassword"].Value;
     this.enableLogging      = configParameters["enableLogging"].Value;
     this.loggingLevel       = configParameters["loggingLevel"].Value;
 }
        /// <summary>
        /// Begins an export session
        /// </summary>
        /// <param name="configParameters">The configuration parameters supplied to this management agent</param>
        /// <param name="types">The schema types that apply to this export run</param>
        /// <param name="exportRunStep">The definition of the current run step</param>
        void IMAExtensible2CallExport.OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
        {
            try
            {
                ManagementAgent.MAParameters = new MAParameters(configParameters);
                Logger.LogPath = ManagementAgent.MAParameters.LogPath;
                Logger.WriteSeparatorLine('*');
                Logger.WriteLine("Starting Export");

                MAConfig.Load(ManagementAgent.MAParameters.MAConfigurationFilePath);

                SshConnection.OpenSshConnection(ManagementAgent.MAParameters);

                OperationBase operation = MAConfig.GlobalOperations.FirstOrDefault(t => t is ExportStartOperation);

                if (operation != null)
                {
                    try
                    {
                        SshConnection.ExecuteOperation(operation);
                    }
                    catch (Exception ex)
                    {
                        Logger.WriteLine("Could not perform export start operation");
                        Logger.WriteException(ex);
                        throw new ExtensibleExtensionException("Export start operation failed", ex);
                    }
                }
            }
            catch (ExtensibleExtensionException)
            {
                throw;
            }
            catch (Exception ex)
            {
                Logger.WriteLine("A exception occured during the open export connection operartion");
                Logger.WriteException(ex);
                throw new ExtensibleExtensionException("An exception occured during the open export connection operation", ex);
            }
        }
示例#11
0
 public void OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types,
                                  OpenExportConnectionRunStep exportRunStep)
 {
     _schemaTypes   = types;
     _objectSources = GetRepositoryContainers(configParameters);
 }
示例#12
0
 void IMAExtensible2CallExport.OpenExportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenExportConnectionRunStep exportRunStep)
 {
     OpenExportConnectionDetached(configParameters, types, exportRunStep);
 }