Java Code Examples for com.amazonaws.regions.Regions#values()

The following examples show how to use com.amazonaws.regions.Regions#values() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractAWSProcessor.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
private static AllowableValue[] getAvailableRegions() {
    final List<AllowableValue> values = new ArrayList<>();
    for (final Regions regions : Regions.values()) {
        values.add(createAllowableValue(regions));
    }

    return (AllowableValue[]) values.toArray(new AllowableValue[values.size()]);
}
 
Example 2
Source File: OptionsParserTest.java    From circus-train with Apache License 2.0 5 votes vote down vote up
@Test
public void regions() {
  for (Regions region : Regions.values()) {
    S3MapReduceCpOptions options = new OptionsParser().parse("--src", "hdfs://localhost:8020/source/first", "--dest",
        "hdfs://localhost:8020/target/", "--credentialsProvider",
        "jceks://hdfs@localhost:8020/security/credentials.jceks", "--region", region.getName());
    assertThat(options.getRegion(), is(region.getName()));
  }
}
 
Example 3
Source File: S3ItemStorage.java    From jobcacher-plugin with MIT License 5 votes vote down vote up
@SuppressWarnings("unused")
public ListBoxModel doFillRegionItems() {
    final ListBoxModel model = new ListBoxModel();
    for (Regions r : Regions.values()) {
        model.add(r.getName(), r.getName());
    }
    return model;
}
 
Example 4
Source File: SQSTriggerQueue.java    From aws-codecommit-trigger-plugin with Apache License 2.0 5 votes vote down vote up
public ListBoxModel doFillRegionItems() {
    ListBoxModel items = new ListBoxModel();
    items.add("", "");
    for (Regions region : Regions.values()) {
        Region r = Region.getRegion(region);
        if (r.isServiceSupported(AmazonSQS.ENDPOINT_PREFIX) && r.isServiceSupported("codecommit")) {
            items.add(region.getName(), region.name());
        }
    }
    return items;
}
 
Example 5
Source File: AWS.java    From graylog-plugin-aws with Apache License 2.0 5 votes vote down vote up
/**
 * Build a list of region choices with both a value (persisted in configuration) and display value (shown to the user).
 *
 * The display value is formatted nicely: "EU (London): eu-west-2"
 * The value is eventually passed to Regions.fromName() to get the actual region object: eu-west-2
 * @return a choices map with configuration value map keys and display value map values.
 */
public static Map<String, String> buildRegionChoices() {
    Map<String, String> regions = Maps.newHashMap();
    for (Regions region : Regions.values()) {

        String displayValue = String.format("%s: %s", region.getDescription(), region.getName());
        regions.put(region.getName(), displayValue);
    }
    return regions;
}
 
Example 6
Source File: AbstractAWSProcessor.java    From nifi with Apache License 2.0 5 votes vote down vote up
public static AllowableValue[] getAvailableRegions() {
    final List<AllowableValue> values = new ArrayList<>();
    for (final Regions region : Regions.values()) {
        values.add(createAllowableValue(region));
    }
    return values.toArray(new AllowableValue[values.size()]);
}
 
Example 7
Source File: AmazonS3FileSystem.java    From iaf with Apache License 2.0 5 votes vote down vote up
public static List<String> getAvailableRegions() {
	List<String> availableRegions = new ArrayList<String>(Regions.values().length);
	for (Regions region : Regions.values())
		availableRegions.add(region.getName());

	return availableRegions;
}
 
Example 8
Source File: DynamoDBConfig.java    From openhab1-addons with Eclipse Public License 2.0 5 votes vote down vote up
private static void invalidRegionLogHelp(String region) {
    Regions[] regions = Regions.values();
    String[] regionNames = new String[regions.length];
    for (int i = 0; i < regions.length; i++) {
        regionNames[i] = regions[i].getName();
    }
    logger.error("Specify valid AWS region to use, got {}. Valid values include: {}", region,
            StringUtils.join(regionNames, ','));
}