Example #1
0
 public HttpService(
     ISerializationHelper serializationHelper,
     IHttpClientFactory httpClientFactory)
 {
     this.serializationHelper = serializationHelper;
     this.httpClientFactory   = httpClientFactory;
 }
Example #2
0
        internal string Execute(DateTime changeDate, string targetXmlPath, ISerializationHelper serializationHelper,
                                ICompressionHelper compressionHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            CAFO ds = _dbService.GetCAFOAddData(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (Record Count = {0}).", ds.CAFO_FAC.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            CAFOFacilityList facs = CAFOTransform.Transform(ds);

            if (facs == null || facs.CAFOFacilities == null || facs.CAFOFacilities.Count == 0)
            {
                return(null);
            }
            else
            {
                hereBaseService.AppendAuditLogEvent("Results transformed: (Record Count: {0})", facs.CAFOFacilities.Count);

                hereBaseService.AppendAuditLogEvent(
                    "Serializing transformed results to file (File = {0}).",
                    targetXmlPath);

                serializationHelper.Serialize(facs, targetXmlPath);

                return(compressionHelper.CompressFile(targetXmlPath));
            }
        }
 public HttpClientTransport(string clientName, IMessageSerializer serializer, ISerializationHelper serializationHelper, IHttpClientFactory httpClientFactory)
 {
     _clientName              = clientName;
     _httpClientFactory       = httpClientFactory;
     _serializer              = serializer;
     this.serializationHelper = serializationHelper;
 }
Example #4
0
 public RecordingMethodManager(IExecutionCache executionCache, IThreadIdProvider threadProvider, IExecutionStack executionStack, ISerializationHelper serializationHelper)
 {
     _executionCache      = executionCache;
     _threadProvider      = threadProvider;
     _executionStack      = executionStack;
     _serializationHelper = serializationHelper;
 }
Example #5
0
        internal string Execute(DateTime changeDate, string targetXmlPath, ISerializationHelper serializationHelper,
                                ICompressionHelper compressionHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            HERE10.DomainDataSet ds = _dbService.GetDomainData(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (List Count = {0}).", ds.List.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            List <HERE10.DomainList> lists = new List <HERE10.DomainList>();

            foreach (HERE10.DomainDataSet.ListRow listRow in ds.List.Rows)
            {
                HERE10.DomainList item = new HERE10.DomainList();

                item.DomainListNameText     = listRow.ListName;
                item.OriginatingPartnerName = listRow.ListOwnerName;

                List <DomainValueItemDataType> listItems = new List <DomainValueItemDataType>();

                foreach (HERE10.DomainDataSet.ListItemRow listItemRow in listRow.GetListItemRows())
                {
                    DomainValueItemDataType listItem = new DomainValueItemDataType();

                    listItem.ItemCode            = listItemRow.ItemCode;
                    listItem.ItemText            = listItemRow.ItemValue;
                    listItem.ItemDescriptionText = listItemRow.ItemDesc;

                    listItems.Add(listItem);
                }

                item.DomainListItem = listItems.ToArray();

                lists.Add(item);
            }

            if (lists.Count == 0)
            {
                return(null);
            }
            else
            {
                HERE10.DomainValueListDataType domain = new HERE10.DomainValueListDataType();
                domain.DomainList = lists.ToArray();

                hereBaseService.AppendAuditLogEvent("Results transformed.");

                hereBaseService.AppendAuditLogEvent(
                    "Serializing transformed results to file (File = {0}).",
                    targetXmlPath);

                serializationHelper.Serialize(domain, targetXmlPath);

                return(compressionHelper.CompressFile(targetXmlPath));
            }
        }
Example #6
0
 public ContentRepository(
     ISerializationHelper serializationHelper,
     IFileSystemHelper fileSystemHelper,
     IContentFinder contentFinder)
 {
     this.serializationHelper = serializationHelper;
     this.fileSystemHelper = fileSystemHelper;
     this.contentFinder = contentFinder;
 }
Example #7
0
 public ContentRepository(
     ISerializationHelper serializationHelper,
     IFileSystemHelper fileSystemHelper,
     IContentFinder contentFinder)
 {
     this.serializationHelper = serializationHelper;
     this.fileSystemHelper    = fileSystemHelper;
     this.contentFinder       = contentFinder;
 }
 /// <summary>
 /// Initializes a new instance of the MainViewModel class.
 /// </summary>
 protected CopyViewModel(IDispatcherWrapper dispatcher, ISerializationHelper serializationHelper, IDialogService dialogService, IOpenerHelper openerHelper)
 {
     _isSliderLoaded      = false;
     _dragStarted         = false;
     _serializationHelper = serializationHelper;
     _dialogService       = dialogService;
     _openerHelper        = openerHelper;
     Dispatcher           = dispatcher;
     SetCommands();
 }
 public PasswordProjectStor(ISerializationHelper <PaswordProjectDataStor> serializationHelper
                            , ICryptor cryptor
                            , ISign sign
                            , IFileReadWriteHelper fileReadWrite)
 {
     SerializationHelper = serializationHelper;
     Cryptor             = cryptor;
     Sign          = sign;
     FileReadWrite = fileReadWrite;
 }
Example #10
0
 public HttpTransportMidleware(
     RequestDelegate next,
     ILogger <HttpTransportMidleware> logger,
     HttpServerTransportOptions httpServerTransportOptions,
     ISerializationHelper serializationHelper)
 {
     _next   = next;
     _logger = logger;
     _httpServerTransportOptions = httpServerTransportOptions;
     _serializationHelper        = serializationHelper;
 }
Example #11
0
        internal string Execute(DateTime changeDate, string flowName, string targetXmlPath,
                                ISerializationHelper serializationHelper, ICompressionHelper compressionHelper,
                                IObjectsFromDatabase objectsFromDatabase,
                                IAppendAuditLogEvent appendAuditLogEvent)
        {
            appendAuditLogEvent.AppendAuditLogEvent("Querying TANKS data ...");

            string whereQuery =
                string.Format("FAC_SITE_IDEN IN (SELECT ST_FAC_IND FROM CHANGED_FACILITIES WHERE IS_DELETED = 0 AND UPPER(FLOW_TYPE) = UPPER('{0}') AND UPDATE_DATE >= '{1}')",
                              flowName, changeDate.ToString("dd-MMM-yyyy").ToUpper());

            Dictionary <string, DbAppendSelectWhereClause> selectClauses = new Dictionary <string, DbAppendSelectWhereClause>();

            selectClauses.Add("TANKS_FAC_SITE", new DbAppendSelectWhereClause(whereQuery, null));
            List <TanksSubmissionDataType> dataList =
                objectsFromDatabase.LoadFromDatabase <TanksSubmissionDataType>(_baseDao, selectClauses);

            TanksSubmissionDataType data;

            if (CollectionUtils.IsNullOrEmpty(dataList))
            {
                appendAuditLogEvent.AppendAuditLogEvent("Did not find any TANKS data in database.");
                return(null);
            }
            else if (dataList.Count > 1)
            {
                throw new InvalidOperationException("More than one set of TANKS data was found in database.");
            }
            else
            {
                data = dataList[0];
                if (CollectionUtils.IsNullOrEmpty(data.TanksFacilitySite))
                {
                    appendAuditLogEvent.AppendAuditLogEvent("Did not find any tanks facilities.");
                    return(null);
                }
                else
                {
                    appendAuditLogEvent.AppendAuditLogEvent("Found {0} facilities and {1} unique tanks.",
                                                            data.TanksFacilitySite.Length,
                                                            GetUniqueTankCount(data));
                }
            }

            appendAuditLogEvent.AppendAuditLogEvent(
                "Serializing transformed results to file (File = {0}).",
                targetXmlPath);

            serializationHelper.Serialize(data, targetXmlPath);

            return(compressionHelper.CompressFile(targetXmlPath));
        }
        internal byte[] Execute(ICollection <string> allFlowList, ICollection <string> protectedFlowList,
                                ICollection <string> userProtectedFlowList, DateTime changeDate,
                                ISerializationHelper serializationHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            HERE10.ManifestDataSet ds = _dbService.GetManifestData(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (Record Count = {0}).", ds.Manifest.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            List <HERE10.HEREManifestItemDataType> manifestItems = new List <HERE10.HEREManifestItemDataType>();

            foreach (HERE10.ManifestDataSet.ManifestRow manifestRow in ds.Manifest.Rows)
            {
                string flowCode = manifestRow.DataExchangeName;

                if (ContainsFlowName(allFlowList, flowCode))
                {
                    if (ContainsFlowName(protectedFlowList, flowCode))
                    {
                        if (!ContainsFlowName(userProtectedFlowList, flowCode))
                        {
                            // User does not have access to this flow
                            continue;
                        }
                    }

                    HERE10.HEREManifestItemDataType item = new HERE10.HEREManifestItemDataType();

                    item.TransactionIdentifier = manifestRow.TransactionId;
                    item.CreatedDate           = manifestRow.CreatedDate;
                    item.DataExchangeNameText  = manifestRow.DataExchangeName;
                    item.EndpointURLIdentifier = manifestRow.EndpointURL;
                    item.FullReplaceIndicator  = manifestRow.FullReplaceIndicator;
                    item.SourceInfo            = new HERE10.SourceInfoDataType();
                    item.SourceInfo.IsFacilitySourceIndicator = manifestRow.IsFacilitySourceIndicator;
                    item.SourceInfo.SourceSystemName          = manifestRow.SourceSystemName;
                    manifestItems.Add(item);
                }
            }

            HERE10.HEREManifestDataType manifest = new HERE10.HEREManifestDataType();
            manifest.HEREManifestDetails = manifestItems.ToArray();

            hereBaseService.AppendAuditLogEvent("Results transformed.");

            return(serializationHelper.Serialize(manifest));
        }
Example #13
0
 public ImportWorkerJob(Int32 agentId, IAgentHelper agentHelper, ISqlQueryHelper sqlQueryHelper, IArtifactQueries artifactQueryHelper, DateTime processedOnDateTime, IRsapiRepositoryGroup rsapiRepositoryGroup, IEnumerable <Int32> resourceGroupIds, IAPILog logger, APIOptions apiOptions, ISerializationHelper serializationHelper)
 {
     TableRowId            = 0;
     WorkspaceArtifactId   = -1;
     AgentId               = agentId;
     AgentHelper           = agentHelper;
     SqlQueryHelper        = sqlQueryHelper;
     QueueTable            = Constant.Tables.ImportWorkerQueue;
     ProcessedOnDateTime   = processedOnDateTime;
     AgentResourceGroupIds = resourceGroupIds;
     Logger               = logger;
     _repositoryGroup     = rsapiRepositoryGroup;
     _artifactQueryHelper = artifactQueryHelper;
     _apiOptions          = apiOptions;
     _serializationHelper = serializationHelper;
 }
Example #14
0
        internal string Execute(DateTime changeDate, string targetXmlPath, ISerializationHelper serializationHelper,
                                ICompressionHelper compressionHelper, HEREBaseService hereBaseService)
        {
            hereBaseService.AppendAuditLogEvent("Getting data.");

            Tier2DataSet ds = _dbService.GetTier2DataSet(changeDate);

            hereBaseService.AppendAuditLogEvent("Data retrieved. (Record Count = {0}).",
                                                ds.T2_SUBMISSION.Rows.Count);

            hereBaseService.AppendAuditLogEvent("Transforming results.");

            TierIIDataType facs = Tier2Transform.Transform(ds);

            if (facs == null || facs.Submission == null || facs.Submission.Length == 0)
            {
                return(null);
            }
            else
            {
                hereBaseService.AppendAuditLogEvent("Results transformed. (Record Count = {0}).",
                                                    facs.Submission.Length);

                hereBaseService.AppendAuditLogEvent("Serializing transformed results to file (File = {0}).",
                                                    targetXmlPath);

                serializationHelper.Serialize(facs, targetXmlPath);

                hereBaseService.AppendAuditLogEvent("Transformed results Serialized.");

                if (compressionHelper != null)
                {
                    return(compressionHelper.CompressFile(targetXmlPath));
                }
                else
                {
                    return(targetXmlPath);
                }
            }
        }
 public WidgetSpecificationRepository(ISerializationHelper serializationHelper, IFileSystemHelper fileSystemHelper)
 {
     this.serializationHelper = serializationHelper;
     this.fileSystemHelper = fileSystemHelper;
 }
Example #16
0
 public FolderCopyViewModel(IDispatcherWrapper dispatcher, IFolderSearcher folderSearcher, IRandomFolderSelector folderSelector, IFolderCopier folderCopier, ISerializationHelper serializationHelper, IDialogService dialogService, IOpenerHelper openerHelper)
     : base(dispatcher ?? new DispatcherWrapper(), serializationHelper ?? new SerializationHelper(), dialogService ?? new DialogService(), openerHelper ?? new OpenerHelper())
 {
     _folderSearcher = folderSearcher ?? new FolderSearcher();
     _folderSelector = folderSelector ?? new RandomFolderSelector();
     _folderCopier   = folderCopier ?? new FolderCopier();
     SelectionModel  = new SelectionModel(0, 100, UnitSize.GB);
     Model           = new SourceDestinationModel <CopyRepresenter>();
 }
 public InstanceSerializationVerifier(ISerializationHelper serializer, IUnserializableTypeHelper dalHelper)
 {
     _serializer = serializer;
     _helper     = dalHelper;
 }
Example #18
0
 public WidgetSpecificationRepository(ISerializationHelper serializationHelper, IFileSystemHelper fileSystemHelper)
 {
     this.serializationHelper = serializationHelper;
     this.fileSystemHelper    = fileSystemHelper;
 }
Example #19
0
 public FileCopyViewModel(IFileSearcher fileSearcher, IDispatcherWrapper dispatcher, ISerializationHelper serializationHelper, IDialogService dialogService, IOpenerHelper openerHelper, IConfigurationHelper configurationHelper)
     : base(dispatcher, serializationHelper, dialogService, openerHelper)
 {
     FileSearcher        = fileSearcher;
     ConfigurationHelper = configurationHelper;
 }
        public static WQXDataType GenerateWqxObjectsFromSubmissionFile(IAppendAuditLogEvent appendAuditLogEvent, string submissionFilePath,
                                                                       string sysTempFolderPath, Assembly xmlSchemaZippedResourceAssembly,
                                                                       string xmlSchemaZippedQualifiedResourceName, string xmlSchemaRootFileName,
                                                                       ISerializationHelper serializationHelper, ICompressionHelper compressionHelper,
                                                                       out string attachmentsFolderPath, out string validationErrorsFile)
        {
            WQXDataType data = null;

            attachmentsFolderPath = null;
            string wqxFilePath = null;

            validationErrorsFile = null;

            try
            {
                attachmentsFolderPath = Path.Combine(sysTempFolderPath, Guid.NewGuid().ToString());
                Directory.CreateDirectory(attachmentsFolderPath);

                appendAuditLogEvent.AppendAuditLogEvent("Decompressing the WQX data to a temporary folder ...");
                try
                {
                    compressionHelper.UncompressDirectory(submissionFilePath, attachmentsFolderPath);
                }
                catch (Exception ex)
                {
                    throw new ArgException("An error occurred decompressing the WQX data: {0}", ExceptionUtils.GetDeepExceptionMessage(ex));
                }
                string[] xmlFiles = Directory.GetFiles(attachmentsFolderPath, "*.xml");
                if (xmlFiles.Length == 0)
                {
                    throw new ArgException("Failed to locate an WQX xml file in the WQX data");
                }
                else if (xmlFiles.Length > 1)
                {
                    throw new ArgException("More than one xml file was found in the WQX data");
                }
                wqxFilePath = xmlFiles[0];

                if (!string.IsNullOrEmpty(xmlSchemaZippedQualifiedResourceName))
                {
                    validationErrorsFile =
                        BaseWNOSPlugin.ValidateXmlFile(wqxFilePath, xmlSchemaZippedResourceAssembly, xmlSchemaZippedQualifiedResourceName,
                                                       xmlSchemaRootFileName, sysTempFolderPath, appendAuditLogEvent, compressionHelper);

                    if (validationErrorsFile != null)
                    {
                        FileUtils.SafeDeleteDirectory(attachmentsFolderPath);
                        return(null);
                    }
                }

                //Remove header
                wqxFilePath = RemoveHeaderFile(wqxFilePath, sysTempFolderPath, serializationHelper);

                appendAuditLogEvent.AppendAuditLogEvent("Deserializing the WQX data xml file ...");
                try
                {
                    data = serializationHelper.Deserialize <WQXDataType>(wqxFilePath);
                }
                catch (Exception ex)
                {
                    appendAuditLogEvent.AppendAuditLogEvent("Failed to deserialize the WQX data xml file: {0}", ExceptionUtils.GetDeepExceptionMessage(ex));
                    throw;
                }
                if (data == null)
                {
                    appendAuditLogEvent.AppendAuditLogEvent("The WQX data does not contain any organizations, so no elements will be stored in the database.");
                    return(null);
                }
            }
            catch (Exception ex)
            {
                FileUtils.SafeDeleteDirectory(attachmentsFolderPath);
                throw ex;
            }
            finally
            {
                FileUtils.SafeDeleteFile(wqxFilePath);
            }

            return(data);
        }
Example #21
0
 public AESCryptor(ISerializationHelper <KeyValuePair <String, String> > serializationHelper, IFileReadWriteHelper fileReadWrite)
 {
     SerializationHelper = serializationHelper;
     FileReadWrite       = fileReadWrite;
     initKey();
 }
Example #22
0
 public ConfigurationRepository(IFileSystemHelper fileSystemHelper, ISerializationHelper serializationHelper)
 {
     this.fileSystemHelper = fileSystemHelper;
     this.serializationHelper = serializationHelper;
 }
 public ZmqPullWireDataReceiver(ZmqContext context, ZmqTransportConfiguration configuration, ISerializationHelper helper)
 {
     _context = context;
     _configuration = configuration;
     _serializer = new MessageWireDataSerializer(helper);
 }
        public AudioCopyViewModel(IFileSearcher fileSearcher, IDispatcherWrapper dispatcher, IRandomAudioFileSelector randomFileSelector, ISerializationHelper serializationHelper, IDialogService dialogService, IOpenerHelper openerHelper, IConfigurationHelper configurationHelper)
            : base(fileSearcher ?? new FileSearcher(), dispatcher ?? new DispatcherWrapper(), serializationHelper ?? new SerializationHelper(), dialogService ?? new DialogService(), openerHelper ?? new OpenerHelper(), configurationHelper ?? new ConfigurationHelper())
        {
            _randomAudioFileSelector = randomFileSelector ?? new RandomAudioFileSelector();
            SelectionModel           = new SelectionModel(0, 350, UnitSize.MB);
            var settings = ConfigurationHelper.GetExtensions(ExtensionsAppsettingKey.AudioExtensions);

            AudioExtensions = new ObservableCollection <string>(settings.Select(x => x.Extension));
            Model           = new AudioSourceDestinationModel(settings.Where(x => x.DefaultSelected).Select(x => x.Extension));
        }
Example #25
0
        public VideoCopyViewModel(IFileSearcher fileSearcher, IVideoFileRepresenterFactory videoFileRepresenterFactory, IDispatcherWrapper dispatcher, IRandomVideoFileSelector randomFileSelector, ISerializationHelper serializationHelper, IDialogService dialogService, IOpenerHelper openerHelper, IConfigurationHelper configurationHelper)
            : base(fileSearcher ?? new FileSearcher(), dispatcher ?? new DispatcherWrapper(), serializationHelper ?? new SerializationHelper(), dialogService ?? new DialogService(), openerHelper ?? new OpenerHelper(), configurationHelper ?? new ConfigurationHelper())
        {
            _fileRepresenterFactory = videoFileRepresenterFactory ?? new VideoFileRepresenterFactory();
            _randomFileSelector     = randomFileSelector ?? new RandomVideoFileSelector();
            SelectionModel          = new VideoSelectionModel(0, 10);
            var settings = ConfigurationHelper.GetExtensions(ExtensionsAppsettingKey.VideoExtensions);

            VideoExtensions = new ObservableCollection <string>(settings.Select(x => x.Extension));
            Model           = new VideoSourceDestinationModel(settings.Where(x => x.DefaultSelected).Select(x => x.Extension));
        }
        public static string RemoveHeaderFile(string tempXmlFilePath, string tempFolderPath, ISerializationHelper serializationHelper)
        {
            string tempXmlFilePath2 = null;

            try
            {
                HeaderDocumentHelperQualified headerDocumentHelper = new HeaderDocumentHelperQualified();
                headerDocumentHelper.SerializationHelper = serializationHelper;

                XmlDocument doc = new XmlDocument();
                doc.Load(tempXmlFilePath);

                if (headerDocumentHelper.TryLoad(doc.DocumentElement))
                {
                    XmlElement element = headerDocumentHelper.GetPayload("Update-Insert");

                    //Serialize to new file
                    string fileName = Guid.NewGuid().ToString();
                    tempXmlFilePath2 = Path.Combine(tempFolderPath, WQX_FILE_PREFIX + fileName + ".xml");
                    serializationHelper.Serialize(element, tempXmlFilePath2);

                    return(tempXmlFilePath2);
                }
                else
                {
                    throw new Exception("Unable to load document element.");
                }
            }

            catch (Exception)
            {
                FileUtils.SafeDeleteFile(tempXmlFilePath2);
                throw;
            }
            finally
            {
                FileUtils.SafeDeleteFile(tempXmlFilePath);
            }
        }
 public static string GenerateAndValidateWqxQueryFile(IAppendAuditLogEvent appendAuditLogEvent, IObjectsFromDatabase objectsFromDatabase, SpringBaseDao baseDao,
                                                      string queryOrganizationName, string queryOrganizationIdentifier, string naasUserName, string sysTempFolderPath,
                                                      Assembly xmlSchemaZippedResourceAssembly, string xmlSchemaZippedQualifiedResourceName,
                                                      string xmlSchemaRootFileName, ISerializationHelper serializationHelper, ICompressionHelper compressionHelper,
                                                      out string validationErrorsFile)
 {
     // Jaime had an additional "string naasUserName" parameter to this method, but he did not check in code, so not sure what it does.
     return(GenerateAndValidateWqxQueryFile(appendAuditLogEvent, objectsFromDatabase, baseDao, queryOrganizationName, queryOrganizationIdentifier, sysTempFolderPath,
                                            xmlSchemaZippedResourceAssembly, xmlSchemaZippedQualifiedResourceName, xmlSchemaRootFileName, serializationHelper,
                                            compressionHelper, out validationErrorsFile));
 }
        public static string MakeHeaderFile(string tempXmlFilePath, string tempFolderPath, string author, string orgId, ISerializationHelper serializationHelper)
        {
            string tempXmlFilePath2 = null;

            try
            {
                HeaderDocumentHelperQualified headerDocumentHelper = new HeaderDocumentHelperQualified();
                headerDocumentHelper.SerializationHelper = serializationHelper;

                headerDocumentHelper.Configure(author, orgId, null, null, null, null);

                XmlDocument doc = new XmlDocument();
                doc.Load(tempXmlFilePath);

                headerDocumentHelper.AddPayload("Update-Insert", doc.DocumentElement);

                //Serialize to new file
                string fileName = Guid.NewGuid().ToString();
                tempXmlFilePath2 = Path.Combine(tempFolderPath, WQX_FILE_PREFIX + fileName + ".xml");
                headerDocumentHelper.Serialize(tempXmlFilePath2);

                return(tempXmlFilePath2);
            }
            catch (Exception)
            {
                FileUtils.SafeDeleteFile(tempXmlFilePath2);
                throw;
            }
            finally
            {
                FileUtils.SafeDeleteFile(tempXmlFilePath);
            }
        }
Example #29
0
 public InputParameterVerifier(ISerializationHelper serializer, IUnserializableTypeHelper dalHelper)
 {
     _serializer = serializer;
     _dalHelper  = dalHelper;
 }
 public CustomTcpWireSendingTransport(ISerializationHelper helper, TaskScheduler taskScheduler)
 {
     _taskScheduler = taskScheduler;
     _serializer = new MessageWireDataSerializer(helper);
 }
 // ReSharper disable once MemberCanBePrivate.Global
 internal ExceptionTester(IExceptionResolver exceptionResolver, ISerializationHelper serializationHelper)
 {
     _exceptionResolver = exceptionResolver;
     _serializationHelper = serializationHelper;
 }
 public MessageWireDataSerializer(ISerializationHelper serializationHelper)
 {
     _serializationHelper = serializationHelper;
 }
        public static WQXDataType GenerateWqxObjectsFromSubmissionFile(IAppendAuditLogEvent appendAuditLogEvent, string submissionFilePath,
                                                                       string sysTempFolderPath, ISerializationHelper serializationHelper,
                                                                       ICompressionHelper compressionHelper, out string attachmentsFolderPath)
        {
            string validationErrorsFile;

            return(GenerateWqxObjectsFromSubmissionFile(appendAuditLogEvent, submissionFilePath, sysTempFolderPath, null, null, null,
                                                        serializationHelper, compressionHelper, out attachmentsFolderPath,
                                                        out validationErrorsFile));
        }
Example #34
0
 public ReturnValVerifier(ISerializationHelper serializer, IUnserializableTypeHelper dalHelper)
 {
     _serializer = serializer;
     _helper     = dalHelper;
 }
 public ZmqPushWireSendingTransport(ZmqContext context, ISerializationHelper helper)
 {
     _context = context;
     _serializer = new MessageWireDataSerializer(helper);
 }
        public static string GenerateAndValidateWqxQueryFile(IAppendAuditLogEvent appendAuditLogEvent, IObjectsFromDatabase objectsFromDatabase, SpringBaseDao baseDao,
                                                             string queryOrganizationName, string queryOrganizationIdentifier, string sysTempFolderPath,
                                                             Assembly xmlSchemaZippedResourceAssembly, string xmlSchemaZippedQualifiedResourceName,
                                                             string xmlSchemaRootFileName, ISerializationHelper serializationHelper, ICompressionHelper compressionHelper,
                                                             out string validationErrorsFile)
        {
            validationErrorsFile = null;

            WQXDataType wqx = GenerateWqxQueryFromDatabase(appendAuditLogEvent, objectsFromDatabase, baseDao, queryOrganizationIdentifier);

            if (wqx == null)
            {
                return(null);
            }

            appendAuditLogEvent.AppendAuditLogEvent("Generating WQX xml file from query results ...");
            string tempFolderPath  = Path.Combine(sysTempFolderPath, Guid.NewGuid().ToString());
            string fileName        = Guid.NewGuid().ToString();
            string tempXmlFilePath = Path.Combine(tempFolderPath, WQX_FILE_PREFIX + fileName + ".xml");
            string zipXmlFilePath  = Path.ChangeExtension(Path.Combine(sysTempFolderPath, fileName), ".zip");

            Directory.CreateDirectory(tempFolderPath);

            try
            {
                serializationHelper.Serialize(wqx, tempXmlFilePath);

                appendAuditLogEvent.AppendAuditLogEvent("Inserting header into WQX xml file");
                tempXmlFilePath = MakeHeaderFile(tempXmlFilePath, tempFolderPath, queryOrganizationName, queryOrganizationIdentifier, serializationHelper);
                appendAuditLogEvent.AppendAuditLogEvent("Inserted header into WQX xml file");

                appendAuditLogEvent.AppendAuditLogEvent("Generated WQX xml file from query results");

                validationErrorsFile =
                    BaseWNOSPlugin.ValidateXmlFile(tempXmlFilePath, xmlSchemaZippedResourceAssembly, xmlSchemaZippedQualifiedResourceName,
                                                   xmlSchemaRootFileName, sysTempFolderPath, appendAuditLogEvent, compressionHelper);



                if (validationErrorsFile != null)
                {
                    compressionHelper.CompressFile(tempXmlFilePath, zipXmlFilePath);
                    return(zipXmlFilePath);
                }

                try
                {
                    appendAuditLogEvent.AppendAuditLogEvent("Writing attachment files to temp folder ...");
                    WriteAttachmentFilesToFolder(baseDao, wqx, tempFolderPath);
                    appendAuditLogEvent.AppendAuditLogEvent("Wrote attachment files to temp folder.");

                    appendAuditLogEvent.AppendAuditLogEvent("Compressing WQX xml data file and attachments ...");
                    compressionHelper.CompressDirectory(zipXmlFilePath, tempFolderPath);
                    appendAuditLogEvent.AppendAuditLogEvent("Compressed WQX xml data file and attachments.");
                }
                catch (Exception ex)
                {
                    FileUtils.SafeDeleteFile(zipXmlFilePath);
                    throw ex;
                }
                finally
                {
                    FileUtils.SafeDeleteDirectory(tempFolderPath);
                }

                return(zipXmlFilePath);
            }
            catch (Exception)
            {
                FileUtils.SafeDeleteFile(tempXmlFilePath);
                throw;
            }
        }
 public CustomTcpTransportWireDataReceiver(ICustomTcpTransportConfiguration configuration, ISerializationHelper helper)
 {
     _configuration = configuration;
     _serializer = new MessageWireDataSerializer(helper);
     _endpoint = new CustomTcpEndpoint(new IPEndPoint(IPAddress.Loopback, _configuration.Port));
 }
Example #38
0
 public RandomFileSelectorBase(ISerializationHelper serializationHelper)
 {
     _serializationHelper = serializationHelper ?? new SerializationHelper();
 }
Example #39
0
 public ConfigurationRepository(IFileSystemHelper fileSystemHelper, ISerializationHelper serializationHelper)
 {
     this.fileSystemHelper    = fileSystemHelper;
     this.serializationHelper = serializationHelper;
 }