Moved ImplementationProvider to framework
This commit is contained in:
parent
25569804ae
commit
f383d1b86a
|
@ -67,5 +67,8 @@ public abstract class AbstractScopedMap<T> implements Engine<T>{
|
|||
|
||||
protected abstract T retrieveObject() throws ConfigurationException;
|
||||
|
||||
protected abstract void dispose(T toDispose);
|
||||
protected void dispose(T toDispose){};
|
||||
|
||||
@Override
|
||||
public void init() {}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
package org.gcube.application.cms.implementations;
|
||||
|
||||
public interface ISInterface {
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package org.gcube.application.cms.implementations;
|
||||
|
||||
|
||||
import lombok.Synchronized;
|
||||
import org.gcube.application.cms.caches.Engine;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.gcube.application.geoportal.service.engine.providers.*;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class ImplementationProvider {
|
||||
|
||||
private static ImplementationProvider instance=null;
|
||||
|
||||
@Synchronized
|
||||
public static ImplementationProvider get() {
|
||||
if(instance==null) {
|
||||
instance=new ImplementationProvider();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
public <T> T getEngineByClass(Class<T> clazz) throws ConfigurationException {
|
||||
return (T) implementationsRegistry.get(clazz).getObject();
|
||||
}
|
||||
|
||||
private ConcurrentHashMap<Class,Engine> implementationsRegistry=new ConcurrentHashMap<>();
|
||||
|
||||
public <T> void setEngine(Engine<T> engine, Class<T> clazz){
|
||||
implementationsRegistry.put(clazz,engine);
|
||||
}
|
||||
|
||||
// @Getter
|
||||
// @Setter
|
||||
// private MongoClientProvider mongoClientProvider=new MongoClientProvider();
|
||||
//
|
||||
//
|
||||
// @Getter
|
||||
// @Setter
|
||||
// private StorageClientProvider storageProvider=new StorageClientProvider();
|
||||
//
|
||||
// @Getter
|
||||
// @Setter
|
||||
// private PostgisConnectionProvider dbProvider=new PostgisConnectionProvider();
|
||||
//
|
||||
// @Getter
|
||||
// @Setter
|
||||
// private ISProvider isProvider=new ISProvider();
|
||||
//
|
||||
// @Getter
|
||||
// @Setter
|
||||
// private ProfileMapCache profiles=new ProfileMapCache();
|
||||
//
|
||||
// @Getter
|
||||
// @Setter
|
||||
// private PluginManager pluginManager=new PluginManager();
|
||||
//
|
||||
// @Getter
|
||||
// @Setter
|
||||
// private StorageHubProvider sHubProvider=new StorageHubProvider();
|
||||
//
|
||||
// public void shutdown() {
|
||||
// // Stop JPA
|
||||
//// AbstractRecordManager.shutdown();
|
||||
//
|
||||
// mongoClientProvider.shutdown();
|
||||
// pluginManager.shutdown();
|
||||
// }
|
||||
//
|
||||
// public void startup() {
|
||||
//// AbstractRecordManager.setDefaultProvider(emfProvider);
|
||||
// pluginManager.init();
|
||||
// mongoClientProvider.init();
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package org.gcube.application.cms.implementations;
|
||||
|
||||
public interface WSInterface {
|
||||
}
|
|
@ -1,18 +1,28 @@
|
|||
package org.gcube.application.geoportal.service;
|
||||
|
||||
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
|
||||
import jdk.internal.dynalink.linker.LinkerServices;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.implementations.ISInterface;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
import org.gcube.application.geoportal.service.engine.postgis.PostgisDBManager;
|
||||
import org.gcube.application.geoportal.service.engine.providers.*;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
|
||||
import org.gcube.application.geoportal.service.rest.ConcessioniOverMongo;
|
||||
|
||||
|
||||
import org.gcube.application.geoportal.service.rest.ProfiledDocuments;
|
||||
import org.gcube.application.geoportal.service.rest.Sections;
|
||||
import org.gcube.application.cms.serialization.Serialization;
|
||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||
import org.glassfish.jersey.server.ResourceConfig;
|
||||
|
||||
import javax.ws.rs.ApplicationPath;
|
||||
|
||||
@ApplicationPath(InterfaceConstants.APPLICATION_PATH)
|
||||
@Slf4j
|
||||
public class GeoPortalService extends ResourceConfig{
|
||||
|
||||
|
||||
|
@ -25,8 +35,15 @@ public class GeoPortalService extends ResourceConfig{
|
|||
registerClasses(ProfiledDocuments.class);
|
||||
registerClasses(Sections.class);
|
||||
|
||||
log.info("Setting implementations .. ");
|
||||
|
||||
|
||||
ImplementationProvider.get().setEngine(new ISProvider(),ISInterface.class);
|
||||
ImplementationProvider.get().setEngine(new MongoClientProvider(), Mongo.class);
|
||||
ImplementationProvider.get().setEngine(new StorageClientProvider(), StorageUtils.class);
|
||||
ImplementationProvider.get().setEngine(new PostgisConnectionProvider(), PostgisDBManager.class);
|
||||
ImplementationProvider.get().setEngine(new ProfileMapCache(), ProfileMapCache.ProfileMap.class);
|
||||
ImplementationProvider.get().setEngine(new PluginManager(), PluginManager.PluginMap.class);
|
||||
ImplementationProvider.get().setEngine(new StorageHubProvider(), StorageHubClient.class);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
package org.gcube.application.geoportal.service.engine;
|
||||
|
||||
//import org.gcube.application.geoportal.managers.AbstractRecordManager;
|
||||
//import org.gcube.application.geoportal.managers.EMFProvider;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.Synchronized;
|
||||
import org.gcube.application.cms.plugins.Plugin;
|
||||
import org.gcube.application.geoportal.service.engine.providers.*;
|
||||
|
||||
public class ImplementationProvider {
|
||||
|
||||
private static ImplementationProvider instance=null;
|
||||
|
||||
@Synchronized
|
||||
public static ImplementationProvider get() {
|
||||
if(instance==null) {
|
||||
instance=new ImplementationProvider();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private MongoClientProvider mongoClientProvider=new MongoClientProvider();
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private StorageClientProvider storageProvider=new StorageClientProvider();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private PostgisConnectionProvider dbProvider=new PostgisConnectionProvider();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private ISProvider isProvider=new ISProvider();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private ProfileMapCache profiles=new ProfileMapCache();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private PluginManager pluginManager=new PluginManager();
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private StorageHubProvider sHubProvider=new StorageHubProvider();
|
||||
|
||||
// public void shutdown() {
|
||||
// // Stop JPA
|
||||
//// AbstractRecordManager.shutdown();
|
||||
//
|
||||
// mongoClientProvider.shutdown();
|
||||
// pluginManager.shutdown();
|
||||
// }
|
||||
//
|
||||
// public void startup() {
|
||||
//// AbstractRecordManager.setDefaultProvider(emfProvider);
|
||||
// pluginManager.init();
|
||||
// mongoClientProvider.init();
|
||||
// }
|
||||
}
|
|
@ -2,6 +2,7 @@ package org.gcube.application.geoportal.service.engine;
|
|||
|
||||
import lombok.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFile;
|
||||
import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent;
|
||||
import org.gcube.application.geoportal.common.utils.Files;
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
|||
import org.gcube.application.geoportal.common.model.rest.TempFile;
|
||||
import org.gcube.application.geoportal.common.utils.Files;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.engine.materialization.SDIManager;
|
||||
import org.gcube.application.geoportal.service.engine.WorkspaceManager;
|
||||
import org.gcube.application.geoportal.service.engine.WorkspaceManager.FileOptions;
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.bson.Document;
|
||||
import org.bson.types.ObjectId;
|
||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.gcube.application.geoportal.service.engine.mongo;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import com.vdurmont.semver4j.Semver;
|
||||
import lombok.Getter;
|
||||
|
@ -14,8 +13,6 @@ import org.gcube.application.cms.plugins.faults.EventException;
|
|||
import org.gcube.application.cms.plugins.faults.StepException;
|
||||
import org.gcube.application.cms.plugins.model.PluginDescriptor;
|
||||
import org.gcube.application.cms.plugins.reports.DocumentHandlingReport;
|
||||
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
||||
import org.gcube.application.cms.plugins.reports.Report;
|
||||
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
||||
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
||||
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
||||
|
@ -38,7 +35,7 @@ import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
|||
import org.gcube.application.geoportal.common.model.rest.TempFile;
|
||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.engine.WorkspaceManager;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.gcube.application.geoportal.service.model.internal.faults.DeletionException;
|
||||
|
@ -57,7 +54,6 @@ import java.util.*;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static org.gcube.application.cms.plugins.reports.Report.*;
|
||||
import static org.gcube.application.cms.serialization.Serialization.*;
|
||||
|
||||
@Slf4j
|
||||
|
|
|
@ -2,12 +2,14 @@ package org.gcube.application.geoportal.service.engine.postgis;
|
|||
|
||||
import lombok.Synchronized;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.implementations.ISInterface;
|
||||
import org.gcube.application.geoportal.common.model.legacy.BBOX;
|
||||
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.PostgisTable;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.gcube.application.geoportal.service.model.internal.faults.DataParsingException;
|
||||
import org.gcube.application.geoportal.service.utils.ISUtils;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.regex.Matcher;
|
||||
|
@ -23,7 +25,8 @@ public class PostgisDBManager implements PostgisDBManagerI {
|
|||
|
||||
// TODO GENERIC
|
||||
DatabaseConnection defaultConfiguration=
|
||||
ImplementationProvider.get().getIsProvider().getIS().queryForDB("postgis", "Concessioni");
|
||||
((ISUtils)ImplementationProvider.get().getEngineByClass(ISInterface.class))
|
||||
.queryForDB("postgis", "Concessioni");
|
||||
|
||||
log.debug("Found configuration : "+defaultConfiguration);
|
||||
config=defaultConfiguration;
|
||||
|
|
|
@ -4,7 +4,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
||||
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
||||
import org.gcube.application.geoportal.common.model.rest.PostgisIndexDescriptor;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.engine.materialization.SDIManager;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.DBConstants;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.PostgisTable;
|
||||
|
@ -39,7 +39,7 @@ public class PostgisIndex {
|
|||
private SDIManager sdiManager;
|
||||
private String wmsLink=null;
|
||||
private static PostgisDBManager getDB() throws ConfigurationException {
|
||||
return ImplementationProvider.get().getDbProvider().getObject();
|
||||
return ImplementationProvider.get().getEngineByClass(PostgisDBManager.class);
|
||||
};
|
||||
|
||||
public PostgisIndex() throws SDIInteractionException, SQLException, ConfigurationException {
|
||||
|
@ -60,7 +60,7 @@ public class PostgisIndex {
|
|||
|
||||
public String init() throws SQLException, ConfigurationException, SDIInteractionException {
|
||||
log.debug("Contacting postgis DB .. ");
|
||||
PostgisDBManagerI db=ImplementationProvider.get().getDbProvider().getObject();
|
||||
PostgisDBManagerI db=getDB();
|
||||
log.debug("Checking if centroids table exists..");
|
||||
PostgisTable table=getCentroidsTable();
|
||||
db.create(table);
|
||||
|
@ -77,7 +77,7 @@ public class PostgisIndex {
|
|||
Map<String,String> centroidRow=evaluateCentroid(record);
|
||||
|
||||
log.debug("Contacting postgis DB .. ");
|
||||
PostgisDBManagerI db=ImplementationProvider.get().getDbProvider().getObject();
|
||||
PostgisDBManagerI db=getDB();
|
||||
|
||||
PostgisTable centroidsTable=getCentroidsTable();
|
||||
log.debug("Inserting / updated centroid Row {} ",centroidRow);
|
||||
|
@ -107,7 +107,7 @@ public class PostgisIndex {
|
|||
|
||||
public void removeCentroid(Concessione record) {
|
||||
try {
|
||||
PostgisDBManagerI db=ImplementationProvider.get().getDbProvider().getObject();
|
||||
PostgisDBManagerI db=getDB();
|
||||
PostgisTable centroidsTable=getCentroidsTable();
|
||||
log.debug("Deleting centroid if present. ID is "+record.getMongo_id());
|
||||
int result= db.deleteByFieldValue(centroidsTable, new Field(DBConstants.Concessioni.PRODUCT_ID,FieldType.TEXT), record.getMongo_id());
|
||||
|
|
|
@ -1,10 +1,25 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
|
||||
import org.gcube.application.cms.caches.Engine;
|
||||
import org.gcube.application.cms.implementations.ISInterface;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.gcube.application.geoportal.service.utils.ISUtils;
|
||||
|
||||
public class ISProvider {
|
||||
public class ISProvider implements Engine<ISInterface> {
|
||||
|
||||
public ISUtils getIS(){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void init() { }
|
||||
|
||||
@Override
|
||||
public void shutdown() {}
|
||||
|
||||
@Override
|
||||
public ISInterface getObject() throws ConfigurationException {
|
||||
return new ISUtils();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,13 @@ package org.gcube.application.geoportal.service.engine.providers;
|
|||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.cms.implementations.ISInterface;
|
||||
import org.gcube.application.geoportal.service.ServiceConstants;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.MongoConnection;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.gcube.application.geoportal.service.utils.ISUtils;
|
||||
|
||||
@Slf4j
|
||||
public class MongoClientProvider extends AbstractScopedMap<Mongo> {
|
||||
|
@ -19,8 +21,9 @@ public class MongoClientProvider extends AbstractScopedMap<Mongo> {
|
|||
|
||||
@Override
|
||||
protected Mongo retrieveObject() throws ConfigurationException {
|
||||
MongoConnection conn=ImplementationProvider.get().
|
||||
getIsProvider().getIS().queryForMongoDB(
|
||||
MongoConnection conn=((ISUtils)ImplementationProvider.get().
|
||||
getEngineByClass(ISInterface.class)).
|
||||
queryForMongoDB(
|
||||
ServiceConstants.MONGO_SE_PLATFORM, ServiceConstants.MONGO_SE_GNA_FLAG);
|
||||
|
||||
log.debug("Connecting to "+conn);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.cms.plugins.InitializablePlugin;
|
||||
|
@ -9,6 +11,7 @@ import org.gcube.application.cms.plugins.PluginManagerInterface;
|
|||
import org.gcube.application.cms.plugins.faults.InitializationException;
|
||||
import org.gcube.application.cms.plugins.faults.ShutDownException;
|
||||
import org.gcube.application.cms.plugins.reports.InitializationReport;
|
||||
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||||
import org.gcube.application.geoportal.common.utils.ContextUtils;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
|
@ -20,9 +23,13 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class PluginManager extends AbstractScopedMap<Map<String, Plugin>> implements PluginManagerInterface {
|
||||
public class PluginManager extends AbstractScopedMap<PluginManager.PluginMap> implements PluginManagerInterface {
|
||||
|
||||
Map<String,Plugin> implementations=new HashMap<>();
|
||||
|
||||
public static class PluginMap extends HashMap<String,Plugin>{
|
||||
}
|
||||
|
||||
PluginMap implementations=new PluginMap();
|
||||
|
||||
|
||||
public PluginManager(){
|
||||
|
@ -70,7 +77,7 @@ public class PluginManager extends AbstractScopedMap<Map<String, Plugin>> implem
|
|||
|
||||
|
||||
@Override
|
||||
protected Map<String, Plugin> retrieveObject() throws ConfigurationException {
|
||||
protected PluginMap retrieveObject() throws ConfigurationException {
|
||||
// Init plugins
|
||||
implementations.forEach((id,p)->{
|
||||
if(p instanceof InitializablePlugin){
|
||||
|
@ -89,7 +96,7 @@ public class PluginManager extends AbstractScopedMap<Map<String, Plugin>> implem
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void dispose(Map<String, Plugin> toDispose) {
|
||||
protected void dispose(PluginMap toDispose) {
|
||||
// ShutDown plugins
|
||||
implementations.forEach((id,p)->{
|
||||
if(p instanceof InitializablePlugin){
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||||
|
@ -14,7 +16,13 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class ProfileMapCache extends AbstractScopedMap<Map<String,Profile>> {
|
||||
public class ProfileMapCache extends AbstractScopedMap<ProfileMapCache.ProfileMap> {
|
||||
|
||||
@AllArgsConstructor
|
||||
public static class ProfileMap {
|
||||
@Getter
|
||||
Map<String,Profile> profileMap=new HashMap<>();
|
||||
}
|
||||
|
||||
public ProfileMapCache() {
|
||||
super("Profiles CACHE");
|
||||
|
@ -27,12 +35,12 @@ public class ProfileMapCache extends AbstractScopedMap<Map<String,Profile>> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void dispose(Map<String, Profile> toDispose) {
|
||||
protected void dispose(ProfileMap toDispose) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, Profile> retrieveObject() throws ConfigurationException {
|
||||
protected ProfileMap retrieveObject() throws ConfigurationException {
|
||||
|
||||
|
||||
// Load from resources
|
||||
|
@ -50,7 +58,7 @@ public class ProfileMapCache extends AbstractScopedMap<Map<String,Profile>> {
|
|||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return toReturn;
|
||||
return new ProfileMap(toReturn);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -13,14 +13,8 @@ public class StorageHubProvider implements Engine<StorageHubClient> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
public void init() {}
|
||||
@Override
|
||||
public void shutdown() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
public void shutdown() { }
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.service.utils;
|
||||
|
||||
import org.gcube.application.cms.implementations.ISInterface;
|
||||
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
||||
import org.gcube.application.geoportal.service.ServiceConstants;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.MongoConnection;
|
||||
|
@ -17,7 +18,7 @@ import java.util.Map;
|
|||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
||||
|
||||
public class ISUtils {
|
||||
public class ISUtils implements ISInterface {
|
||||
|
||||
public DatabaseConnection queryForDB(String platform, String flag) throws ConfigurationException {
|
||||
return ISUtils.performQueryForDB(platform,flag);
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.mongodb.client.MongoDatabase;
|
|||
import com.mongodb.client.model.Projections;
|
||||
import org.bson.Document;
|
||||
import org.gcube.application.cms.tests.TokenSetter;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.engine.mongo.MongoManager;
|
||||
import org.gcube.application.geoportal.service.engine.providers.MongoClientProvider;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.gcube.application.geoportal.service;
|
|||
|
||||
import org.gcube.application.cms.tests.TokenSetter;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.engine.providers.StorageClientProvider;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.gcube.application.cms.tests.TokenSetter;
|
|||
import org.gcube.application.cms.tests.model.concessioni.TestConcessioniModel;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
import org.gcube.application.geoportal.service.BasicServiceTestUnit;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.engine.mongo.ConcessioniMongoManager;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.junit.Test;
|
||||
|
|
Loading…
Reference in New Issue