Clients by model and custom client

This commit is contained in:
Fabio Sinibaldi 2022-02-04 17:45:47 +01:00
parent eadc991b64
commit a4e90a9f64
40 changed files with 262 additions and 137 deletions

View File

@ -4,6 +4,9 @@ import org.gcube.application.cms.plugins.faults.StepException;
import org.gcube.application.cms.plugins.reports.ExecutionReport;
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
import org.gcube.application.geoportal.common.model.rest.Configuration;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
public interface LifecycleManager extends InitializablePlugin{
@ -11,4 +14,5 @@ public interface LifecycleManager extends InitializablePlugin{
public ExecutionReport performStep(StepExecutionRequest request)throws StepException;
public Configuration getCurrentConfiguration() throws ConfigurationException;
}

View File

@ -17,6 +17,8 @@ import org.gcube.application.cms.plugins.reports.InitializationReport;
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
import org.gcube.application.geoportal.common.model.document.*;
import org.gcube.application.geoportal.common.model.legacy.report.ConstraintCheck;
import org.gcube.application.geoportal.common.model.rest.Configuration;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
@Slf4j
public class ConcessioniLifeCycleManager implements LifecycleManager {
@ -90,6 +92,11 @@ public class ConcessioniLifeCycleManager implements LifecycleManager {
return report;
}
@Override
public Configuration getCurrentConfiguration() throws ConfigurationException {
return null;
}
@Override
public PluginDescriptor getDescriptor() {
return DESCRIPTOR;

View File

@ -95,6 +95,12 @@
</dependency>
<dependency>
<groupId>org.gcube.application.cms</groupId>
<artifactId>concessioni-model</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,36 +0,0 @@
package org.gcube.application.geoportal.client;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.rest.Configuration;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.application.geoportal.common.rest.ProfiledDocumentsI;
import org.gcube.common.clients.Call;
import org.gcube.common.clients.delegates.ProxyDelegate;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.rmi.RemoteException;
import java.util.Iterator;
@Slf4j
public class DefaultProfiledDocuments extends AbstractProfiledDocumentClient<ProfiledDocument> {
public DefaultProfiledDocuments(@NonNull ProxyDelegate<WebTarget> delegate, @NonNull String profileID) {
super(delegate, profileID);
}
@Override
protected Class<ProfiledDocument> getManagedClass() {
return ProfiledDocument.class;
}
}

View File

@ -27,14 +27,19 @@ import java.util.Iterator;
@RequiredArgsConstructor
@Slf4j
public abstract class AbstractProfiledDocumentClient<T extends ProfiledDocument> implements ProfiledDocumentsI<T> {
public class DefaultProfiledDocumentsClient<T extends ProfiledDocument> implements ProfiledDocumentsI<T> {
@NonNull
protected final ProxyDelegate<WebTarget> delegate;
@NonNull
protected final String profileID;
@NonNull
protected final Class<T> managedClass;
protected abstract Class<T> getManagedClass();
public Class<T> getManagedClass() {
return managedClass;
}
@Override
public T createNew(Document toCreate) throws RemoteException {
@ -142,7 +147,7 @@ public abstract class AbstractProfiledDocumentClient<T extends ProfiledDocument>
try {
log.debug("Querying profile {}  for {}",profileID,request);
Call<WebTarget, String> call = endpoint -> {
return check(endpoint.path(profileID).path(InterfaceConstants.Methods.CONFIGURATION_PATH).
return check(endpoint.path(profileID).path(InterfaceConstants.Methods.QUERY_PATH).
request(MediaType.APPLICATION_JSON).get(), String.class);
};
return delegate.make(call);

View File

@ -5,8 +5,8 @@ import javax.ws.rs.client.WebTarget;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.client.legacy.ConcessioniPlugin;
import org.gcube.application.geoportal.client.legacy.MongoConcessioniPlugin;
import org.gcube.application.geoportal.client.legacy.StatefulMongoConcessioni;
import org.gcube.application.geoportal.client.legacy.StatefulMongoConcessioniPlugin;
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
import org.gcube.application.geoportal.common.rest.ConcessioniI;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
@ -22,39 +22,34 @@ import lombok.AllArgsConstructor;
public abstract class GeoportalAbstractPlugin <S, P> implements Plugin<S, P>{
private static ConcessioniPlugin concessioni_plugin=new ConcessioniPlugin();
private static MongoConcessioniPlugin mongo_concessioni_plugin=new MongoConcessioniPlugin();
private static StatefulMongoConcessioniPlugin stateful_mongo_concessioni_plugin=new StatefulMongoConcessioniPlugin();
public static ProxyBuilder<ProfiledDocumentsI> profiledDocuments(String profileID) {
ProjectsPlugin plugin=new ProjectsPlugin(profileID);
return new ProxyBuilderImpl<WebTarget, ProfiledDocumentsI>(plugin);
public static ProxyBuilder<ProfiledDocumentsI<ProfiledDocument>> profiledDocuments(String profileID) {
ProjectsInterfacePlugin plugin=new ProjectsInterfacePlugin(profileID);
return new ProxyBuilderImpl<WebTarget, ProfiledDocumentsI<ProfiledDocument>>(plugin);
}
public static ProxyBuilder<ProfiledDocumentsI> profiledDocuments(String profileID,
Class<? extends AbstractProfiledDocumentClient<?>> customClient) {
ProjectsPlugin plugin=new ProjectsPlugin(profileID);
public static <C extends ProfiledDocumentsI<ProfiledDocument>> ProxyBuilder<C> profiledDocuments(String profileID, Class<C> customClient) {
ProjectsInterfacePlugin plugin=new ProjectsInterfacePlugin(profileID);
plugin.setCustomClientImplementation(customClient);
return new ProxyBuilderImpl<WebTarget, ProfiledDocumentsI>(plugin);
return new ProxyBuilderImpl<WebTarget, C>(plugin);
}
public static <P extends ProfiledDocument> ProxyBuilder<ProfiledDocumentsI<P>>
profiledModel(String profileID, Class<P> customModel ) {
ProjectsInterfacePlugin plugin=new ProjectsInterfacePlugin(profileID);
plugin.setProfiledModel(customModel);
return new ProxyBuilderImpl<WebTarget, ProfiledDocumentsI<P>>(plugin);
}
public static ProxyBuilder<ConcessioniI> concessioni() {
return new ProxyBuilderImpl<WebTarget,ConcessioniI>(concessioni_plugin);
public static <P extends ProfiledDocument,C extends ProfiledDocumentsI<P>> ProxyBuilder<C>
profiledModel(String profileID, Class<P> customModel ,Class<C> customClient) {
ProjectsInterfacePlugin plugin=new ProjectsInterfacePlugin(profileID);
plugin.setProfiledModel(customModel);
plugin.setCustomClientImplementation(customClient);
return new ProxyBuilderImpl<WebTarget, C>(plugin);
}
public static ProxyBuilder<MongoConcessioni> mongoConcessioni(){
return new ProxyBuilderImpl<WebTarget, MongoConcessioni>(mongo_concessioni_plugin);
}
public static ProxyBuilder<ConcessioniManagerI> statefulMongoConcessioni(){
return new ProxyBuilderImpl<WebTarget, ConcessioniManagerI>(stateful_mongo_concessioni_plugin);
}
@Override
public Exception convert(Exception fault, ProxyConfig<?, ?> config) {
return fault;
@ -82,5 +77,31 @@ public abstract class GeoportalAbstractPlugin <S, P> implements Plugin<S, P>{
}
//******** LEGACY
public static ProxyBuilder<ConcessioniI> concessioni() {
return new ProxyBuilderImpl<WebTarget,ConcessioniI>(concessioni_plugin);
}
public static ProxyBuilder<MongoConcessioni> mongoConcessioni(){
return new ProxyBuilderImpl<WebTarget, MongoConcessioni>(mongo_concessioni_plugin);
}
public static ProxyBuilder<ConcessioniManagerI> statefulMongoConcessioni(){
return new ProxyBuilderImpl<WebTarget, ConcessioniManagerI>(stateful_mongo_concessioni_plugin);
}
//** LEGACY
@Deprecated
private static ConcessioniPlugin concessioni_plugin=new ConcessioniPlugin();
@Deprecated
private static MongoConcessioniPlugin mongo_concessioni_plugin=new MongoConcessioniPlugin();
@Deprecated
private static StatefulMongoConcessioniPlugin stateful_mongo_concessioni_plugin=new StatefulMongoConcessioniPlugin();
}

View File

@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.rest.ProfiledDocumentsI;
import org.gcube.common.calls.jaxrs.GcubeService;
@ -18,29 +19,30 @@ import org.gcube.common.clients.config.ProxyConfig;
import org.gcube.common.clients.delegates.ProxyDelegate;
import org.w3c.dom.Node;
import java.lang.reflect.InvocationTargetException;
@Slf4j
@RequiredArgsConstructor
public class ProjectsPlugin extends GeoportalAbstractPlugin<WebTarget, ProfiledDocumentsI>{
public class ProjectsInterfacePlugin<C extends DefaultProfiledDocumentsClient,P extends ProfiledDocument> extends GeoportalAbstractPlugin<WebTarget, ProfiledDocumentsI<P>>{
@NonNull
private String profileID;
@Setter
private Class<? extends AbstractProfiledDocumentClient<?>>
customClientImplementation=DefaultProfiledDocuments.class;
private Class<C> customClientImplementation;
//=DefaultProfiledDocuments.class;
@Setter
private Class<P> profiledModel;
@Override
public Exception convert(Exception fault, ProxyConfig<?, ?> config) {
return fault;
}
@SneakyThrows
@SneakyThrows //no such constructor
@Override
public ProfiledDocumentsI newProxy(ProxyDelegate<WebTarget> delegate) {
return customClientImplementation.getConstructor(ProxyDelegate.class,String.class).
newInstance(delegate,profileID);
public ProfiledDocumentsI<P> newProxy(ProxyDelegate<WebTarget> delegate) {
return customClientImplementation.getConstructor(ProxyDelegate.class,String.class,Class.class).
newInstance(delegate,profileID,profiledModel);
}
@Override

View File

@ -1,23 +1,64 @@
package org.gcube.application.geoportal.clients;
import com.fasterxml.jackson.databind.ser.std.StdKeySerializers;
import org.gcube.application.geoportal.client.DefaultProfiledDocumentsClient;
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportal.common.model.rest.Configuration;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.rest.ProfiledDocumentsI;
import org.junit.Test;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.mongoConcessioni;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.profiledDocuments;
import java.rmi.RemoteException;
import java.util.concurrent.atomic.AtomicLong;
public class ProfiledDocumentsTest extends BasicVreTests{
import static junit.framework.TestCase.assertTrue;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.*;
public class ProfiledDocumentsTest<M extends ProfiledDocument,C extends ProfiledDocumentsI<M>> extends BasicVreTests{
private ProfiledDocumentsI<ProfiledDocument> client=
profiledDocuments("profiledConcessioni").build();
protected String getProfileID(){return "profiledConcessioni";}
@Test
public void getConfiguration() throws Exception {
System.out.println(client.getConfiguration());
protected C getClient(){
return (C) profiledModel(getProfileID(),ProfiledDocument.class,DefaultProfiledDocumentsClient.class).build();
}
@Test
public void getConfiguration() throws Exception {
ProfiledDocumentsI<M> client = (ProfiledDocumentsI<M>) getClient();
Configuration config=client.getConfiguration();
System.out.println("Configuration is "+ config);
}
@Test
public void list() throws Exception {
ProfiledDocumentsI<M> client = (ProfiledDocumentsI<M>) getClient();
AtomicLong counter=new AtomicLong(0);
client.query(new QueryRequest()).forEachRemaining( M -> counter.incrementAndGet());
System.out.println("Found "+counter.get()+" elements");
System.out.println("Getting JSON ");
System.out.println(client.queryForJSON(new QueryRequest()));
}
@Test
public void scanStatusByID() throws Exception {
ProfiledDocumentsI<M> client = (ProfiledDocumentsI<M>) getClient();
AtomicLong counter=new AtomicLong(0);
client.query(new QueryRequest()).forEachRemaining( m -> {
System.out.print(counter.incrementAndGet()+ ", ID : "+m.get_id());
try {
M proj=client.getById(m.get_id());
System.out.println("... OK.. STATUS : "+proj.getLifecycleInformation());
} catch (RemoteException e) {
System.err.println(" Error with "+m.get_id());
System.err.println(e);
System.out.println("... ERRR !!!!");
}
});
}
}

View File

@ -1,4 +0,0 @@
package org.gcube.application.geoportal.clients;
public class ProfiledDocumentsTests {
}

View File

@ -1,4 +1,4 @@
package org.gcube.application.geoportal.clients;
package org.gcube.application.geoportal.clients.legacy;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
import static org.junit.Assert.*;
@ -11,6 +11,7 @@ import java.io.FileNotFoundException;
import org.gcube.application.cms.tests.model.concessioni.TestConcessioniModel;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.clients.BasicVreTests;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus;
import org.gcube.application.geoportal.common.model.rest.TempFile;
@ -19,7 +20,7 @@ import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendEx
import org.junit.Test;
public class StatefulClientTests extends BasicVreTests{
public class StatefulClientTests extends BasicVreTests {

View File

@ -1,4 +1,4 @@
package org.gcube.application.geoportal.clients;
package org.gcube.application.geoportal.clients.legacy;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.mongoConcessioni;
import static org.junit.Assert.*;
@ -18,6 +18,7 @@ import org.gcube.application.cms.tests.model.concessioni.TestConcessioniModel;
import org.gcube.application.cms.tests.model.concessioni.TestConcessioniQueries;
import org.gcube.application.geoportal.client.utils.Queries;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.clients.BasicVreTests;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus;
@ -29,7 +30,7 @@ import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import org.junit.Test;
public class StatelessClientTests extends BasicVreTests{
public class StatelessClientTests extends BasicVreTests {
private MongoConcessioni client=mongoConcessioni().build();

View File

@ -0,0 +1,6 @@
package org.gcube.application.geoportal.common.model.configuration;
import org.bson.Document;
public class Index extends Document {
}

View File

@ -1,15 +1,35 @@
package org.gcube.application.geoportal.common.model.rest;
import com.sun.tools.jdeps.Archive;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.Document;
import org.gcube.application.geoportal.common.model.configuration.Index;
import javax.xml.bind.annotation.XmlRootElement;
import java.time.LocalDateTime;
import java.util.List;
@XmlRootElement
@Data
public class Configuration {
@AllArgsConstructor
@NoArgsConstructor
public class Configuration{
// Index (postgis + layer) Configuration
public PostgisIndexDescriptor index;
public static String PROFILE_ID="profile_id";
public static String CONTEXT = "context";
public static String LAST_UPDATED_TIME = "";
public static String INDEXES = "indexes";
public static String ARCHIVES = "archives";
private String profile_id;
private String context;
private LocalDateTime lastUpdatedTime;
private List<Index> indexes;
private List<Archive> archives;
// Mongo DB Configuration
// TBD
}

View File

@ -1,4 +1,4 @@
package org.gcube.application.geoportal.service.model.internal.faults;
package org.gcube.application.geoportal.common.model.rest;
public class ConfigurationException extends Exception {

View File

@ -12,6 +12,8 @@ import java.util.Iterator;
public interface ProfiledDocumentsI<P extends ProfiledDocument> {
public Class<P> getManagedClass();
// CRUD
public P createNew(Document toCreate)throws RemoteException;
public P getById(String id) throws RemoteException;

View File

@ -2,11 +2,10 @@ package org.gcube.application.geoportal.service.engine;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.faults.PathException;
import org.gcube.application.geoportal.common.model.document.RegisteredFile;
import org.gcube.application.geoportal.common.model.legacy.WorkspaceContent;
import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.common.storagehub.client.dsl.FileContainer;
import org.gcube.common.storagehub.client.dsl.FolderContainer;
import org.gcube.common.storagehub.client.dsl.StorageHubClient;

View File

@ -12,6 +12,7 @@ import org.gcube.application.geoportal.common.faults.StorageException;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
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;

View File

@ -1,8 +1,6 @@
package org.gcube.application.geoportal.service.engine.mongo;
import com.mongodb.Block;
import com.mongodb.MongoClient;
import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
@ -15,7 +13,7 @@ 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.geoportal.service.model.internal.db.Mongo;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import static com.mongodb.client.model.Filters.eq;
import static com.mongodb.client.model.Sorts.ascending;

View File

@ -4,15 +4,14 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import org.bson.Document;
import org.gcube.application.cms.plugins.faults.StepException;
import org.gcube.application.geoportal.common.faults.StorageException;
import org.gcube.application.geoportal.common.model.rest.Configuration;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.application.geoportal.common.model.rest.TempFile;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.service.model.internal.faults.DeletionException;
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
import java.io.IOException;
import java.util.List;
public interface MongoManagerI<T> {
@ -41,4 +40,6 @@ public interface MongoManagerI<T> {
public T registerFileSet(String id, RegisterFileSetRequest request) throws ConfigurationException, StorageHubException, StorageException, StepException, JsonProcessingException, DeletionException;
public T deleteFileSet(String id, String destination, Boolean force) throws ConfigurationException, StorageHubException, StorageException, StepException, JsonProcessingException, DeletionException;
public Configuration getConfiguration()throws ConfigurationException;
}

View File

@ -19,6 +19,7 @@ import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.profile.Field;
import org.gcube.application.geoportal.common.model.profile.HandlerDeclaration;
import org.gcube.application.geoportal.common.model.profile.Profile;
import org.gcube.application.geoportal.common.model.rest.Configuration;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.application.geoportal.common.model.rest.TempFile;
@ -26,7 +27,7 @@ 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.geoportal.service.engine.WorkspaceManager;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.service.model.internal.faults.DeletionException;
import org.gcube.application.cms.serialization.Serialization;
import org.gcube.application.geoportal.service.utils.UserUtils;
@ -339,9 +340,13 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
return convert(replace(asDocumentWithId(doc),new ObjectId(id),getCollectionName()),ProfiledDocument.class);
}
@Override
public Configuration getConfiguration() throws ConfigurationException {
log.debug("Asking configuration for {} in {} ",profile.getId(), UserUtils.getCurrent().getContext());
Configuration toReturn= manager.getCurrentConfiguration();
log.debug("Returning current configuration {}",toReturn);
return toReturn;
}
private ExecutionReport step(ProfiledDocument theDocument,String step,Document callParameters) throws StepException {

View File

@ -6,9 +6,8 @@ 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.geoportal.service.model.internal.db.PostgisTable;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
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;

View File

@ -10,7 +10,7 @@ import org.gcube.application.geoportal.service.model.internal.db.DBConstants;
import org.gcube.application.geoportal.service.model.internal.db.PostgisTable;
import org.gcube.application.geoportal.service.model.internal.db.PostgisTable.Field;
import org.gcube.application.geoportal.service.model.internal.db.PostgisTable.FieldType;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.service.model.internal.faults.PublishException;
import org.gcube.application.geoportal.service.model.internal.faults.SDIInteractionException;
import org.gcube.application.cms.serialization.Serialization;

View File

@ -6,7 +6,7 @@ import lombok.Setter;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.utils.ContextUtils;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import java.time.LocalDateTime;

View File

@ -1,6 +1,6 @@
package org.gcube.application.geoportal.service.engine.providers;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
public interface Engine <T> {

View File

@ -5,7 +5,7 @@ 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;
import org.gcube.application.geoportal.service.model.internal.db.MongoConnection;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
@Slf4j
public class MongoClientProvider extends AbstractScopedMap<Mongo>{

View File

@ -7,7 +7,7 @@ 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.utils.ContextUtils;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.reflections.Reflections;
import org.reflections.util.ConfigurationBuilder;
@ -15,7 +15,6 @@ import org.reflections.util.FilterBuilder;
import java.util.HashMap;
import java.util.Map;
import java.util.ServiceLoader;
@Slf4j
public class PluginManager extends AbstractScopedMap<Map<String, Plugin>>{

View File

@ -1,7 +1,7 @@
package org.gcube.application.geoportal.service.engine.providers;
import org.gcube.application.geoportal.service.engine.postgis.PostgisDBManager;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import java.sql.SQLException;

View File

@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.model.profile.Profile;
import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.cms.serialization.Serialization;
import java.io.IOException;

View File

@ -3,7 +3,7 @@ package org.gcube.application.geoportal.service.engine.providers;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
@Slf4j
public class StorageClientProvider extends AbstractScopedMap<StorageUtils> {

View File

@ -1,6 +1,6 @@
package org.gcube.application.geoportal.service.engine.providers;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
public class StorageHubProvider implements Engine<StorageHubClient> {

View File

@ -9,7 +9,7 @@ import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
import org.gcube.application.geoportal.service.engine.mongo.ProfiledMongoManager;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.cms.serialization.Serialization;
import javax.ws.rs.*;
@ -39,8 +39,7 @@ public class ProfiledDocuments {
@Override
protected Configuration run() throws Exception, WebApplicationException {
//manager.getConfiguration();
throw new Exception("Implement This Method");
return manager.getConfiguration();
}
}.execute().getResult();
}

View File

@ -3,7 +3,7 @@ package org.gcube.application.geoportal.service.utils;
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;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.common.encryption.encrypter.StringEncrypter;
import org.gcube.common.resources.gcore.ServiceEndpoint;
import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;

View File

@ -0,0 +1,22 @@
{
"profile_id": "..",
"context" : "...",
"last_updated" : "",
"indexes" : [
{"_type" : "GIS-CENTROIDS"},
{"_type" : "TEXT-INDEX"},
{"_type" : "GEONETWORK-CATALOG"},
{"_type" : "CKAN-CATALOG"}
],
"archives" : [
{"_type" : "WS-STORAGE",
"folder_id" : "..."
},
{"_type" : "DOCUMENT-STORE-COLLECTION",
"count" : 10000,
"collection_name" : "...."}
]
}

View File

@ -0,0 +1,19 @@
{"_type" : "GIS-CENTROIDS",
"platform" : {"type": "GeoServer",
"ogc_links" : [
{"wms": ""},{"wfs": ""},{"csw": ""}
],
"is-coordinates" : {}
},
"centroids_layer" : {"<layer_info>":".."},
"cross_filtering_layers" : [
{"<layer info>" : "..",
"link" : [
{"source_field" : "..",
"target_field" : "..",
"target_layer_name" : ""}
]}
]
}

View File

@ -0,0 +1,13 @@
{
"ogc_links" : [
{"wms":""},{"wfs": ""},{"csw": ""}
],
"platform_info" : [
{"_type" : "Geoserver",
"layername" : "...",
"workspace" : ""},
{"_type" : "GeoNetwork",
"layerID" : 0,
"layerUUID" : ".."}
]
}

View File

@ -2,7 +2,6 @@ package org.gcube.application.geoportal.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.mongodb.Block;
import com.mongodb.MongoClient;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.Projections;
@ -12,7 +11,7 @@ import org.gcube.application.geoportal.service.engine.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;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.junit.BeforeClass;
import org.junit.Test;

View File

@ -4,7 +4,7 @@ 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.geoportal.service.engine.providers.StorageClientProvider;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import java.io.IOException;

View File

@ -1,6 +1,5 @@
package org.gcube.application.geoportal.service.engine.caches;
import ch.qos.logback.core.net.SyslogOutputStream;
import com.mongodb.MongoWaitQueueFullException;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.cms.tests.TokenSetter;
@ -10,9 +9,7 @@ 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.geoportal.service.engine.mongo.ConcessioniMongoManager;
import org.gcube.application.geoportal.service.engine.providers.AbstractScopedMap;
import org.gcube.application.geoportal.service.engine.providers.TTLObject;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.junit.Test;
import java.io.File;
@ -21,7 +18,6 @@ import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalUnit;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

View File

@ -1,9 +1,8 @@
package org.gcube.application.geoportal.service.engine.caches;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.service.engine.providers.AbstractScopedMap;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import java.time.LocalDateTime;

View File

@ -10,7 +10,7 @@ import org.gcube.application.geoportal.common.model.legacy.GeoServerContent;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.application.geoportal.service.engine.postgis.PostgisIndex;
import org.gcube.application.geoportal.service.model.internal.faults.ConfigurationException;
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
import org.gcube.application.geoportal.service.model.internal.faults.SDIInteractionException;
import org.gcube.application.cms.serialization.Serialization;
import org.junit.Assert;