use of org.finra.herd.model.dto.RegServerAccessParamsDto in project herd by FINRAOS.
the class AbstractRetentionExpirationDestroyerTest method setupEnv.
/**
* Sets up the test environment.
*/
@Before
public void setupEnv() throws IOException {
super.setupEnv();
// Initialize the uploader web client instance.
RegServerAccessParamsDto regServerAccessParamsDto = RegServerAccessParamsDto.builder().withRegServerHost(WEB_SERVICE_HOSTNAME).withRegServerPort(WEB_SERVICE_HTTPS_PORT).withUseSsl(true).withUsername(WEB_SERVICE_HTTPS_USERNAME).withPassword(WEB_SERVICE_HTTPS_PASSWORD).build();
retentionExpirationDestroyerWebClient.setRegServerAccessParamsDto(regServerAccessParamsDto);
}
use of org.finra.herd.model.dto.RegServerAccessParamsDto in project herd by FINRAOS.
the class RetentionExpirationDestroyerControllerTest method testPerformRetentionExpirationDestruction.
@Test
public void testPerformRetentionExpirationDestruction() throws Exception {
// Create a local input CSV file.
File inputCsvFile = createLocalInputCsvFile();
// Create and initialize the registration server DTO.
RegServerAccessParamsDto regServerAccessParamsDto = RegServerAccessParamsDto.builder().withRegServerHost(WEB_SERVICE_HOSTNAME).withRegServerPort(WEB_SERVICE_HTTPS_PORT).withUseSsl(true).withUsername(WEB_SERVICE_HTTPS_USERNAME).withPassword(WEB_SERVICE_HTTPS_PASSWORD).build();
// Perform the retention expiration destruction.
retentionExpirationDestroyerController.performRetentionExpirationDestruction(inputCsvFile, regServerAccessParamsDto);
}
use of org.finra.herd.model.dto.RegServerAccessParamsDto in project herd by FINRAOS.
the class DownloaderApp method go.
/**
* Parses the command line arguments and calls the controller to process the download.
*
* @param args the command line arguments passed to the program.
*
* @return the return value of the application.
* @throws Exception if there are problems performing the download.
*/
@Override
public ReturnValue go(String[] args) throws Exception {
// Create the Spring application context.
ApplicationContext applicationContext = createApplicationContext();
// Parse the command line arguments and return a return value if we shouldn't continue processing (e.g. we displayed usage information, etc.).
ReturnValue returnValue = parseCommandLineArguments(args, applicationContext);
if (returnValue != null) {
return returnValue;
}
// Create an instance of S3 file transfer request parameters DTO.
S3FileTransferRequestParamsDto params = S3FileTransferRequestParamsDto.builder().withLocalPath(argParser.getStringValue(localPathOpt)).withAwsAccessKeyId(argParser.getStringValue(s3AccessKeyOpt)).withAwsSecretKey(argParser.getStringValue(s3SecretKeyOpt)).withS3Endpoint(argParser.getStringValue(s3EndpointOpt)).withMaxThreads(maxThreads).withHttpProxyHost(argParser.getStringValue(httpProxyHostOpt)).withHttpProxyPort(httpProxyPort).withSocketTimeout(argParser.getIntegerValue(socketTimeoutOpt)).build();
// Call the controller with the user specified parameters to perform the download.
DownloaderController controller = applicationContext.getBean(DownloaderController.class);
RegServerAccessParamsDto regServerAccessParamsDto = RegServerAccessParamsDto.builder().withRegServerHost(regServerHost).withRegServerPort(regServerPort).withUseSsl(useSsl).withUsername(argParser.getStringValue(usernameOpt)).withPassword(argParser.getStringValue(passwordOpt)).build();
controller.performDownload(regServerAccessParamsDto, argParser.getFileValue(manifestPathOpt), params);
// No exceptions were returned so return success.
return ReturnValue.SUCCESS;
}
use of org.finra.herd.model.dto.RegServerAccessParamsDto in project herd by FINRAOS.
the class RetentionExpirationExporterApp method go.
/**
* Runs the application by parsing the command line arguments and calling the controller to export business object data that passed its relative retention
* expiration. This is the main entry into the application class itself and is typically called from a main method.
*
* @param args the command line arguments passed to the program
*
* @return the return value of the application
* @throws Exception if any problems were encountered
*/
ToolsCommonConstants.ReturnValue go(String[] args) throws Exception {
// Create the Spring application context.
ApplicationContext applicationContext = createApplicationContext();
// Parse the command line arguments and return a return value if we shouldn't continue processing (e.g. we displayed usage information, etc.).
ToolsCommonConstants.ReturnValue returnValue = parseCommandLineArguments(args, applicationContext);
if (returnValue != null) {
return returnValue;
}
// Create a DTO to communicate with herd registration server.
RegServerAccessParamsDto regServerAccessParamsDto = RegServerAccessParamsDto.builder().withRegServerHost(argParser.getStringValue(regServerHostOpt)).withRegServerPort(regServerPort).withUseSsl(useSsl).withUsername(argParser.getStringValue(usernameOpt)).withPassword(argParser.getStringValue(passwordOpt)).build();
// Call the controller with the user specified parameters to perform the upload.
RetentionExpirationExporterController controller = applicationContext.getBean(RetentionExpirationExporterController.class);
controller.performRetentionExpirationExport(argParser.getStringValue(namespaceOpt), argParser.getStringValue(businessObjectDefinitionNameOpt), argParser.getFileValue(localOutputFileOpt), regServerAccessParamsDto, argParser.getStringValue(udcServerHostOpt));
// No exceptions were returned so return success.
return ToolsCommonConstants.ReturnValue.SUCCESS;
}
Aggregations