dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41271
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21018: Use DhisConfigurationProvider
------------------------------------------------------------
revno: 21018
committer: Halvdan Hoem Grelland <halvdanhg@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-11-10 19:26:21 +0100
message:
Use DhisConfigurationProvider
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java 2015-10-22 23:43:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/JCloudsFileResourceContentStore.java 2015-11-10 18:26:21 +0000
@@ -34,8 +34,8 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.external.conf.DhisConfigurationProvider;
import org.hisp.dhis.external.location.LocationManager;
-import org.hisp.dhis.hibernate.HibernateConfigurationProvider;
import org.jclouds.ContextBuilder;
import org.jclouds.blobstore.BlobRequestSigner;
import org.jclouds.blobstore.BlobStore;
@@ -62,7 +62,6 @@
import java.util.Optional;
import java.util.Properties;
import java.util.regex.Pattern;
-import java.util.stream.Collectors;
/**
* @author Halvdan Hoem Grelland
@@ -124,9 +123,9 @@
this.locationManager = locationManager;
}
- private HibernateConfigurationProvider configurationProvider;
+ private DhisConfigurationProvider configurationProvider;
- public void setConfigurationProvider( HibernateConfigurationProvider configurationProvider )
+ public void setConfigurationProvider( DhisConfigurationProvider configurationProvider )
{
this.configurationProvider = configurationProvider;
}
@@ -141,7 +140,7 @@
// Parse properties
// ---------------------------------------------------------------------
- Map<String, String> fileStoreConfiguration = getFileStorePropertiesMap();
+ Map<String, String> fileStoreConfiguration = configurationProvider.getProperties( FILE_STORE_CONFIG_NAMESPACE );
String provider = fileStoreConfiguration.getOrDefault( KEY_FILE_STORE_PROVIDER, JCLOUDS_PROVIDER_KEY_FILESYSTEM );
provider = validateAndSelectProvider( provider );
@@ -372,16 +371,6 @@
.build();
}
- private Map<String, String> getFileStorePropertiesMap()
- {
- return configurationProvider.getConfiguration().getProperties().entrySet().stream()
- .filter( p -> ((String) p.getKey()).startsWith( FILE_STORE_CONFIG_NAMESPACE ) )
- .collect( Collectors.toMap(
- p -> StringUtils.strip( (String) p.getKey() ),
- p -> StringUtils.strip( (String) p.getValue() )
- ) );
- }
-
private String validateAndSelectProvider( String provider )
{
if ( !SUPPORTED_PROVIDERS.contains( provider ) )
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2015-11-09 05:05:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2015-11-10 18:26:21 +0000
@@ -19,14 +19,10 @@
<bean id="org.hisp.dhis.schema.SchemaService" class="org.hisp.dhis.schema.DefaultSchemaService" />
- <bean id="org.hisp.dhis.query.QueryParser" class="org.hisp.dhis.query.DefaultQueryParser" />
+ <bean id="org.hisp.dhis.query.CriteriaQueryEngine" class="org.hisp.dhis.query.CriteriaQueryEngine" />
<bean id="org.hisp.dhis.query.QueryService" class="org.hisp.dhis.query.DefaultQueryService" />
- <bean id="org.hisp.dhis.query.CriteriaQueryEngine" class="org.hisp.dhis.query.CriteriaQueryEngine" />
-
- <bean id="org.hisp.dhis.query.InMemoryQueryEngine" class="org.hisp.dhis.query.InMemoryQueryEngine" />
-
<bean id="org.hisp.dhis.schema.PropertyIntrospectorService" class="org.hisp.dhis.schema.Jackson2PropertyIntrospectorService" />
<bean id="org.hisp.dhis.security.acl.AclService" class="org.hisp.dhis.security.acl.DefaultAclService" />
@@ -581,7 +577,7 @@
<bean id="org.hisp.dhis.fileresource.FileResourceContentStore" class="org.hisp.dhis.fileresource.JCloudsFileResourceContentStore"
init-method="init" destroy-method="cleanUp">
- <property name="configurationProvider" ref="hibernateConfigurationProvider" />
+ <property name="configurationProvider" ref="dhisConfigurationProvider" />
<property name="locationManager" ref="locationManager" />
</bean>