/** * Returns a list of AZ's which the given list of subnets belong to. * * @param subnets the list of subnets in the AZ * @param awsParamsDto the AWS related parameters for access/secret keys and proxy details * * @return the list of AZ's */ private List<AvailabilityZone> getAvailabilityZones(List<Subnet> subnets, AwsParamsDto awsParamsDto) { return ec2Dao.getAvailabilityZonesForSubnetIds(subnets, awsParamsDto); }
@Override public List<S3ObjectSummary> listDirectory(S3FileTransferRequestParamsDto params, boolean ignoreZeroByteDirectoryMarkers) { return s3Dao.listDirectory(params, ignoreZeroByteDirectoryMarkers); }
@Override public void restoreObjects(final S3FileTransferRequestParamsDto params, int expirationInDays) { s3Dao.restoreObjects(params, expirationInDays); }
/** * Cleans up the S3 test path that we are using. */ @After public void cleanEnv() throws IOException { // Clean up the destination S3 folder. s3Dao.deleteDirectory(s3DaoTestHelper.getTestS3FileTransferRequestParamsDto()); s3Operations.rollback(); }
/** * Creates relative database entities required for the business object data availability service unit tests. * * @param partitionKeyGroupName the name of the partition key group */ public void createDatabaseEntitiesForBusinessObjectDataAvailabilityTesting(String partitionKeyGroupName) { createDatabaseEntitiesForBusinessObjectDataAvailabilityTesting(partitionKeyGroupName, schemaColumnDaoTestHelper.getTestSchemaColumns(), schemaColumnDaoTestHelper.getTestPartitionColumns(), BusinessObjectDataEntity.FIRST_PARTITION_COLUMN_POSITION, AbstractDaoTest.NO_SUBPARTITION_VALUES, AbstractDaoTest.ALLOW_DUPLICATE_BUSINESS_OBJECT_DATA); }
/** * Deletes a search index if it exists. * * @param searchIndexName the name of the search index */ protected void deleteSearchIndexHelper(String searchIndexName) { if (indexFunctionsDao.isIndexExists(searchIndexName)) { indexFunctionsDao.deleteIndex(searchIndexName); } }
private void createDatabaseEntitiesForStorageFilesTesting() { // Create relative database entities. StorageUnitEntity storageUnitEntity = storageUnitDaoTestHelper .createStorageUnitEntity(StorageEntity.MANAGED_STORAGE, NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INITIAL_FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, INITIAL_DATA_VERSION, true, BDATA_STATUS, STORAGE_UNIT_STATUS, NO_STORAGE_DIRECTORY_PATH); for (String file : LOCAL_FILES) { storageFileDaoTestHelper.createStorageFileEntity(storageUnitEntity, file, FILE_SIZE_1_KB, ROW_COUNT_1000); } } }
/** * Create and persist database entities required for testing. * * @param namespaceCode the namespace code * @param dataProviderName the data provider name */ public void createDatabaseEntitiesForBusinessObjectDefinitionTesting(String namespaceCode, String dataProviderName) { // Create a namespace entity. namespaceDaoTestHelper.createNamespaceEntity(namespaceCode); // Create a data provider entity. dataProviderDaoTestHelper.createDataProviderEntity(dataProviderName); }
/** * Creates database entities required for the tag search service unit tests. */ private void createDatabaseEntitiesForTagSearchTesting() { // Create and persist a tag type entity. TagTypeEntity tagTypeEntity = tagTypeDaoTestHelper.createTagTypeEntity(TAG_TYPE, TAG_TYPE_DISPLAY_NAME, TAG_TYPE_ORDER, TAG_TYPE_DESCRIPTION); // Create a root tag entity for the tag type. TagEntity rootTagEntity = tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE, TAG_DISPLAY_NAME, TAG_SEARCH_SCORE_MULTIPLIER, TAG_DESCRIPTION); // Create two children for the root tag with tag display name in reverse order. tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE_2, TAG_DISPLAY_NAME_3, TAG_SEARCH_SCORE_MULTIPLIER_2, TAG_DESCRIPTION_2, rootTagEntity); tagDaoTestHelper.createTagEntity(tagTypeEntity, TAG_CODE_3, TAG_DISPLAY_NAME_2, TAG_SEARCH_SCORE_MULTIPLIER_3, TAG_DESCRIPTION_3, rootTagEntity); } }
/** * Creates and persists a new storage entity with a random name and no attributes. * * @return the newly created storage entity. */ public StorageEntity createStorageEntity() { return createStorageEntity("StorageTest" + AbstractDaoTest.getRandomSuffix()); }
@Override public S3FileTransferResultsDto uploadDirectory(S3FileTransferRequestParamsDto params) throws InterruptedException { return s3Dao.uploadDirectory(params); }
@Override public S3FileTransferResultsDto downloadDirectory(S3FileTransferRequestParamsDto params) throws InterruptedException { return s3Dao.downloadDirectory(params); }
@Override public S3FileTransferResultsDto uploadFile(S3FileTransferRequestParamsDto params) throws InterruptedException { return s3Dao.uploadFile(params); }
@Override public void createDirectory(S3FileTransferRequestParamsDto params) { s3Dao.createDirectory(params); }
@Override public S3FileTransferResultsDto uploadFileList(S3FileTransferRequestParamsDto params) throws InterruptedException { return s3Dao.uploadFileList(params); }
/** * Creates and persists a new file type entity. * * @return the newly created file type entity. */ public FileTypeEntity createFileTypeEntity() { String randomNumber = AbstractDaoTest.getRandomSuffix(); return createFileTypeEntity("FileType" + randomNumber, "File Type " + randomNumber); }
/** * Creates and persists a new data provider entity. * * @return the newly created data provider entity. */ public DataProviderEntity createDataProviderEntity() { return createDataProviderEntity("DataProviderTest" + AbstractDaoTest.getRandomSuffix()); } }
/** * Creates and persists a new namespace entity. * * @return the newly created namespace entity. */ public NamespaceEntity createNamespaceEntity() { return createNamespaceEntity("NamespaceTest" + AbstractDaoTest.getRandomSuffix()); }
/** * Delegates to {@link JdbcOperations#update(JdbcTemplate, String)} */ @Override public int update(JdbcTemplate jdbcTemplate, String sql) { return jdbcOperations.update(jdbcTemplate, sql); }
/** * Creates and persists a new storage entity with a random name with the specified attributes. * * @param attributeName the attribute name. * @param attributeValue the attribute value. * * @return the newly created storage entity. */ public StorageEntity createStorageEntityWithAttributes(String attributeName, String attributeValue) { return createStorageEntity("StorageTest" + AbstractDaoTest.getRandomSuffix(), StoragePlatformEntity.S3, attributeName, attributeValue); }