Skip to content

Commit 655cdce

Browse files
committed
Fixed minimal JDK version
1 parent 20b9c10 commit 655cdce

File tree

3 files changed

+67
-20
lines changed

3 files changed

+67
-20
lines changed

moneta-convert/moneta-convert-ecb/src/main/java/org/javamoney/moneta/convert/ecb/ECBCurrentRateProvider.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import javax.money.convert.ProviderContextBuilder;
2525
import javax.money.convert.RateType;
2626
import java.net.URI;
27+
import java.util.HashMap;
2728
import java.util.Map;
2829

2930
/**
@@ -60,13 +61,28 @@ public String getDataId() {
6061

6162
@Override
6263
protected LoadDataInformation getDefaultLoadData() {
64+
final Map<String, String> props = new HashMap<>();
65+
props.put("period", "03:00");
66+
6367
return new LoadDataInformationBuilder()
64-
.withResourceId(getDataId())
65-
.withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
66-
.withProperties(Map.of("period", "03:00"))
67-
.withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-daily.xml"))
68-
.withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"))
69-
.withStartRemote(true)
70-
.build();
68+
.withResourceId(getDataId())
69+
.withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
70+
.withProperties(props)
71+
.withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-daily.xml"))
72+
.withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"))
73+
.withStartRemote(true)
74+
.build();
7175
}
76+
77+
// @Override TODO a Java 9+ version for a MRJ
78+
// protected LoadDataInformation getDefaultLoadData() {
79+
// return new LoadDataInformationBuilder()
80+
// .withResourceId(getDataId())
81+
// .withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
82+
// .withProperties(Map.of("period", "03:00"))
83+
// .withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-daily.xml"))
84+
// .withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"))
85+
// .withStartRemote(true)
86+
// .build();
87+
// }
7288
}

moneta-convert/moneta-convert-ecb/src/main/java/org/javamoney/moneta/convert/ecb/ECBHistoric90RateProvider.java

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import javax.money.convert.ProviderContextBuilder;
2424
import javax.money.convert.RateType;
2525
import java.net.URI;
26+
import java.util.HashMap;
2627
import java.util.Map;
2728

2829
/**
@@ -62,17 +63,31 @@ public String getDataId() {
6263
return DATA_ID;
6364
}
6465

65-
6666
@Override
6767
protected LoadDataInformation getDefaultLoadData() {
68+
final Map<String, String> props = new HashMap<>();
69+
props.put("period", "03:00");
70+
6871
return new LoadDataInformationBuilder()
69-
.withResourceId(getDataId())
70-
.withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
71-
.withProperties(Map.of("period", "03:00"))
72-
.withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist-90d.xml"))
73-
.withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml"))
74-
.withStartRemote(true)
75-
.build();
72+
.withResourceId(getDataId())
73+
.withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
74+
.withProperties(props)
75+
.withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist-90d.xml"))
76+
.withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml"))
77+
.withStartRemote(true)
78+
.build();
7679
}
7780

81+
// @Override TODO this is for a MRJ version <=Java 9
82+
// protected LoadDataInformation getDefaultLoadData() {
83+
// return new LoadDataInformationBuilder()
84+
// .withResourceId(getDataId())
85+
// .withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
86+
// .withProperties(Map.of("period", "03:00"))
87+
// .withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist-90d.xml"))
88+
// .withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml"))
89+
// .withStartRemote(true)
90+
// .build();
91+
// }
92+
7893
}

moneta-convert/moneta-convert-ecb/src/main/java/org/javamoney/moneta/convert/ecb/ECBHistoricRateProvider.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import javax.money.convert.ProviderContextBuilder;
2525
import javax.money.convert.RateType;
2626
import java.net.URI;
27+
import java.util.HashMap;
2728
import java.util.Map;
2829

2930
/**
@@ -68,20 +69,35 @@ public ECBHistoricRateProvider() {
6869
public String getDataId() {
6970
return DATA_ID;
7071
}
71-
72-
7372
@Override
7473
protected LoadDataInformation getDefaultLoadData() {
74+
final Map<String, String> props = new HashMap<>();
75+
props.put("period", "24:00");
76+
props.put("delay", "01:00");
77+
props.put("at", "07:00");
78+
7579
return new LoadDataInformationBuilder()
7680
.withResourceId(getDataId())
7781
.withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
78-
.withProperties(Map.of("period", "24:00",
79-
"delay", "01:00",
80-
"at", "07:00"))
82+
.withProperties(props)
8183
.withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist.xml"))
8284
.withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml"))
8385
.withStartRemote(true)
8486
.build();
8587
}
8688

89+
// @Override TODO a Java 9+ version for a MRJ
90+
// protected LoadDataInformation getDefaultLoadData() {
91+
// return new LoadDataInformationBuilder()
92+
// .withResourceId(getDataId())
93+
// .withUpdatePolicy(LoaderService.UpdatePolicy.SCHEDULED)
94+
// .withProperties(Map.of("period", "24:00",
95+
// "delay", "01:00",
96+
// "at", "07:00"))
97+
// .withBackupResource(URI.create("org/javamoney/moneta/convert/ecb/defaults/eurofxref-hist.xml"))
98+
// .withResourceLocations(URI.create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml"))
99+
// .withStartRemote(true)
100+
// .build();
101+
// }
102+
87103
}

0 commit comments

Comments
 (0)