Minor fixes

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@129091 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-06-13 14:29:49 +00:00
parent 7ffb33200e
commit 7a7981f797
1 changed files with 4 additions and 4 deletions

View File

@ -48,6 +48,8 @@ public class CKanUtilsImpl implements CKanUtilsInterface{
private static Connection connection;
public CKanUtilsImpl(String scope) throws Exception{
String currentScope = ScopeProvider.instance.get();
try{
ScopeProvider.instance.set(scope);
@ -56,9 +58,7 @@ public class CKanUtilsImpl implements CKanUtilsInterface{
CKAN_DB_NAME = runningInstance.getDataBaseName();
CKAN_DB_USER = runningInstance.getDataBaseUser();
CKAN_DB_PASSWORD = StringEncrypter.getEncrypter().decrypt(runningInstance.getDataBasePassword());
logger.debug("Plain password first 3 chars are " + CKAN_DB_PASSWORD.substring(0, 2));
// for next versions TODO
//CKAN_DB_PASSWORD = StringEncrypter.getEncrypter().decrypt(runningInstance.getDataBasePassword(), scope);
logger.debug("Plain password first 3 chars are " + CKAN_DB_PASSWORD.substring(0, 3));
CKAN_DB_PORT = runningInstance.getDatabasePorts().get(0);
CKAN_CATALOGUE_URL = runningInstance.getDataCatalogueUrl().get(0);
@ -69,7 +69,7 @@ public class CKanUtilsImpl implements CKanUtilsInterface{
}catch(Exception e){
logger.error("Error while discovering ckan information in the infrastructure", e);
}finally{
ScopeProvider.instance.reset();
ScopeProvider.instance.set(currentScope);
}
}