Beispiel #1
0
        protected void LazyInit()
        {
            GetServiceImplementation(out _requestManager);
            GetServiceImplementation(out _serializationHelper);
            GetServiceImplementation(out _compressionHelper);
            GetServiceImplementation(out _documentManager);
            GetServiceImplementation(out _headerDocumentHelper);
            GetServiceImplementation(out _settingsProvider);
            GetServiceImplementation(out _partnerManager);
            GetServiceImplementation(out _nodeEndpointClientFactory);
            GetServiceImplementation(out _transactionManager);

            _baseDao = ValidateDBProvider(DataProviderParameterType.SourceProvider.ToString(),
                                          typeof(NamedNullMappingDataReader));

            GetConfigParameter(CONFIG_ADD_HEADER, true, out _addHeader);
            if (_addHeader)
            {
                _author           = ValidateNonEmptyConfigParameter(CONFIG_AUTHOR);
                _organization     = ValidateNonEmptyConfigParameter(CONFIG_ORGANIZATION);
                _contactInfo      = ValidateNonEmptyConfigParameter(CONFIG_CONTACT_INFO);
                _payloadOperation = ValidateNonEmptyConfigParameter(CONFIG_PAYLOAD_OPERATION);
                _title            = ValidateNonEmptyConfigParameter(CONFIG_TITLE);
                TryGetConfigParameter(CONFIG_NOTIFICATIONS, ref _notifications);
                _rcraInfoUserId    = ValidateNonEmptyConfigParameter(CONFIG_RCRA_INFO_USER_ID);
                _rcraInfoStateCode = ValidateNonEmptyConfigParameter(CONFIG_RCRA_INFO_STATE_CODE);
            }

            ParseNaasUserMappingFile();

            string submitPartnerName = null;

            if (TryGetConfigParameter(CONFIG_SUBMISSION_PARTNER_NAME, ref submitPartnerName))
            {
                _submitPartnerNode = _partnerManager.GetByName(submitPartnerName);
                if (_submitPartnerNode == null)
                {
                    throw new ArgumentException(string.Format("A submission partner with the name \"{0}\" specified for this service cannot be found",
                                                              submitPartnerName));
                }
            }
            if (_submitPartnerNode != null)
            {
                if (_naasUsernameToPasswordMap == null)
                {
                    throw new ArgumentException(string.Format("The service specifies a \"{0},\" but does not specify a \"{1}\"",
                                                              CONFIG_SUBMISSION_PARTNER_NAME, CONFIG_NAAS_USER_MAPPING_FILE_PATH));
                }
            }
            else if (_naasUsernameToPasswordMap != null)
            {
                if (_submitPartnerNode == null)
                {
                    throw new ArgumentException(string.Format("The service specifies a \"{0},\" but does not specify a \"{1}\"",
                                                              CONFIG_NAAS_USER_MAPPING_FILE_PATH, CONFIG_SUBMISSION_PARTNER_NAME));
                }
            }
            TryGetConfigParameter(CONFIG_VALIDATE_XML, ref _validateXml);
        }
