/// <summary> /// Exports a batch of entries to the database /// </summary> /// <param name="csentries">A list of changes to export</param> /// <returns>The results of the batch export</returns> public PutExportEntriesResults PutExportEntries(IList <CSEntryChange> csentries) { try { this.client = new AcmaSyncServiceClient(); PutExportEntriesResults exportEntriesResults = new PutExportEntriesResults(); IList <AttributeChange> anchorchanges = new List <AttributeChange>(); ExportRequest request = new ExportRequest(); request.CSEntryChanges = csentries; Logger.WriteLine("Exporting page of {0} objects", csentries.Count); ExportResponse response = this.client.ExportPage(request); Logger.WriteLine("Got response of {0} objects", response.Results.Count); foreach (CSEntryChangeResult item in response.Results) { exportEntriesResults.CSEntryChangeResults.Add(item); } return(exportEntriesResults); } catch (Exception ex) { Logger.WriteException(ex); throw; } }
/// <summary> /// Configures the import session at the beginning of an import /// </summary> /// <param name="configParameters">The configuration parameters supplied to this management agent</param> /// <param name="types">The schema types that apply to this import run</param> /// <param name="importRunStep">The definition of the current run step</param> /// <returns>Results of the import setup</returns> public OpenImportConnectionResults OpenImportConnection(KeyedCollection <string, ConfigParameter> configParameters, Schema types, OpenImportConnectionRunStep importRunStep) { try { this.suppliedConfigParameters = configParameters; Logger.LogPath = this.LogPath; Logger.WriteSeparatorLine('*'); Logger.WriteLine("Starting Import"); Logger.WriteLine("Import data from sync engine: " + importRunStep.CustomData); this.client = new AcmaSyncServiceClient(); this.client.Open(); ImportStartRequest request = new ImportStartRequest(); request.ImportType = importRunStep.ImportType; request.PageSize = 0; request.Schema = types; this.importResponse = this.client.ImportStart(request); this.importPageSize = importRunStep.PageSize; return(new OpenImportConnectionResults()); } catch (Exception ex) { Logger.WriteException(ex); throw; } }
private void Close() { if (this.client != null) { if (this.client.State == System.ServiceModel.CommunicationState.Opened) { this.client.Close(); } this.client = null; } }
/// <summary> /// Gets the schema that applies to the objects in this management agent /// </summary> /// <param name="configParameters">The configuration parameters supplied to this management agent</param> /// <returns>The Schema defining objects and attributes applicable to this management agent</returns> public Schema GetSchema(KeyedCollection <string, ConfigParameter> configParameters) { try { this.client = new AcmaSyncServiceClient(); return(this.client.GetMmsSchema()); } catch (Exception ex) { Logger.WriteException(ex); throw; } finally { this.Close(); } }
/// <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; } }