Exemplo n.º 1
0
 public FakeIngest(PipelineArgument argument)
 {
     Document = argument.Document;
     Successor = argument.Successor;
     FakeIngestProperty = argument.PropertyBag.GetProperty(PledgeGlobal.ImportFolderKey);
     FakeIngestValue = argument.PropertyBag.GetProperty(PledgeGlobal.FilePatternKey);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Validator" /> class.
 /// </summary>
 /// <param name="argument">The argument.</param>
 public Validator(PipelineArgument argument)
 {
     Rules = argument.Rules;
     Successor = argument.Successor;
     ClientId = argument.PropertyBag.GetProperty(PledgeGlobal.ClientId);
     EventCounter = GetLoadBalancingCount(100001);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FileSystemReader" /> class.
        /// </summary>
        /// <param name="argument">The argument.</param>
        public FileSystemReader(PipelineArgument argument)
        {
            BatchId = Guid.NewGuid();
            PropertyBag = argument.PropertyBag;
            Document = argument.Document;
            Delimiter = Document.InputDelimiter.DecodeDelimiter();
            Successor = argument.Successor;

            var sourceFolder = PropertyBag.GetProperty(PledgeGlobal.ImportFolderKey);
            var filePattern = PropertyBag.GetProperty(PledgeGlobal.FilePatternKey);
            SourceFile = Directory.GetFiles(sourceFolder, filePattern).FirstOrDefault();
            ArchiveFolder = PropertyBag.GetProperty(PledgeGlobal.ArchiveFolderKey);

            if (!string.IsNullOrEmpty(SourceFile) && File.Exists(SourceFile))
            {
                _reader = new StreamReader(SourceFile);
            } 
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructor of the file system writer class
        /// </summary>
        /// <param name="argument">The argument.</param>
        /// <exception cref="ArgumentNullException">@No target folder has been specified</exception>
        public FileSystemWriter(PipelineArgument argument)
        {
            PassRecords = new List<List<string>>();
            FailRecords = new List<List<string>>();
            PropertyBag = argument.PropertyBag;
            Document = argument.Document;

            var targetFolder = PropertyBag.GetProperty(PledgeGlobal.ExportFolderKey);

            if (string.IsNullOrWhiteSpace(targetFolder))
            {
                throw new ArgumentNullException(nameof(targetFolder), @"No target folder has been specified");
            }

            var passPrefix = PropertyBag.GetProperty(PledgeGlobal.PassPrefixKey);
            var failPrefix = PropertyBag.GetProperty(PledgeGlobal.FailPrefixKey);

            int maxRowsPerOutput;
            if (!int.TryParse(PropertyBag.GetProperty(PledgeGlobal.MaxRowsPerFileKey), out maxRowsPerOutput))
            {
                maxRowsPerOutput = 0;
            }

            PassBatchData = new BatchData
            {
                Id = maxRowsPerOutput > 0 ? 1 : 0,
                Limit = maxRowsPerOutput,
                HasLimit = maxRowsPerOutput > 0,
                Location = targetFolder,
                FileName = GetTempFileName(targetFolder),
                Prefix = string.IsNullOrWhiteSpace(passPrefix) ? _defaultPassPrefix : $"{passPrefix}_{_defaultPassPrefix}"
            };

            FailBatchData = new BatchData
            {
                Location = targetFolder,
                FileName = GetTempFileName(targetFolder),
                Prefix = string.IsNullOrWhiteSpace(failPrefix) ? _defaultFailPrefix : $"{failPrefix}_{_defaultFailPrefix}"
            };
        }
Exemplo n.º 5
0
        public FakeEgest(PipelineArgument argument)
        {

        }