Search in sources :

Example 16 with DataBridgeBaseManifestDto

use of org.finra.herd.model.dto.DataBridgeBaseManifestDto in project herd by FINRAOS.

the class DownloaderWebClient method getS3KeyPrefix.

/**
 * Retrieves S3 key prefix from the herd registration server.
 *
 * @param businessObjectData the business object data
 *
 * @return the S3 key prefix
 * @throws JAXBException if a JAXB error was encountered.
 * @throws IOException if an I/O error was encountered.
 * @throws URISyntaxException if a URI syntax error was encountered.
 */
public S3KeyPrefixInformation getS3KeyPrefix(BusinessObjectData businessObjectData) throws IOException, JAXBException, URISyntaxException {
    DataBridgeBaseManifestDto dataBridgeBaseManifestDto = new DataBridgeBaseManifestDto();
    dataBridgeBaseManifestDto.setNamespace(businessObjectData.getNamespace());
    dataBridgeBaseManifestDto.setBusinessObjectDefinitionName(businessObjectData.getBusinessObjectDefinitionName());
    dataBridgeBaseManifestDto.setBusinessObjectFormatUsage(businessObjectData.getBusinessObjectFormatUsage());
    dataBridgeBaseManifestDto.setBusinessObjectFormatFileType(businessObjectData.getBusinessObjectFormatFileType());
    dataBridgeBaseManifestDto.setBusinessObjectFormatVersion(String.valueOf(businessObjectData.getBusinessObjectFormatVersion()));
    dataBridgeBaseManifestDto.setPartitionKey(businessObjectData.getPartitionKey());
    dataBridgeBaseManifestDto.setPartitionValue(businessObjectData.getPartitionValue());
    dataBridgeBaseManifestDto.setSubPartitionValues(businessObjectData.getSubPartitionValues());
    dataBridgeBaseManifestDto.setStorageName(businessObjectData.getStorageUnits().get(0).getStorage().getName());
    return super.getS3KeyPrefix(dataBridgeBaseManifestDto, businessObjectData.getVersion(), Boolean.FALSE);
}
Also used : DataBridgeBaseManifestDto(org.finra.herd.model.dto.DataBridgeBaseManifestDto)

Aggregations

DataBridgeBaseManifestDto (org.finra.herd.model.dto.DataBridgeBaseManifestDto)16 Test (org.junit.Test)13 AbstractCoreTest (org.finra.herd.core.AbstractCoreTest)4 AwsCredential (org.finra.herd.model.api.xml.AwsCredential)3 BusinessObjectDataUploadCredential (org.finra.herd.model.api.xml.BusinessObjectDataUploadCredential)3 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 File (java.io.File)1 IOException (java.io.IOException)1 S3KeyPrefixInformation (org.finra.herd.model.api.xml.S3KeyPrefixInformation)1