public DownloadAndImportRCRAInfoData() { ConfigurationArguments.Add(CONFIG_MAX_CHECK_DAYS, null); ConfigurationArguments.Add(CONFIG_STORED_PROC_NAME, null); ConfigurationArguments.Add(CONFIG_STORED_PROC_TIMEOUT, null); ConfigurationArguments.Add(CONFIG_DELETE_DATA_BEFORE_INSERT, null); DataProviders.Add(DATA_DESTINATION, null); }
public BasePerformWQXSubmission() { _useSubmissionHistoryTable = true; // By default ConfigurationArguments.Add(CONFIG_ADD_HEADER, null); ConfigurationArguments.Add(CONFIG_AUTHOR, null); ConfigurationArguments.Add(CONFIG_ORGANIZATION, null); ConfigurationArguments.Add(CONFIG_CONTACT_INFO, null); ConfigurationArguments.Add(CONFIG_TITLE, null); }
public AQSBaseHeaderPlugin() { ConfigurationArguments.Add(CONFIG_PARAM_ADD_HEADER, null); ConfigurationArguments.Add(CONFIG_PARAM_AUTHOR, null); ConfigurationArguments.Add(CONFIG_PARAM_ORGANIZATION, null); ConfigurationArguments.Add(CONFIG_PARAM_AQS_USER_ID, null); ConfigurationArguments.Add(CONFIG_PARAM_SENDER_ADDRESS, null); ConfigurationArguments.Add(CONFIG_PARAM_AQS_SCREENING_GROUP, null); ConfigurationArguments.Add(CONFIG_PARAM_AQS_FINAL_PROCESSING_STEP, null); ConfigurationArguments.Add(CONFIG_PARAM_AQS_STOP_ON_ERROR, null); }
public WQXFlatFileSubmissionProcessor() { ConfigurationArguments.Add(CONFIG_ORG_ID, null); ConfigurationArguments.Add(CONFIG_ORG_NAME, null); ConfigurationArguments.Add(CONFIG_STORED_PROC_NAME, null); ConfigurationArguments.Add(CONFIG_STORED_PROC_TIMEOUT, null); ConfigurationArguments.Add(CONFIG_LOOKUP_TABLES_FILE_PATH, null); DataProviders.Add(DATA_SOURCE_STORED_PROC, null); _deleteExistingDataBeforeInsert = false; }
public void PrepareSimulation(ConfigurationArguments arguments) { IsBusy = true; Task.Factory.StartNew(() => SimulatorWrapper.PrepareSimulation(arguments)).ContinueWith(taskResult => { IsBusy = false; NotifyOfPropertyChange(() => CanRunSimulation); if (taskResult.Exception != null) { throw taskResult.Exception; } }, TaskScheduler.FromCurrentSynchronizationContext()); }
public NodeProxy() { //Load Parameters foreach (string arg in EnumUtils.GetAllDescriptions <ServiceParameterType>()) { ConfigurationArguments.Add(arg, null); } //Load Data Sources foreach (string arg in Enum.GetNames(typeof(DataProviderParameterType))) { DataProviders.Add(arg, null); } }
public HEREBaseService() { //Load Parameters foreach (string arg in Enum.GetNames(typeof(HERERunTimeArgs))) { ConfigurationArguments.Add(arg.ToString(), null); } //Load Data Sources foreach (string arg in Enum.GetNames(typeof(DataSourceParameterType))) { DataProviders.Add(arg.ToString(), null); } }
public BasePerformRCRASubmission() { _useSubmissionHistoryTable = true; // By default ConfigurationArguments.Add(CONFIG_ADD_HEADER, null); ConfigurationArguments.Add(CONFIG_AUTHOR, null); ConfigurationArguments.Add(CONFIG_ORGANIZATION, null); ConfigurationArguments.Add(CONFIG_CONTACT_INFO, null); ConfigurationArguments.Add(CONFIG_NOTIFICATIONS, null); ConfigurationArguments.Add(CONFIG_PAYLOAD_OPERATION, null); ConfigurationArguments.Add(CONFIG_TITLE, null); ConfigurationArguments.Add(CONFIG_RCRA_INFO_USER_ID, null); ConfigurationArguments.Add(CONFIG_RCRA_INFO_STATE_CODE, null); ConfigurationArguments.Add(CONFIG_NAAS_USER_MAPPING_FILE_PATH, null); ConfigurationArguments.Add(CONFIG_SUBMISSION_PARTNER_NAME, null); ConfigurationArguments.Add(CONFIG_VALIDATE_XML, null); }
public RCRABaseSolicitProcessor() { ConfigurationArguments.Add(CONFIG_ADD_HEADER, null); ConfigurationArguments.Add(CONFIG_AUTHOR, null); ConfigurationArguments.Add(CONFIG_ORGANIZATION, null); ConfigurationArguments.Add(CONFIG_CONTACT_INFO, null); ConfigurationArguments.Add(CONFIG_NOTIFICATIONS, null); ConfigurationArguments.Add(CONFIG_PAYLOAD_OPERATION, null); ConfigurationArguments.Add(CONFIG_TITLE, null); ConfigurationArguments.Add(CONFIG_RCRA_INFO_USER_ID, null); ConfigurationArguments.Add(CONFIG_RCRA_INFO_STATE_CODE, null); ConfigurationArguments.Add(CONFIG_NAAS_USER_MAPPING_FILE_PATH, null); ConfigurationArguments.Add(CONFIG_SUBMISSION_PARTNER_NAME, null); ConfigurationArguments.Add(CONFIG_VALIDATE_XML, null); //Load Data Sources foreach (string arg in Enum.GetNames(typeof(DataProviderParameterType))) { DataProviders.Add(arg, null); } }
public SdwisSubmissionRelayProcessor() { //Load Parameters ConfigurationArguments.Add(SdwisRelayServiceParameterType.SubmitEndpointUri.ToString(), "https://cdxnode.epa.gov/cdx/services/NetworkNodePortType_V10"); ConfigurationArguments.Add(SdwisRelayServiceParameterType.SubmitUsername.ToString(), null); ConfigurationArguments.Add(SdwisRelayServiceParameterType.SubmitPassword.ToString(), null); ConfigurationArguments.Add(SdwisRelayServiceParameterType.HereEndpointUri.ToString(), null); ConfigurationArguments.Add(SdwisRelayServiceParameterType.HereIsFacilitySource.ToString(), null); ConfigurationArguments.Add(SdwisRelayServiceParameterType.HereSourceSystemName.ToString(), null); ConfigurationArguments.Add(SdwisRelayServiceParameterType.HereFileNameFilter.ToString(), null); //Load Data Sources DataProviders.Add(SdwisRelayServiceDataSourceType.HereDataSource.ToString(), null); }
/// <summary> /// ProcessSubmit /// </summary> public void ProcessSubmit(string transactionId) { ITransactionManager transactionManager; ISettingsProvider settingsProvider; IDocumentManager documentManager; AppendAuditLogEvent("Enter CopySubmitFilesToFolder.ProcessSubmit({0})", transactionId); GetServiceImplementation(out transactionManager); GetServiceImplementation(out settingsProvider); GetServiceImplementation(out documentManager); string destinationFolderPath; if (!ConfigurationArguments.TryGetValue(DESTINATION_FOLDER_PATH, out destinationFolderPath)) { throw new ArgumentException("DESTINATION_FOLDER_PATH configuration key not set"); } if (!Directory.Exists(destinationFolderPath)) { throw new DirectoryNotFoundException(string.Format("DESTINATION_FOLDER_PATH does not exist: {0}", destinationFolderPath)); } bool createUsernameSubfolder = false; { string usernameSubfolder; if (ConfigurationArguments.TryGetValue(USE_USERNAME_SUBFOLDER, out usernameSubfolder) && !string.IsNullOrEmpty(usernameSubfolder)) { try { createUsernameSubfolder = bool.Parse(usernameSubfolder); } catch (Exception) { throw new FormatException(string.Format("Could not parse USE_USERNAME_SUBFOLDER true/false value: {0}", usernameSubfolder)); } } } if (createUsernameSubfolder) { string username = transactionManager.GetTransactionUsername(transactionId); if (string.IsNullOrEmpty(username)) { throw new ArgumentException(string.Format("Could not username for transaction: {0}", transactionId)); } username = FileUtils.ReplaceInvalidFilenameChars(username, '_'); destinationFolderPath = Path.Combine(destinationFolderPath, username); } AppendAuditLogEvent("DESTINATION_FOLDER_PATH: \"{0}\"", destinationFolderPath); IList <string> dbDocIds = transactionManager.GetAllUnprocessedDocumentDbIds(transactionId); if (!CollectionUtils.IsNullOrEmpty(dbDocIds)) { if (!Directory.Exists(destinationFolderPath)) { Directory.CreateDirectory(destinationFolderPath); AppendAuditLogEvent("Created folder DESTINATION_FOLDER_PATH: \"{0}\"", destinationFolderPath); } foreach (string dbDocId in dbDocIds) { Document document = documentManager.GetDocument(transactionId, dbDocId, true); string docName; if (!string.IsNullOrEmpty(document.DocumentName)) { docName = document.DocumentName; } else if (!string.IsNullOrEmpty(document.DocumentId)) { docName = document.DocumentName; } else { docName = dbDocId; } docName = FileUtils.ReplaceInvalidFilenameChars(docName, '_'); docName = Path.ChangeExtension(docName, CommonContentAndFormatProvider.GetFileExtension(document.Type)); string copyPath = FileUtils.MakeUniqueIncrementalFilePath(destinationFolderPath, docName); File.WriteAllBytes(copyPath, document.Content); AppendAuditLogEvent("Copied file \"{0}\"", copyPath); documentManager.SetDocumentStatus(transactionId, dbDocId, CommonTransactionStatusCode.Processed, "Processed " + dbDocId); } } AppendAuditLogEvent("Exit CopySubmitFilesToFolder.ProcessSubmit({0})", transactionId); }
public SolicitRCRAInfoData() { ConfigurationArguments.Add(CONFIG_PARTNER_NAME_KEY, null); ConfigurationArguments.Add(CONFIG_ENDPOINT_USER_NAME_KEY, null); }
/// <summary> /// Responsible for processing all FRS services /// </summary> public CopySubmitFilesToFolder() { ConfigurationArguments.Add(DESTINATION_FOLDER_PATH, null); ConfigurationArguments.Add(USE_USERNAME_SUBFOLDER, null); }
protected SubmitProxyPluginEx() { ConfigurationArguments.Add(CONFIG_CHECK_STATUS_NUM_DAYS, null); ConfigurationArguments.Add(CONFIG_CHECK_STATUS_INTERVAL, null); }
public GetEISSubmission() { ConfigurationArguments.Add(CONFIG_SOURCE_DATABASE_PATH, null); ConfigurationArguments.Add(CONFIG_DELETE_DATABASE_ON_SUCCESS, null); ConfigurationArguments.Add(CONFIG_EIS_DATA_CATEGORY, null); }
public TRICopySubmissionXml() { ConfigurationArguments.Add(CONFIG_XML_STORED_PROC_NAME, null); AppendDataProviders <TRIDataSourceParams>(); }
public GetAQSRawDataInsertByDate() { ConfigurationArguments.Add(CONFIG_NAAS_USER_MAPPING_FILE_PATH, null); ConfigurationArguments.Add(CONFIG_SUBMISSION_PARTNER_NAME, null); }
public WQXSubmissionProcessor() { ConfigurationArguments.Add(CONFIG_DELETE_DATA_BEFORE_INSERT, null); DataProviders.Add(DESTINATION_PROVIDER_KEY, null); }
public UpdateStatusOfNetworkTransactions() { ConfigurationArguments.Add(CHECK_NEWER_THAN_DAYS_KEY, "7"); ConfigurationArguments.Add(CHECK_FLOW_NAMES, ""); }
/// <summary> /// Responsible for processing all FRS services /// </summary> public SolicitFilesFromFolder() { ConfigurationArguments.Add(SOURCE_FOLDER_PATH, null); }
public MapForceBridge() { ConfigurationArguments.Add(CONFIG_CONNECTION_STRING, null); }
/// <summary> /// Responsible for processing all FRS services /// </summary> public CleanTemporaryFolder() { ConfigurationArguments.Add(DELETE_OLDER_THAN_DAYS_KEY, null); }
public GetAssessments() { DataProviders.Add(SOURCE_PROVIDER_KEY, null); ConfigurationArguments.Add(CONFIG_COMPRESS_RESULTS, null); }
public RCRABaseSubmissionProcessor() { ConfigurationArguments.Add(CONFIG_DELETE_DATA_BEFORE_INSERT, null); AppendDataProviders <RCRADataDestinationParams>(); }
public WQXGetStatus() { ConfigurationArguments.Clear(); ConfigurationArguments.Add(CONFIG_EPA_PARTNER_NAME_KEY, null); }
public GetAQSXmlData() { ConfigurationArguments.Add(CONFIG_WEB_SERVICE_URL, null); ConfigurationArguments.Add(CONFIG_WEB_SERVICE_TIMEOUT, null); }
/// <summary> /// ProcessSolicit /// </summary> public void ProcessSolicit(string requestId) { IDocumentManager documentManager; IRequestManager requestManager; AppendAuditLogEvent("Enter SolicitFilesFromFolder.ProcessSolicit({0})", requestId); GetServiceImplementation(out requestManager); GetServiceImplementation(out documentManager); string sourceFolderPath; if (!ConfigurationArguments.TryGetValue(SOURCE_FOLDER_PATH, out sourceFolderPath)) { throw new ArgumentException("SOURCE_FOLDER_PATH configuration key not set"); } if (!Directory.Exists(sourceFolderPath)) { throw new DirectoryNotFoundException(string.Format("SOURCE_FOLDER_PATH does not exist: {0}", sourceFolderPath)); } DataRequest dataRequest = requestManager.GetDataRequest(requestId); int docCount = 1; DateTime docsNewerThan = DateTime.MinValue; string stateId = null; if (dataRequest.Parameters.IsByName) { TryGetParameterByName(dataRequest, PARAM_STATE_ID, ref stateId); TryGetParameterByName(dataRequest, PARAM_DOCUMENT_COUNT, ref docCount); TryGetParameterByName(dataRequest, PARAM_DOCUMENTS_NEWER_THAN, ref docsNewerThan); } else { TryGetParameterByIndex(dataRequest, 0, ref stateId); TryGetParameterByIndex(dataRequest, 1, ref docCount); TryGetParameterByIndex(dataRequest, 2, ref docsNewerThan); } if (!string.IsNullOrEmpty(stateId)) { sourceFolderPath = Path.Combine(sourceFolderPath, stateId); if (!Directory.Exists(sourceFolderPath)) { throw new DirectoryNotFoundException(string.Format("State folder path does not exist: {0}", stateId)); } } if (docCount < 0) { throw new ArgumentException("Invalid document count specified: {0}", docCount.ToString()); } if (docsNewerThan > DateTime.Now.AddHours(2)) { throw new ArgumentException("Invalid documents-newer-than date specified: {0}", docsNewerThan.ToString()); } AppendAuditLogEvent("PARAM_DOCUMENT_COUNT ({0}), PARAM_DOCUMENTS_NEWER_THAN ({1})", docCount.ToString(), docsNewerThan.ToString()); List <KeyValuePair <string, DateTime> > docPaths = new List <KeyValuePair <string, DateTime> >(); using (FileSystemEnumerator enumerator = new FileSystemEnumerator(sourceFolderPath, "*", false, FileSystemEnumerator.EReturnTypes.eReturnFiles)) { foreach (string path in enumerator) { // Check date DateTime fileTime = File.GetLastWriteTime(path); if (fileTime > docsNewerThan) { docPaths.Add(new KeyValuePair <string, DateTime>(path, fileTime)); } } if (docPaths.Count > 0) { docPaths.Sort(delegate(KeyValuePair <string, DateTime> x, KeyValuePair <string, DateTime> y) { return(y.Value.CompareTo(x.Value)); }); if (docPaths.Count > docCount) { if (docCount > 0) { // Only return the # requested docPaths.RemoveRange(docCount, docPaths.Count - docCount); } } } } if (docPaths.Count > 0) { AppendAuditLogEvent("Found {0} document(s) to add to solicit request", docPaths.Count.ToString()); documentManager.AddDocument(dataRequest.TransactionId, CommonTransactionStatusCode.Processed, string.Empty, GetSolictZipFile(docPaths)); } else { AppendAuditLogEvent("Didn't find any documents to add to solicit request"); } AppendAuditLogEvent("Exit SolicitFilesFromFolder.ProcessSolicit({0})", requestId); }
public WQXBaseAuthorizationPlugin() { ConfigurationArguments.Add(AUTHORIZATION_FILE_PATH_KEY, null); }
/// <summary> /// ProcessTask /// </summary> /// <param name="requestId"></param> /// <returns></returns> public void ProcessTask(string requestId) { IRequestManager requestManager; ISettingsProvider settingsProvider; GetServiceImplementation(out requestManager); GetServiceImplementation(out settingsProvider); string tempFolderPath = settingsProvider.TempFolderPath; if (!Directory.Exists(tempFolderPath)) { throw new DirectoryNotFoundException(string.Format("The node temporary folder does not exist: {0}", tempFolderPath)); } int deleteOlderThanDays; if (!ConfigurationArguments.ContainsKey(DELETE_OLDER_THAN_DAYS_KEY)) { throw new ArgumentException("DELETE_OLDER_THAN_DAYS_KEY configuration key not set"); } if (!int.TryParse(ConfigurationArguments[DELETE_OLDER_THAN_DAYS_KEY], out deleteOlderThanDays) || (deleteOlderThanDays < 1)) { throw new ArgumentException(string.Format("DELETE_OLDER_THAN_DAYS_KEY value is not valid: {0}", deleteOlderThanDays)); } DateTime deleteFilesOlderThan = DateTime.Now - TimeSpan.FromDays(deleteOlderThanDays); AppendAuditLogEvent("Deleting all files older than {0} from the temporary folder: \"{1}\"", deleteFilesOlderThan, tempFolderPath); int deleteFileCount = FileUtils.DeleteAllFilesOlderThan(tempFolderPath, deleteFilesOlderThan, true, false); if (deleteFileCount > 0) { AppendAuditLogEvent("Deleted {0} temporary file(s)", deleteFileCount.ToString("N0")); } else { AppendAuditLogEvent("Didn't find any temporary files to delete"); } AppendAuditLogEvent("Deleting all empty folders older than {0} from the temporary folder: \"{1}\"", deleteFilesOlderThan, tempFolderPath); int deleteFolderCount = FileUtils.DeleteAllEmptyFoldersOlderThan(tempFolderPath, deleteFilesOlderThan, false); if (deleteFolderCount > 0) { AppendAuditLogEvent("Deleted {0} empty temporary folder(s)", deleteFolderCount.ToString("N0")); } else { AppendAuditLogEvent("Didn't find any empty temporary folders to delete"); } string logsFolderPath = settingsProvider.LogsFolderPath; if (!Directory.Exists(logsFolderPath)) { AppendAuditLogEvent("The node Logs folder does not exist: {0}", logsFolderPath); } else { deleteFileCount = FileUtils.DeleteAllFilesOlderThan(logsFolderPath, deleteFilesOlderThan, true, false); if (deleteFileCount > 0) { AppendAuditLogEvent("Deleted {0} log file(s)", deleteFileCount.ToString("N0")); } else { AppendAuditLogEvent("Didn't find any log files to delete"); } } }
public AQSExtractAndSubmission() { ConfigurationArguments.Add(CONFIG_EXTRACT_STORED_PROCEDURE_NAME, null); ConfigurationArguments.Add(CONFIG_EXTRACT_TIMEOUT, null); }