test_class.declarator: dataBridgeWebClient
test_class.modifier: private
test_class.original_string: private DataBridgeWebClient dataBridgeWebClient;
test_class.type: DataBridgeWebClient
test_class.var_name: dataBridgeWebClient
test_class.declarator: herdStringHelper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HerdStringHelper herdStringHelper;
test_class.type: HerdStringHelper
test_class.var_name: herdStringHelper
test_class.declarator: httpClientHelper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HttpClientHelper httpClientHelper;
test_class.type: HttpClientHelper
test_class.var_name: httpClientHelper
test_class.declarator: httpClientOperations
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HttpClientOperations httpClientOperations;
test_class.type: HttpClientOperations
test_class.var_name: httpClientOperations
test_class.declarator: xmlHelper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private XmlHelper xmlHelper;
test_class.type: XmlHelper
test_class.var_name: xmlHelper
test_class.file: herd-code/herd-tools/herd-tools-common/src/test/java/org/finra/herd/tools/common/databridge/DataBridgeWebClientTest.java
test_class.identifier: DataBridgeWebClientTest
test_class.superclass: extends AbstractDataBridgeTest
test_case.body: @Test
      public void testAddStorageFiles() throws Exception
      {
          testAddStorageFiles(false);
      }
test_case.class_method_signature: DataBridgeWebClientTest.testAddStorageFiles()
test_case.full_signature: @Test public void testAddStorageFiles()
test_case.identifier: testAddStorageFiles
test_case.invocations: testAddStorageFiles
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAddStorageFiles()
focal_class.declarator: DEFAULT_ACCEPT = ContentType.APPLICATION_XML.withCharset(StandardCharsets.UTF_8).toString()
focal_class.modifier: protected static final
focal_class.original_string: protected static final String DEFAULT_ACCEPT = ContentType.APPLICATION_XML.withCharset(StandardCharsets.UTF_8).toString();
focal_class.type: String
focal_class.var_name: DEFAULT_ACCEPT
focal_class.declarator: DEFAULT_CONTENT_TYPE = ContentType.APPLICATION_XML.withCharset(StandardCharsets.UTF_8).toString()
focal_class.modifier: protected static final
focal_class.original_string: protected static final String DEFAULT_CONTENT_TYPE = ContentType.APPLICATION_XML.withCharset(StandardCharsets.UTF_8).toString();
focal_class.type: String
focal_class.var_name: DEFAULT_CONTENT_TYPE
focal_class.declarator: HERD_APP_REST_URI_PREFIX = "/herd-app/rest"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String HERD_APP_REST_URI_PREFIX = "/herd-app/rest";
focal_class.type: String
focal_class.var_name: HERD_APP_REST_URI_PREFIX
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DataBridgeWebClient.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DataBridgeWebClient.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: herdStringHelper
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected HerdStringHelper herdStringHelper;
focal_class.type: HerdStringHelper
focal_class.var_name: herdStringHelper
focal_class.declarator: httpClientHelper
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected HttpClientHelper httpClientHelper;
focal_class.type: HttpClientHelper
focal_class.var_name: httpClientHelper
focal_class.declarator: httpClientOperations
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected HttpClientOperations httpClientOperations;
focal_class.type: HttpClientOperations
focal_class.var_name: httpClientOperations
focal_class.declarator: regServerAccessParamsDto
focal_class.modifier: protected
focal_class.original_string: protected RegServerAccessParamsDto regServerAccessParamsDto;
focal_class.type: RegServerAccessParamsDto
focal_class.var_name: regServerAccessParamsDto
focal_class.file: herd-code/herd-tools/herd-tools-common/src/main/java/org/finra/herd/tools/common/databridge/DataBridgeWebClient.java
focal_class.identifier: DataBridgeWebClient
focal_class.class_method_signature: DataBridgeWebClient.addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
focal_class.full_signature: @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") public BusinessObjectDataStorageFilesCreateResponse addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
focal_class.identifier: addStorageFiles
focal_class.modifiers: @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") public
focal_class.parameters: (BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
focal_class.return: BusinessObjectDataStorageFilesCreateResponse
focal_class.signature: BusinessObjectDataStorageFilesCreateResponse addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
focal_class.class_method_signature: DataBridgeWebClient.getRegServerAccessParamsDto()
focal_class.full_signature: public RegServerAccessParamsDto getRegServerAccessParamsDto()
focal_class.identifier: getRegServerAccessParamsDto
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: RegServerAccessParamsDto
focal_class.signature: RegServerAccessParamsDto getRegServerAccessParamsDto()
focal_class.class_method_signature: DataBridgeWebClient.setRegServerAccessParamsDto(RegServerAccessParamsDto regServerAccessParamsDto)
focal_class.full_signature: public void setRegServerAccessParamsDto(RegServerAccessParamsDto regServerAccessParamsDto)
focal_class.identifier: setRegServerAccessParamsDto
focal_class.modifiers: public
focal_class.parameters: (RegServerAccessParamsDto regServerAccessParamsDto)
focal_class.return: void
focal_class.signature: void setRegServerAccessParamsDto(RegServerAccessParamsDto regServerAccessParamsDto)
focal_class.class_method_signature: DataBridgeWebClient.getStorage(String storageName)
focal_class.full_signature: public Storage getStorage(String storageName)
focal_class.identifier: getStorage
focal_class.modifiers: public
focal_class.parameters: (String storageName)
focal_class.return: Storage
focal_class.signature: Storage getStorage(String storageName)
focal_class.class_method_signature: DataBridgeWebClient.preRegisterBusinessObjectData(UploaderInputManifestDto manifest, String storageName, Boolean createNewVersion)
focal_class.full_signature: @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") public BusinessObjectData preRegisterBusinessObjectData(UploaderInputManifestDto manifest, String storageName, Boolean createNewVersion)
focal_class.identifier: preRegisterBusinessObjectData
focal_class.modifiers: @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") public
focal_class.parameters: (UploaderInputManifestDto manifest, String storageName, Boolean createNewVersion)
focal_class.return: BusinessObjectData
focal_class.signature: BusinessObjectData preRegisterBusinessObjectData(UploaderInputManifestDto manifest, String storageName, Boolean createNewVersion)
focal_class.class_method_signature: DataBridgeWebClient.updateBusinessObjectDataStatus(BusinessObjectDataKey businessObjectDataKey, String businessObjectDataStatus)
focal_class.full_signature: public BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(BusinessObjectDataKey businessObjectDataKey, String businessObjectDataStatus)
focal_class.identifier: updateBusinessObjectDataStatus
focal_class.modifiers: public
focal_class.parameters: (BusinessObjectDataKey businessObjectDataKey, String businessObjectDataStatus)
focal_class.return: BusinessObjectDataStatusUpdateResponse
focal_class.signature: BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(BusinessObjectDataKey businessObjectDataKey, String businessObjectDataStatus)
focal_class.class_method_signature: DataBridgeWebClient.getAuthorizationHeader()
focal_class.full_signature: protected BasicHeader getAuthorizationHeader()
focal_class.identifier: getAuthorizationHeader
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: BasicHeader
focal_class.signature: BasicHeader getAuthorizationHeader()
focal_class.class_method_signature: DataBridgeWebClient.getBusinessObjectData(CloseableHttpResponse httpResponse, String actionDescription)
focal_class.full_signature: protected BusinessObjectData getBusinessObjectData(CloseableHttpResponse httpResponse, String actionDescription)
focal_class.identifier: getBusinessObjectData
focal_class.modifiers: protected
focal_class.parameters: (CloseableHttpResponse httpResponse, String actionDescription)
focal_class.return: BusinessObjectData
focal_class.signature: BusinessObjectData getBusinessObjectData(CloseableHttpResponse httpResponse, String actionDescription)
focal_class.class_method_signature: DataBridgeWebClient.getBusinessObjectDataStorageFilesCreateResponse(CloseableHttpResponse httpResponse)
focal_class.full_signature: protected BusinessObjectDataStorageFilesCreateResponse getBusinessObjectDataStorageFilesCreateResponse(CloseableHttpResponse httpResponse)
focal_class.identifier: getBusinessObjectDataStorageFilesCreateResponse
focal_class.modifiers: protected
focal_class.parameters: (CloseableHttpResponse httpResponse)
focal_class.return: BusinessObjectDataStorageFilesCreateResponse
focal_class.signature: BusinessObjectDataStorageFilesCreateResponse getBusinessObjectDataStorageFilesCreateResponse(CloseableHttpResponse httpResponse)
focal_class.class_method_signature: DataBridgeWebClient.getS3KeyPrefix(DataBridgeBaseManifestDto manifest, Integer businessObjectDataVersion, Boolean createNewVersion)
focal_class.full_signature: protected S3KeyPrefixInformation getS3KeyPrefix(DataBridgeBaseManifestDto manifest, Integer businessObjectDataVersion, Boolean createNewVersion)
focal_class.identifier: getS3KeyPrefix
focal_class.modifiers: protected
focal_class.parameters: (DataBridgeBaseManifestDto manifest, Integer businessObjectDataVersion, Boolean createNewVersion)
focal_class.return: S3KeyPrefixInformation
focal_class.signature: S3KeyPrefixInformation getS3KeyPrefix(DataBridgeBaseManifestDto manifest, Integer businessObjectDataVersion, Boolean createNewVersion)
focal_class.class_method_signature: DataBridgeWebClient.getUriScheme()
focal_class.full_signature: protected String getUriScheme()
focal_class.identifier: getUriScheme
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUriScheme()
focal_class.class_method_signature: DataBridgeWebClient.processXmlHttpResponse(CloseableHttpResponse response, String actionDescription, Class<?>... responseClass)
focal_class.full_signature: protected Object processXmlHttpResponse(CloseableHttpResponse response, String actionDescription, Class<?>... responseClass)
focal_class.identifier: processXmlHttpResponse
focal_class.modifiers: protected
focal_class.parameters: (CloseableHttpResponse response, String actionDescription, Class<?>... responseClass)
focal_class.return: Object
focal_class.signature: Object processXmlHttpResponse(CloseableHttpResponse response, String actionDescription, Class<?>... responseClass)
focal_class.class_method_signature: DataBridgeWebClient.getBusinessObjectDataStatusUpdateResponse(CloseableHttpResponse response)
focal_class.full_signature: private BusinessObjectDataStatusUpdateResponse getBusinessObjectDataStatusUpdateResponse(CloseableHttpResponse response)
focal_class.identifier: getBusinessObjectDataStatusUpdateResponse
focal_class.modifiers: private
focal_class.parameters: (CloseableHttpResponse response)
focal_class.return: BusinessObjectDataStatusUpdateResponse
focal_class.signature: BusinessObjectDataStatusUpdateResponse getBusinessObjectDataStatusUpdateResponse(CloseableHttpResponse response)
focal_class.class_method_signature: DataBridgeWebClient.getS3KeyPrefixInformation(CloseableHttpResponse httpResponse)
focal_class.full_signature: private S3KeyPrefixInformation getS3KeyPrefixInformation(CloseableHttpResponse httpResponse)
focal_class.identifier: getS3KeyPrefixInformation
focal_class.modifiers: private
focal_class.parameters: (CloseableHttpResponse httpResponse)
focal_class.return: S3KeyPrefixInformation
focal_class.signature: S3KeyPrefixInformation getS3KeyPrefixInformation(CloseableHttpResponse httpResponse)
focal_class.class_method_signature: DataBridgeWebClient.getStorage(CloseableHttpResponse httpResponse)
focal_class.full_signature: private Storage getStorage(CloseableHttpResponse httpResponse)
focal_class.identifier: getStorage
focal_class.modifiers: private
focal_class.parameters: (CloseableHttpResponse httpResponse)
focal_class.return: Storage
focal_class.signature: Storage getStorage(CloseableHttpResponse httpResponse)
focal_method.body: @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.")
      public BusinessObjectDataStorageFilesCreateResponse addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
          throws IOException, JAXBException, URISyntaxException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException
      {
          LOGGER.info("Adding storage files to the business object data ...");
  
          BusinessObjectDataStorageFilesCreateRequest request = new BusinessObjectDataStorageFilesCreateRequest();
          request.setNamespace(businessObjectDataKey.getNamespace());
          request.setBusinessObjectDefinitionName(businessObjectDataKey.getBusinessObjectDefinitionName());
          request.setBusinessObjectFormatUsage(businessObjectDataKey.getBusinessObjectFormatUsage());
          request.setBusinessObjectFormatFileType(businessObjectDataKey.getBusinessObjectFormatFileType());
          request.setBusinessObjectFormatVersion(businessObjectDataKey.getBusinessObjectFormatVersion());
          request.setPartitionValue(businessObjectDataKey.getPartitionValue());
          request.setSubPartitionValues(businessObjectDataKey.getSubPartitionValues());
          request.setBusinessObjectDataVersion(businessObjectDataKey.getBusinessObjectDataVersion());
          request.setStorageName(storageName);
  
          List<StorageFile> storageFiles = new ArrayList<>();
          request.setStorageFiles(storageFiles);
  
          String localPath = s3FileTransferRequestParamsDto.getLocalPath();
          String s3KeyPrefix = s3FileTransferRequestParamsDto.getS3KeyPrefix();
          List<ManifestFile> localFiles = manifest.getManifestFiles();
  
          for (ManifestFile manifestFile : localFiles)
          {
              StorageFile storageFile = new StorageFile();
              storageFiles.add(storageFile);
              // Since the S3 key prefix represents a directory it is expected to contain a trailing '/' character.
              storageFile.setFilePath((s3KeyPrefix + manifestFile.getFileName()).replaceAll("\\\\", "/"));
              storageFile.setFileSizeBytes(Paths.get(localPath, manifestFile.getFileName()).toFile().length());
              storageFile.setRowCount(manifestFile.getRowCount());
          }
  
          // Create a JAXB context and marshaller
          JAXBContext requestContext = JAXBContext.newInstance(BusinessObjectDataStorageFilesCreateRequest.class);
          Marshaller requestMarshaller = requestContext.createMarshaller();
          requestMarshaller.setProperty(Marshaller.JAXB_ENCODING, StandardCharsets.UTF_8.name());
          requestMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
  
          StringWriter sw = new StringWriter();
          requestMarshaller.marshal(request, sw);
  
          BusinessObjectDataStorageFilesCreateResponse businessObjectDataStorageFilesCreateResponse;
          try (CloseableHttpClient client = httpClientHelper
              .createHttpClient(regServerAccessParamsDto.isTrustSelfSignedCertificate(), regServerAccessParamsDto.isDisableHostnameVerification()))
          {
              URI uri = new URIBuilder().setScheme(getUriScheme()).setHost(regServerAccessParamsDto.getRegServerHost())
                  .setPort(regServerAccessParamsDto.getRegServerPort()).setPath(HERD_APP_REST_URI_PREFIX + "/businessObjectDataStorageFiles").build();
              HttpPost post = new HttpPost(uri);
  
              post.addHeader("Content-Type", DEFAULT_CONTENT_TYPE);
              post.addHeader("Accepts", DEFAULT_ACCEPT);
  
              // If SSL is enabled, set the client authentication header.
              if (regServerAccessParamsDto.isUseSsl())
              {
                  post.addHeader(getAuthorizationHeader());
              }
  
              post.setEntity(new StringEntity(sw.toString()));
  
              LOGGER.info(String.format("    HTTP POST URI: %s", post.getURI().toString()));
              LOGGER.info(String.format("    HTTP POST Entity Content:%n%s", sw.toString()));
  
              // getBusinessObjectDataStorageFilesCreateResponse() might return a null. That happens when the web client gets status code 200 back from
              // the service (add storage files is a success), but it fails to retrieve or deserialize the actual HTTP response.
              // Please note that processXmlHttpResponse() is responsible for logging the exception info as a warning.
              businessObjectDataStorageFilesCreateResponse = getBusinessObjectDataStorageFilesCreateResponse(httpClientOperations.execute(client, post));
          }
  
          LOGGER.info("Successfully added storage files to the registered business object data.");
  
          return businessObjectDataStorageFilesCreateResponse;
      }
focal_method.class_method_signature: DataBridgeWebClient.addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
focal_method.full_signature: @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") public BusinessObjectDataStorageFilesCreateResponse addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
focal_method.identifier: addStorageFiles
focal_method.invocations: info setNamespace getNamespace setBusinessObjectDefinitionName getBusinessObjectDefinitionName setBusinessObjectFormatUsage getBusinessObjectFormatUsage setBusinessObjectFormatFileType getBusinessObjectFormatFileType setBusinessObjectFormatVersion getBusinessObjectFormatVersion setPartitionValue getPartitionValue setSubPartitionValues getSubPartitionValues setBusinessObjectDataVersion getBusinessObjectDataVersion setStorageName setStorageFiles getLocalPath getS3KeyPrefix getManifestFiles add setFilePath replaceAll getFileName setFileSizeBytes length toFile get getFileName setRowCount getRowCount newInstance createMarshaller setProperty name setProperty marshal createHttpClient isTrustSelfSignedCertificate isDisableHostnameVerification build setPath setPort setHost setScheme getUriScheme getRegServerHost getRegServerPort addHeader addHeader isUseSsl addHeader getAuthorizationHeader setEntity toString info format toString getURI info format toString getBusinessObjectDataStorageFilesCreateResponse execute info
focal_method.modifiers: @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") public
focal_method.parameters: (BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)
focal_method.return: BusinessObjectDataStorageFilesCreateResponse
focal_method.signature: BusinessObjectDataStorageFilesCreateResponse addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
          S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName)