package org.gcube.data_catalogue.grsf_publish_ws.utils.threads; import java.beans.IntrospectionException; import java.lang.reflect.InvocationTargetException; import org.gcube.data_catalogue.grsf_publish_ws.json.input.Common; import org.gcube.data_catalogue.grsf_publish_ws.utils.HelperMethods; import org.gcube.datacatalogue.ckanutillibrary.DataCatalogue; import org.slf4j.LoggerFactory; /** * Extract the time series present in the record, load them as resource on ckan and on the .catalogue * folder under the vre folder. * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) */ public class ManageTimeSeriesThread extends Thread{ // Logger private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ManageTimeSeriesThread.class); private Common record; private String packageId; private String username; private DataCatalogue catalogue; private String context; /** * @param record * @param packageId * @param username * @param catalogue * @param context */ public ManageTimeSeriesThread(Common record, String packageId, String username, DataCatalogue catalogue, String context) { super(); this.record = record; this.packageId = packageId; this.username = username; this.catalogue = catalogue; this.context = context; } @Override public void run() { logger.info("Time series manager thread started"); try { HelperMethods.manageTimeSeries(record, packageId, username, catalogue, context); logger.info("The time series manager thread ended correctly"); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | IntrospectionException e) { logger.error("Failed to attach csv files to the product..."); } } }