Author: mthl
Date: Thu Jun 27 14:23:18 2019
New Revision: 1862217
URL:
http://svn.apache.org/viewvc?rev=1862217&view=revLog:
Improved: Rewrite ‘ComponentConfig#getAllKeystoreInfos’
(OFBIZ-11101)
It now has a stream based implementation.
Modified:
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java?rev=1862217&r1=1862216&r2=1862217&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java Thu Jun 27 14:23:18 2019
@@ -112,18 +112,15 @@ public final class ComponentConfig {
return entityInfos;
}
+ /**
+ * Provides the list of all the keystore information available in components.
+ *
+ * @return a list of keystore information
+ */
public static List<KeystoreInfo> getAllKeystoreInfos() {
- return getAllKeystoreInfos(null);
- }
-
- public static List<KeystoreInfo> getAllKeystoreInfos(String componentName) {
- List<KeystoreInfo> keystoreInfos = new ArrayList<>();
- for (ComponentConfig cc : getAllComponents()) {
- if (componentName == null || componentName.equals(cc.getComponentName())) {
- keystoreInfos.addAll(cc.getKeystoreInfos());
- }
- }
- return keystoreInfos;
+ return getAllComponents().stream()
+ .flatMap(cc -> cc.getKeystoreInfos().stream())
+ .collect(Collectors.toList());
}
public static List<ServiceResourceInfo> getAllServiceResourceInfos(String type) {