Beispiel #2
0
        protected override void LazyInit()
        {
            base.LazyInit();

            GetServiceImplementation(out _transactionManager);
            GetServiceImplementation(out _nodeEndpointClientFactory);
            GetServiceImplementation(out _partnerManager);

            GetConfigParameter(EnumUtils.ToDescription(EISConfigParams.AuthorName), out _authorName);
            GetConfigParameter(EnumUtils.ToDescription(EISConfigParams.OrganizationName), out _organizationName);
            GetConfigParameter(EnumUtils.ToDescription(EISConfigParams.SubmissionProgramSystemCode), out _programSystemCode);
            TryGetConfigParameter(EnumUtils.ToDescription(EISConfigParams.SenderContactInfo), ref _senderContactInfo);
            TryGetConfigParameter(EnumUtils.ToDescription(EISConfigParams.SubmissionFlowName), ref _submitFlowName);
            TryGetConfigParameter(EnumUtils.ToDescription(EISConfigParams.SubmissionOperationName), ref _submitFlowOperation);
            string submissionType;

            GetConfigParameter(EnumUtils.ToDescription(EISConfigParams.SubmissionType), out submissionType);
            if (string.Equals(submissionType, PRODUCTION_SUBMISSION_TYPE_NAME, StringComparison.InvariantCultureIgnoreCase))
            {
                _isProductionSubmission = true;
            }
            else if (string.Equals(submissionType, QA_SUBMISSION_TYPE_NAME, StringComparison.InvariantCultureIgnoreCase))
            {
                _isProductionSubmission = false;
            }
            else
            {
                throw new ArgumentException(string.Format("Invalid {0} specified: {1}, must be either \"{2}\" or \"{3}\"",
                                                          EnumUtils.ToDescription(EISConfigParams.SubmissionType),
                                                          submissionType, PRODUCTION_SUBMISSION_TYPE_NAME, QA_SUBMISSION_TYPE_NAME));
            }

            string epaPartnerName = null;

            TryGetConfigParameter(EnumUtils.ToDescription(EISConfigParams.SubmissionPartnerName), ref epaPartnerName);
            if (!string.IsNullOrEmpty(epaPartnerName))
            {
                _epaPartnerNode = _partnerManager.GetByName(epaPartnerName);
                if (_epaPartnerNode == null)
                {
                    throw new ArgumentException(string.Format("The \"{0}\" with the name \"{1}\" specified for this service cannot be found",
                                                              EnumUtils.ToDescription(EISConfigParams.SubmissionPartnerName), epaPartnerName));
                }
                if (string.IsNullOrEmpty(_submitFlowName))
                {
                    throw new ArgumentException(string.Format("The \"{0}\" configuration parameter was not specified",
                                                              EnumUtils.ToDescription(EISConfigParams.SubmissionFlowName)));
                }
            }
            AppendAuditLogEvent("Config params: {0} ({1}), {2} ({3}), {4} ({5}), {6} ({7}), {8} ({9}), {10} ({11}, {12} ({13})",
                                EnumUtils.ToDescription(EISConfigParams.AuthorName), _authorName,
                                EnumUtils.ToDescription(EISConfigParams.OrganizationName), _organizationName,
                                EnumUtils.ToDescription(EISConfigParams.SenderContactInfo), _senderContactInfo ?? string.Empty,
                                EnumUtils.ToDescription(EISConfigParams.SubmissionType), submissionType,
                                EnumUtils.ToDescription(EISConfigParams.SubmissionPartnerName), epaPartnerName ?? string.Empty,
                                EnumUtils.ToDescription(EISConfigParams.SubmissionFlowName), _submitFlowName ?? string.Empty,
                                EnumUtils.ToDescription(EISConfigParams.SubmissionOperationName), _submitFlowOperation ?? string.Empty);
        }
Beispiel #3
0
        protected override void LazyInit()
        {
            base.LazyInit();

            GetServiceImplementation(out _partnerManager);

            string epaPartnerName = GetConfigParameter(EnumUtils.ToDescription(ConfigArgsEx.SubmissionPartnerName));

            if (!string.IsNullOrEmpty(epaPartnerName))
            {
                _epaPartnerNode = _partnerManager.GetByName(epaPartnerName);
                if (_epaPartnerNode == null)
                {
                    throw new ArgumentException(string.Format("The node partner \"{0}\" with the name \"{1}\" specified for this service cannot be found",
                                                              EnumUtils.ToDescription(ConfigArgsEx.SubmissionPartnerName), epaPartnerName));
                }
            }
            else
            {
                AppendAuditLogEvent("WARNING: A {0} was not specified, so the generated BEACHES xml file will NOT be submitted, but it will be added to the transaction.",
                                    EnumUtils.ToDescription(ConfigArgsEx.SubmissionPartnerName));
            }
        }
        protected override void LazyInit()
        {
            base.LazyInit();

            GetServiceImplementation(out _partnerManager);
            GetServiceImplementation(out _nodeEndpointClientFactory);

            ParseNaasUserMappingFile();

            string submitPartnerName = null;

            if (TryGetConfigParameter(CONFIG_SUBMISSION_PARTNER_NAME, ref submitPartnerName))
            {
                _submitPartnerNode = _partnerManager.GetByName(submitPartnerName);
                if (_submitPartnerNode == null)
                {
                    throw new ArgumentException(string.Format("A submission partner with the name \"{0}\" specified for this service cannot be found",
                                                              submitPartnerName));
                }
            }
            if (_submitPartnerNode != null)
            {
                if (_naasUsernameToPasswordMap == null)
                {
                    throw new ArgumentException(string.Format("The service specifies a \"{0},\" but does not specify a \"{1}\"",
                                                              CONFIG_SUBMISSION_PARTNER_NAME, CONFIG_NAAS_USER_MAPPING_FILE_PATH));
                }
            }
            else if (_naasUsernameToPasswordMap != null)
            {
                if (_submitPartnerNode == null)
                {
                    throw new ArgumentException(string.Format("The service specifies a \"{0},\" but does not specify a \"{1}\"",
                                                              CONFIG_NAAS_USER_MAPPING_FILE_PATH, CONFIG_SUBMISSION_PARTNER_NAME));
                }
            }
        }