diff --git a/sdi-plugins/CHANGELOG.md b/sdi-plugins/CHANGELOG.md
index 436af56..e41af96 100644
--- a/sdi-plugins/CHANGELOG.md
+++ b/sdi-plugins/CHANGELOG.md
@@ -1,7 +1,9 @@
# Changelog for org.gcube.application.cms.sdi-plugins
-## [v1.1.0]
+## [v1.1.1-SNAPSHOT]
+- Improved some logs
+## [v1.1.0]
- Integrated the field 'geov_link' (Geoportal GisViewer link) in the centroid layer [#24859]
## [v1.0.4] - 2023-03-06
diff --git a/sdi-plugins/pom.xml b/sdi-plugins/pom.xml
index 292a12b..6702513 100644
--- a/sdi-plugins/pom.xml
+++ b/sdi-plugins/pom.xml
@@ -5,7 +5,7 @@
4.0.0
sdi-plugins
- 1.1.0
+ 1.1.1-SNAPSHOT
gCube CMS - SDI Plugins
diff --git a/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIIndexerPlugin.java b/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIIndexerPlugin.java
index 98ad5c5..5de88de 100644
--- a/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIIndexerPlugin.java
+++ b/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIIndexerPlugin.java
@@ -50,6 +50,15 @@ import com.vdurmont.semver4j.Semver;
import lombok.extern.slf4j.Slf4j;
+
+/**
+ * The Class SDIIndexerPlugin.
+ *
+ * @author created by Fabio Sinibaldi
+ * @author new architect and maintainer - Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
+ *
+ * Apr 28, 2023
+ */
@Slf4j
public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPluginInterface {
@@ -67,11 +76,22 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
}
+ /**
+ * Gets the descriptor.
+ *
+ * @return the descriptor
+ */
@Override
public PluginDescriptor getDescriptor() {
return DESCRIPTOR;
}
+ /**
+ * Inits the in context.
+ *
+ * @return the initialization report
+ * @throws InitializationException the initialization exception
+ */
@Override
public InitializationReport initInContext() throws InitializationException {
InitializationReport report = new InitializationReport();
@@ -90,8 +110,9 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
@Override
public IndexDocumentReport index(IndexDocumentRequest request) throws InvalidPluginRequestException {
-
- log.info("Indexer {} : Serving Index Request {} ", this.getDescriptor().getId(), request);
+ log.info("Serving Indexer {} : request CallParameters {}, request Context {}: ", this.getDescriptor().getId(),
+ request.getCallParameters(), request.getContext());
+ log.debug("Indexer {} : Serving Request {} ", this.getDescriptor().getId(), request);
Project project = request.getDocument();
UseCaseDescriptor useCaseDescriptor = request.getUseCaseDescriptor();
@@ -123,8 +144,7 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
// Added by Francesco. Creating Gis Viewer Link as public or private
Boolean isInternalIndex = null;
try {
- isInternalIndex = requestArguments
- .getBoolean(IndexConstants.INDEX_PARAMETER_FLAGINTERNALINDEX);
+ isInternalIndex = requestArguments.getBoolean(IndexConstants.INDEX_PARAMETER_FLAGINTERNALINDEX);
log.debug(IndexConstants.INDEX_PARAMETER_FLAGINTERNALINDEX + " read as {} ", isInternalIndex);
} catch (Exception e) {
// TODO: handle exception
@@ -281,13 +301,29 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
}
}
+ /**
+ * Gets the mappings.
+ *
+ * @param useCaseDescriptor the use case descriptor
+ * @return the mappings
+ * @throws InvalidProfileException the invalid profile exception
+ */
private List getMappings(UseCaseDescriptor useCaseDescriptor) throws InvalidProfileException {
return MappingObject.getMappingsFromUCD(useCaseDescriptor, getDescriptor().getId());
}
+ /**
+ * Deindex.
+ *
+ * @param request the request
+ * @return the index document report
+ * @throws InvalidPluginRequestException the invalid plugin request exception
+ */
@Override
public IndexDocumentReport deindex(IndexDocumentRequest request) throws InvalidPluginRequestException {
- log.info("Indexer {} : Serving Index Request {} ", this.getDescriptor().getId(), request);
+ log.info("Serving DeIndexer {} : request CallParameters {}, request Context {}: ", this.getDescriptor().getId(),
+ request.getCallParameters(), request.getContext());
+ log.debug("DeIndexer {} : Serving Request {} ", this.getDescriptor().getId(), request);
IndexDocumentReport report = new IndexDocumentReport(request);
try {
PostgisIndexer indexer = getIndexer(request.getUseCaseDescriptor(), request.getCallParameters());
@@ -306,11 +342,11 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
}
/**
- * Expected parameters : workspace indexName
+ * Expected parameters : workspace indexName.
*
- * @param request
- * @return
- * @throws ConfigurationException
+ * @param request the request
+ * @return the index
+ * @throws ConfigurationException the configuration exception
*/
@Override
public Index getIndex(BaseRequest request) throws ConfigurationException {
@@ -323,6 +359,17 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
}
// Inits index
+ /**
+ * Gets the indexer.
+ *
+ * @param ucd the ucd
+ * @param params the params
+ * @return the indexer
+ * @throws ConfigurationException the configuration exception
+ * @throws SQLException the SQL exception
+ * @throws InvalidProfileException the invalid profile exception
+ * @throws SDIInteractionException the SDI interaction exception
+ */
// TODO CACHE
private PostgisIndexer getIndexer(UseCaseDescriptor ucd, Document params)
throws ConfigurationException, SQLException, InvalidProfileException, SDIInteractionException {
diff --git a/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIMaterializerPlugin.java b/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIMaterializerPlugin.java
index 8c21815..093b64f 100644
--- a/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIMaterializerPlugin.java
+++ b/sdi-plugins/src/main/java/org/gcube/application/cms/sdi/plugins/SDIMaterializerPlugin.java
@@ -36,9 +36,21 @@ import lombok.Data;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
+
+/**
+ * The Class SDIMaterializerPlugin.
+ *
+ * @author created by Fabio Sinibaldi
+ * @author new architect and maintainer - Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
+ *
+ * Apr 28, 2023
+ */
@Slf4j
public class SDIMaterializerPlugin extends AbstractPlugin implements MaterializationPlugin {
+ /**
+ * Instantiates a new materialization config.
+ */
@Data
public static class MaterializationConfig{
private String schemaField;
@@ -48,12 +60,23 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
Map sdiManagerMap=null;
+ /**
+ * Gets the SDI manager.
+ *
+ * @return the SDI manager
+ */
private SDIManagerWrapper getSDIManager(){
String context = UserUtils.getCurrent().getContext();
log.debug("Getting SDIManagerWrapper from cache map for context {}");
return sdiManagerMap.get(context);
}
+ /**
+ * Inits the in context.
+ *
+ * @return the initialization report
+ * @throws InitializationException the initialization exception
+ */
@Override
@Synchronized
public InitializationReport initInContext() throws InitializationException {
@@ -72,6 +95,12 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
return report;
}
+ /**
+ * Inits the.
+ *
+ * @return the initialization report
+ * @throws InitializationException the initialization exception
+ */
@Override
@Synchronized
public InitializationReport init() throws InitializationException {
@@ -81,6 +110,11 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
return report;
}
+ /**
+ * Shutdown.
+ *
+ * @throws ShutDownException the shut down exception
+ */
@Override
public void shutdown() throws ShutDownException {
@@ -89,15 +123,17 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
/**
* Expected params :
* -workspace MANDATORY
- * -titleField
+ * -titleField.
*
- * @param request
- * @return
- * @throws MaterializationException
+ * @param request the request
+ * @return the materialization report
+ * @throws MaterializationException the materialization exception
+ * @throws InvalidPluginRequestException the invalid plugin request exception
*/
@Override
public MaterializationReport materialize(MaterializationRequest request) throws MaterializationException, InvalidPluginRequestException {
- log.info("Materializer {} : Performing {} ",this.getDescriptor().getId(),request);
+ log.info("Serving Materialize {} : request CallParameters {}, request Context {}: ",this.getDescriptor().getId(), request.getCallParameters(), request.getContext());
+ log.debug("Materialize request {}",request);
Project project =request.getDocument();
UseCaseDescriptor useCaseDescriptor = request.getUseCaseDescriptor();
Document requestArguments=Serialization.convert(request.getCallParameters(),Document.class);
@@ -167,16 +203,17 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
/**
* Expected parameters
- * - fileSetPath
+ * - fileSetPath.
*
- * @param request
- * @return
- * @throws MaterializationException
- * @throws InvalidPluginRequestException
+ * @param request the request
+ * @return the materialization report
+ * @throws MaterializationException the materialization exception
+ * @throws InvalidPluginRequestException the invalid plugin request exception
*/
@Override
public MaterializationReport dematerialize(MaterializationRequest request) throws MaterializationException, InvalidPluginRequestException {
- log.info("Serving DeMaterialization {} ",request);
+ log.info("Serving DeMaterialize {} : request CallParameters {}, request Context {}: ",this.getDescriptor().getId(), request.getCallParameters(), request.getContext());
+ log.debug("DeMaterialize request {}",request);
MaterializationReport report= new MaterializationReport(request);
try{
SDIManagerWrapper sdi=getSDIManager();
@@ -221,6 +258,11 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
DESCRIPTOR.setVersion(new Semver("1.0.0"));
}
+ /**
+ * Gets the descriptor.
+ *
+ * @return the descriptor
+ */
@Override
public PluginDescriptor getDescriptor() {
return DESCRIPTOR;