Moved Abstract Scoped Map in framework
This commit is contained in:
parent
08171d17c4
commit
25569804ae
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
package org.gcube.application.cms.caches;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
package org.gcube.application.cms.caches;
|
||||
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
package org.gcube.application.cms.caches;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.application.cms.plugins;
|
||||
|
||||
import org.gcube.application.cms.plugins.model.PluginDescriptor;
|
||||
import org.gcube.application.cms.plugins.reports.DocumentHandlingReport;
|
||||
import org.gcube.application.cms.plugins.requests.BaseExecutionRequest;
|
||||
import org.gcube.application.geoportal.common.model.profile.HandlerDeclaration;
|
||||
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractPlugin implements Plugin{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected HandlerDeclaration getConfigurationFromProfile(Profile profile){
|
||||
return getMultipleDeclarationsFromProfile(profile).get(0);
|
||||
}
|
||||
protected List<HandlerDeclaration> getMultipleDeclarationsFromProfile(Profile p){
|
||||
return p.getHandlersMap().get(getDescriptor().getId());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package org.gcube.application.cms.plugins;
|
||||
|
||||
import org.gcube.application.cms.plugins.reports.IndexDocumentReport;
|
||||
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
||||
|
||||
public interface IndexerPluginInterface extends InitializablePlugin{
|
||||
|
||||
public IndexDocumentReport index(IndexDocumentRequest request);
|
||||
|
||||
}
|
|
@ -14,6 +14,8 @@ public class PluginDescriptor {
|
|||
public static class BaseTypes{
|
||||
public static final String LIFECYCLE_MANAGER="LifecycleManagement";
|
||||
public static final String MATERIALIZER="Materializer";
|
||||
public static final String INDEXER="Indexer";
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package org.gcube.application.cms.plugins.reports;
|
||||
|
||||
import org.gcube.application.cms.plugins.requests.BaseExecutionRequest;
|
||||
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
||||
|
||||
public class IndexDocumentReport extends DocumentHandlingReport<IndexDocumentRequest> {
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.gcube.application.cms.plugins.requests;
|
||||
|
||||
public class IndexDocumentRequest extends BaseExecutionRequest{
|
||||
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.geoportal.service.ServiceConstants;
|
||||
import org.gcube.application.geoportal.service.engine.ImplementationProvider;
|
||||
import org.gcube.application.geoportal.service.model.internal.db.Mongo;
|
||||
|
@ -8,7 +9,7 @@ import org.gcube.application.geoportal.service.model.internal.db.MongoConnection
|
|||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
@Slf4j
|
||||
public class MongoClientProvider extends AbstractScopedMap<Mongo>{
|
||||
public class MongoClientProvider extends AbstractScopedMap<Mongo> {
|
||||
|
||||
public MongoClientProvider() {
|
||||
super("MongoClient cache");
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
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.plugins.InitializablePlugin;
|
||||
import org.gcube.application.cms.plugins.LifecycleManager;
|
||||
import org.gcube.application.cms.plugins.Plugin;
|
||||
|
@ -17,7 +18,6 @@ import org.reflections.util.FilterBuilder;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Slf4j
|
||||
public class PluginManager extends AbstractScopedMap<Map<String, Plugin>> implements PluginManagerInterface {
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.geoportal.service.engine.postgis.PostgisDBManager;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class PostgisConnectionProvider extends AbstractScopedMap<PostgisDBManager>{
|
||||
public class PostgisConnectionProvider extends AbstractScopedMap<PostgisDBManager> {
|
||||
|
||||
|
||||
public PostgisConnectionProvider() {
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.gcube.application.geoportal.service.engine.providers;
|
|||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||||
import org.gcube.application.geoportal.common.utils.Files;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.gcube.application.geoportal.service.engine.providers;
|
|||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.service.engine.providers;
|
||||
|
||||
import org.gcube.application.cms.caches.Engine;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
assertTrue(fs.getMaterializations().size()>0);
|
||||
|
||||
|
||||
for(Object matObj : wrapper.getByPath("$..fileset."+RegisteredFileSet.MATERIALIZATIONS,List.class).get(0)){
|
||||
for(Object matObj : wrapper.getByPath("$..[?(@."+ Materialization.TYPE +" == '"+GCubeSDILayer.GCUBE_SDY_LAYER_TYPE+"' )]")){
|
||||
GCubeSDILayer layer = Serialization.convert(matObj, GCubeSDILayer.class);
|
||||
System.out.println("Checking Layer : "+layer);
|
||||
assertTrue(layer.getType().equals(GCubeSDILayer.GCUBE_SDY_LAYER_TYPE));
|
||||
|
@ -140,17 +140,14 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
assertTrue(layer.getBBox()!=null);
|
||||
}
|
||||
|
||||
// Checking platform info
|
||||
for(Object platformObj : wrapper.getByPath("$..[?(@."+ Materialization.TYPE +" == '"+GCubeSDILayer.GCUBE_SDY_LAYER_TYPE+"' )]")){
|
||||
// Checking platform info GeoServer
|
||||
for(Object platformObj : wrapper.getByPath("$..[?(@."+ Materialization.TYPE +" == 'GeoServer' )]")){
|
||||
Document platform=Serialization.asDocument(platformObj);
|
||||
assertTrue(platform.containsKey("_type"));
|
||||
if(platform.get("_type").equals("GeoServer")){
|
||||
assertTrue(platform.containsKey("layerName"));
|
||||
assertTrue(platform.containsKey("workspace"));
|
||||
assertTrue(platform.containsKey("storeName"));
|
||||
assertTrue(platform.containsKey("persistencePath"));
|
||||
assertTrue(platform.get("files",List.class).size()==2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.gcube.application.geoportal.service.engine.caches;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.gcube.application.geoportal.service.engine.providers.AbstractScopedMap;
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
Loading…
Reference in New Issue