File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
para-core/src/main/java/com/erudika/para/core/utils Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 2323import com .typesafe .config .ConfigList ;
2424import com .typesafe .config .ConfigObject ;
2525import java .nio .file .Paths ;
26+ import java .util .Collections ;
2627import java .util .HashMap ;
28+ import java .util .List ;
2729import java .util .Map ;
2830import org .apache .commons .lang3 .StringUtils ;
2931import org .apache .commons .lang3 .Strings ;
3032import org .apache .commons .lang3 .math .NumberUtils ;
33+ import org .apache .commons .lang3 .stream .Streams ;
3134
3235/**
3336 * Para configuration.
@@ -2046,6 +2049,21 @@ public boolean landingPageEnabled() {
20462049 return getConfigBoolean ("landing_page_enabled" , true );
20472050 }
20482051
2052+ /**
2053+ * Returns the list of regions where a table should be replicated (global table).
2054+ * Currently, this is only used in combination with DynamoDB and SQS but could be implemented with other services.
2055+ * @return a list of regions
2056+ */
2057+ public List <String > replicaRegions () {
2058+ if (!StringUtils .isBlank (awsDynamoReplicaRegions ())) {
2059+ String [] regions = Para .getConfig ().awsDynamoReplicaRegions ().split ("\\ s*,\\ s*" );
2060+ if (regions != null && regions .length > 0 ) {
2061+ return Streams .of (regions ).filter (StringUtils ::isNotBlank ).toList ();
2062+ }
2063+ }
2064+ return Collections .emptyList ();
2065+ }
2066+
20492067 /**
20502068 * @return Development environment flag.
20512069 */
You can’t perform that action at this time.
0 commit comments