/** * Get the S3_STAGING_RESOURCE full path from the bucket name as well as other details. * * @return the s3 managed location. */ public String getS3StagingLocation() { return configurationHelper.getProperty(ConfigurationValue.S3_URL_PROTOCOL) + configurationHelper.getProperty(ConfigurationValue.S3_STAGING_BUCKET_NAME) + configurationHelper.getProperty(ConfigurationValue.S3_URL_PATH_DELIMITER) + configurationHelper.getProperty(ConfigurationValue.S3_STAGING_RESOURCE_BASE); }
/** * TODO replace uses of this method with ConfigurationHelper Gets the configuration value as string. */ public String getConfigurationValueAsString(ConfigurationValue configurationValue) { return configurationHelper.getProperty(configurationValue); }
@Override public String getCronExpression() { return configurationHelper.getProperty(ConfigurationValue.RELATIONAL_TABLE_SCHEMA_UPDATE_JOB_CRON_EXPRESSION); }
/** * TODO replace uses of this method with ConfigurationHelper Gets the configuration value as integer. * * @param configurationValue the configuration value. * * @return the configuration value as an integer. */ public int getConfigurationValueAsInteger(ConfigurationValue configurationValue) { return configurationHelper.getProperty(configurationValue, Integer.class); }
@Override public String getCronExpression() { return configurationHelper.getProperty(ConfigurationValue.JMS_PUBLISHING_JOB_CRON_EXPRESSION); }
/** * Calls {@link #getProperty(ConfigurationValue, Class)} where the target type is {@link String}. * * @param configurationValue {@link ConfigurationValue} * * @return The string value */ public String getProperty(ConfigurationValue configurationValue) { return getProperty(configurationValue, String.class); }
@Override public String getCronExpression() { return configurationHelper.getProperty(ConfigurationValue.EXPIRE_RESTORED_BDATA_JOB_CRON_EXPRESSION); } }
@Override public String getCronExpression() { return configurationHelper.getProperty(ConfigurationValue.FILE_UPLOAD_CLEANUP_JOB_CRON_EXPRESSION); } }
/** * Calls {@link #getProperty(ConfigurationValue, Class, Environment)} using String targetType. * * @param configurationValue {@link ConfigurationValue} * @param environment {@link Environment} * * @return String value */ public static String getProperty(ConfigurationValue configurationValue, Environment environment) { return getProperty(configurationValue, String.class, environment); }
/** * Calls {@link #getProperty(ConfigurationValue, Class)} where the target type is {@link String}. * * @param configurationValue {@link ConfigurationValue} * * @return The string value */ public String getProperty(ConfigurationValue configurationValue) { return getProperty(configurationValue, String.class); }
private String[] getActiveEmrClusterStates() { String emrStatesString = configurationHelper.getProperty(ConfigurationValue.EMR_VALID_STATES); return emrStatesString.split("\\" + configurationHelper.getProperty(ConfigurationValue.FIELD_DATA_DELIMITER)); }
/** * Returns a list of values from a configuration value which are delimited by the default delimited configured by FIELD_DATA_DELIMITER. Returns an empty * list if the configuration value does not exist. * * @param configurationValue The configuration value * * @return List of values */ public List<String> getDelimitedConfigurationValue(ConfigurationValue configurationValue) { return splitStringWithDefaultDelimiter(configurationHelper.getProperty(configurationValue)); }
/** * Gets the storage's download role ARN. Throws if not defined. * * @param storageEntity The storage entity * * @return Download role ARN */ private String getStorageDownloadRoleArn(StorageEntity storageEntity) { return storageHelper .getStorageAttributeValueByName(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_DOWNLOAD_ROLE_ARN), storageEntity, true); }
/** * Gets the storage's upload role ARN. Throws if not defined. * * @param storageEntity The storage entity * * @return Upload role ARN */ private String getStorageUploadRoleArn(StorageEntity storageEntity) { return storageHelper .getStorageAttributeValueByName(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_UPLOAD_ROLE_ARN), storageEntity, true); }
@Override public ProcessInstance startProcessInstanceByProcessDefinitionId(String processDefinitionId, Map<String, Object> variables) { String workflowEnvironment = configurationHelper.getProperty(ConfigurationValue.HERD_ENVIRONMENT); variables.put(HERD_WORKFLOW_ENVIRONMENT, workflowEnvironment); return activitiRuntimeService.startProcessInstanceById(processDefinitionId, variables); }
/** * Gets the storage's upload role ARN. Throws if not defined. * * @param storageEntity The storage entity * * @return Upload role ARN */ private String getStorageUploadRoleArn(StorageEntity storageEntity) { return storageHelper .getStorageAttributeValueByName(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_UPLOAD_ROLE_ARN), storageEntity, true); }
/** * Gets the storage's download role ARN. Throws if not defined. * * @param storageEntity The storage entity * * @return Download role ARN */ private String getStorageDownloadRoleArn(StorageEntity storageEntity) { return storageHelper .getStorageAttributeValueByName(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_DOWNLOAD_ROLE_ARN), storageEntity, true); }
@Override public boolean indexSpotCheckMostRecentValidationTags(String indexName) { final Integer spotCheckMostRecentNumber = configurationHelper.getProperty(ConfigurationValue.ELASTICSEARCH_TAG_SPOT_CHECK_MOST_RECENT_NUMBER, Integer.class); // Get a list of all tags final List<TagEntity> tagEntityList = Collections.unmodifiableList(tagDao.getMostRecentTags(spotCheckMostRecentNumber)); return indexValidateTagsList(tagEntityList); }
@Override public boolean indexSpotCheckPercentageValidationBusinessObjectDefinitions(String indexName) { final Double spotCheckPercentage = configurationHelper.getProperty(ConfigurationValue.ELASTICSEARCH_BDEF_SPOT_CHECK_PERCENTAGE, Double.class); // Get a list of all business object definitions final List<BusinessObjectDefinitionEntity> businessObjectDefinitionEntityList = Collections.unmodifiableList(businessObjectDefinitionDao.getPercentageOfAllBusinessObjectDefinitions(spotCheckPercentage)); return indexValidateBusinessObjectDefinitionsList(businessObjectDefinitionEntityList, indexName); }
@Test public void testGetPropertyNoTargetType() { ConfigurationValue configurationValue = ConfigurationValue.HERD_ENVIRONMENT; MockEnvironment environment = new MockEnvironment(); String value = ConfigurationHelper.getProperty(configurationValue, environment); assertEquals("value", configurationValue.getDefaultValue(), value); }