diff --git a/.classpath b/.classpath index b9263c4..9ffef2d 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,16 @@ - + - + + + + + @@ -18,16 +22,16 @@ - - - - - - + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 1b22d70..4f92af5 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,5 +1,5 @@ - + diff --git a/distro/changelog.xml b/distro/changelog.xml index 0b3a577..1f5e6c3 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,16 +1,23 @@ - + + Support Java 8 compatibility [ticket #8471] + + Updated to support DataMinerManagerWidget [ticket #6078] Fixed load balancing [ticket #7576] - + Updated Monitor interface Added encoded parameters in equivalent http request [ticket #7167] - + first release \ No newline at end of file diff --git a/pom.xml b/pom.xml index b9c16ae..df97933 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.gcube.data.analysis data-miner-manager-cl - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT data-miner-manager-cl DataMiner Manager Client Library diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/DataMinerService.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/DataMinerService.java index 8903375..c0f1301 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/DataMinerService.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/DataMinerService.java @@ -16,8 +16,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DataMinerService { @@ -28,17 +28,17 @@ public class DataMinerService { /** * - * @param userName - * @param scope - * @param token - * @return - * @throws Exception */ - public DataMinerService() { // cachedSClients= new HashMap<>(); } + /** + * + * @return SClient + * @throws Exception + * exception + */ public SClient getClient() throws Exception { ServiceCredentials serviceCredential = getServiceCredentials(); @@ -62,6 +62,14 @@ public class DataMinerService { } + /** + * + * @param token + * token + * @return SClient + * @throws Exception + * Exception + */ public SClient getClient(String token) throws Exception { ServiceCredentials serviceCredential = getServiceCredentials(token); @@ -88,14 +96,14 @@ public class DataMinerService { /** * * @param token + * token * @param serviceAddressUrl - * valid url for example: - * http://dataminer1-devnext.d4science.org/wps/ - * @return + * service address url + * @return SClient * @throws Exception + * exception */ - public SClient getClient(String token, String serviceAddressUrl) - throws Exception { + public SClient getClient(String token, String serviceAddressUrl) throws Exception { ServiceCredentials serviceCredential = getServiceCredentials(token); @@ -104,8 +112,7 @@ public class DataMinerService { * !cachedSClients.containsKey(serviceCredential.getScope())) { */ - SClientBuilder sBuilder = new SClient4WPSBuilder(serviceCredential, - serviceAddressUrl); + SClientBuilder sBuilder = new SClient4WPSBuilder(serviceCredential, serviceAddressUrl); SClientDirector director = new SClientDirector(); director.setSClientBuilder(sBuilder); director.constructSClient(); @@ -143,16 +150,14 @@ public class DataMinerService { userName = entry.getClientInfo().getId(); scope = entry.getContext(); } catch (Exception e) { - logger.error("Error Retrieving token credentials: " - + e.getLocalizedMessage()); + logger.error("Error Retrieving token credentials: " + e.getLocalizedMessage()); e.printStackTrace(); throw new ServiceException(e.getLocalizedMessage(), e); } } - ServiceCredentials serviceCredential = new ServiceCredentials(userName, - scope, token); + ServiceCredentials serviceCredential = new ServiceCredentials(userName, scope, token); logger.debug("Credential: " + serviceCredential); @@ -160,8 +165,7 @@ public class DataMinerService { } - private ServiceCredentials getServiceCredentials(String token) - throws ServiceException { + private ServiceCredentials getServiceCredentials(String token) throws ServiceException { String userName = null; String scope = null; @@ -173,10 +177,8 @@ public class DataMinerService { } else { logger.debug("Production Mode"); if (token == null || token.isEmpty()) { - logger.error("Error Retrieving token credentials: token=" - + token); - throw new ServiceException( - "Error Retrieving token credentials: token=" + token); + logger.error("Error Retrieving token credentials: token=" + token); + throw new ServiceException("Error Retrieving token credentials: token=" + token); } try { @@ -185,16 +187,14 @@ public class DataMinerService { userName = entry.getClientInfo().getId(); scope = entry.getContext(); } catch (Exception e) { - logger.error("Error Retrieving token credentials: " - + e.getLocalizedMessage()); + logger.error("Error Retrieving token credentials: " + e.getLocalizedMessage()); e.printStackTrace(); throw new ServiceException(e.getLocalizedMessage(), e); } } - ServiceCredentials serviceCredential = new ServiceCredentials(userName, - scope, token); + ServiceCredentials serviceCredential = new ServiceCredentials(userName, scope, token); logger.debug("Credential: " + serviceCredential); diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient.java index 6369d34..036266c 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient.java @@ -16,8 +16,8 @@ import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorsClassi * * Client of service * - * @author giancarlo email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public abstract class SClient implements Serializable { @@ -31,19 +31,20 @@ public abstract class SClient implements Serializable { /** * Retrieve the list of operators * - * @return + * @return list of operators classification * @throws Exception + * exception */ - public abstract List getOperatorsClassifications() - throws Exception; + public abstract List getOperatorsClassifications() throws Exception; /** * Retrieve the operator by id * * @param id * operator id - * @return + * @return operator * @throws Exception + * exception */ public abstract Operator getOperatorById(String id) throws Exception; @@ -52,86 +53,90 @@ public abstract class SClient implements Serializable { * * @param operator * operator - * @return + * @return list of parameter * @throws Exception + * exception */ - public abstract List getInputParameters(Operator operator) - throws Exception; + public abstract List getInputParameters(Operator operator) throws Exception; /** * * Get output paramters of the operator * * @param operator - * @return + * operator + * @return list of parameter * @throws Exception + * exception */ - public abstract List getOutputParameters(Operator operator) - throws Exception; + public abstract List getOutputParameters(Operator operator) throws Exception; /** * Start Computation * * @param operator * operator - * @return + * @return computation id * @throws Exception + * exception */ - public abstract ComputationId startComputation(Operator operator) - throws Exception; + public abstract ComputationId startComputation(Operator operator) throws Exception; /** * Cancel a computation * * @param computationId * computation Id - * @return + * @return cancel * @throws Exception + * exception */ - public abstract String cancelComputation(ComputationId computationId) - throws Exception; + public abstract String cancelComputation(ComputationId computationId) throws Exception; /** * Get Computation Status * * @param computationId * computation Id - * @return + * @return computation status * @throws Exception + * exception */ - public abstract ComputationStatus getComputationStatus( - ComputationId computationId) throws Exception; + public abstract ComputationStatus getComputationStatus(ComputationId computationId) throws Exception; /** * Get Output of computation * * @param computationId - * @return + * computation id + * @return output data * @throws Exception + * exception */ - public abstract OutputData getOutputDataByComputationId( - ComputationId computationId) throws Exception; + public abstract OutputData getOutputDataByComputationId(ComputationId computationId) throws Exception; /** * Get Computation Data by computation properties * * @param computationProperties * computation properties - * @return + * @return computation data * @throws Exception + * exception */ - public abstract ComputationData getComputationDataByComputationProperties( - Map computationProperties) throws Exception; + public abstract ComputationData getComputationDataByComputationProperties(Map computationProperties) + throws Exception; /** * Resubmit a computation only by computation properties * * @param computationProperties - * @return + * map of computation properties + * @return computation id * @throws Exception + * exception */ - public abstract ComputationId resubmitComputation( - Map computationProperties) throws Exception; + public abstract ComputationId resubmitComputation(Map computationProperties) throws Exception; @Override public String toString() { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPS.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPS.java index 43dc3e5..d0afa71 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPS.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPS.java @@ -72,8 +72,8 @@ import org.w3c.dom.NodeList; * Client 4 WPS Service * * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class SClient4WPS extends SClient { @@ -100,10 +100,11 @@ public class SClient4WPS extends SClient { /** * * @param serviceCredentials + * sevice credentials * @throws ServiceException + * ServiceException */ - public SClient4WPS(ServiceCredentials serviceCredentials) - throws ServiceException { + public SClient4WPS(ServiceCredentials serviceCredentials) throws ServiceException { super(); process = new HashMap<>(); runningProcess = new HashMap<>(); @@ -114,8 +115,7 @@ public class SClient4WPS extends SClient { String token = serviceCredentials.getToken(); if (token == null || token.isEmpty()) { logger.error("Error authorization token invalid: " + token); - throw new ServiceException( - "Error authorization token invalid: " + token); + throw new ServiceException("Error authorization token invalid: " + token); } else { wpsToken = token; } @@ -123,47 +123,36 @@ public class SClient4WPS extends SClient { String userName = serviceCredentials.getUserName(); if (userName == null || userName.isEmpty()) { logger.error("Error invalid user name: " + userName); - throw new ServiceException("Error invalid user name: " - + userName); + throw new ServiceException("Error invalid user name: " + userName); } else { wpsUser = userName; } List serviceAddress; try { - serviceAddress = InformationSystemUtils.retrieveServiceAddress( - Constants.DATAMINER_SERVICE_CATEGORY, - Constants.DATA_MINER_SERVICE_NAME, - serviceCredentials.getScope()); + serviceAddress = InformationSystemUtils.retrieveServiceAddress(Constants.DATAMINER_SERVICE_CATEGORY, + Constants.DATA_MINER_SERVICE_NAME, serviceCredentials.getScope()); } catch (Exception e) { - logger.error("Error retrieving service address: " - + e.getLocalizedMessage()); + logger.error("Error retrieving service address: " + e.getLocalizedMessage()); e.printStackTrace(); throw new ServiceException(e.getLocalizedMessage(), e); } logger.debug("Service Address retrieved:" + serviceAddress); if (serviceAddress == null || serviceAddress.size() < 1) { logger.error("No DataMiner service address available!"); - throw new ServiceException( - "No DataMiner service address available!"); + throw new ServiceException("No DataMiner service address available!"); } else { - logger.info("DataMiner service address found: " - + serviceAddress.get(0)); + logger.info("DataMiner service address found: " + serviceAddress.get(0)); wpsProcessingServlet = serviceAddress.get(0); - int wpsWebProcessingServiceIndex = wpsProcessingServlet - .indexOf(Constants.WPSWebProcessingService); + int wpsWebProcessingServiceIndex = wpsProcessingServlet.indexOf(Constants.WPSWebProcessingService); if (wpsWebProcessingServiceIndex > 0) { - String wpsServiceUrl = wpsProcessingServlet.substring(0, - wpsWebProcessingServiceIndex); - wpsCancelComputationServlet = wpsServiceUrl - + Constants.WPSCancelComputationServlet; - logger.debug("Cancel computation servlet: " - + wpsCancelComputationServlet); + String wpsServiceUrl = wpsProcessingServlet.substring(0, wpsWebProcessingServiceIndex); + wpsCancelComputationServlet = wpsServiceUrl + Constants.WPSCancelComputationServlet; + logger.debug("Cancel computation servlet: " + wpsCancelComputationServlet); } else { logger.error("Cancel computation servlet not available!"); - throw new ServiceException( - "Cancel computation servlet not available!"); + throw new ServiceException("Cancel computation servlet not available!"); } } @@ -175,13 +164,14 @@ public class SClient4WPS extends SClient { /** * * @param serviceCredentials + * sevice credentials * @param serviceAddressUrl * valid url for example: * http://dataminer1-devnext.d4science.org/wps/ * @throws ServiceException + * ServiceException */ - public SClient4WPS(ServiceCredentials serviceCredentials, - String serviceAddressUrl) throws ServiceException { + public SClient4WPS(ServiceCredentials serviceCredentials, String serviceAddressUrl) throws ServiceException { super(); process = new HashMap<>(); runningProcess = new HashMap<>(); @@ -192,8 +182,7 @@ public class SClient4WPS extends SClient { String token = serviceCredentials.getToken(); if (token == null || token.isEmpty()) { logger.error("Error authorization token invalid: " + token); - throw new ServiceException( - "Error authorization token invalid: " + token); + throw new ServiceException("Error authorization token invalid: " + token); } else { wpsToken = token; } @@ -201,26 +190,20 @@ public class SClient4WPS extends SClient { String userName = serviceCredentials.getUserName(); if (userName == null || userName.isEmpty()) { logger.error("Error invalid user name: " + userName); - throw new ServiceException("Error invalid user name: " - + userName); + throw new ServiceException("Error invalid user name: " + userName); } else { wpsUser = userName; } logger.debug("Service Address:" + serviceAddressUrl); if (serviceAddressUrl == null || serviceAddressUrl.isEmpty()) { - logger.error("Invalid DataMiner service address: " - + serviceAddressUrl); - throw new ServiceException( - "Invalid DataMiner service address: " - + serviceAddressUrl); + logger.error("Invalid DataMiner service address: " + serviceAddressUrl); + throw new ServiceException("Invalid DataMiner service address: " + serviceAddressUrl); } else { logger.debug("DataMiner service address: " + serviceAddressUrl); // http://dataminer1-devnext.d4science.org/wps/WebProcessingService - wpsProcessingServlet = serviceAddressUrl - + Constants.WPSWebProcessingService; - wpsCancelComputationServlet = serviceAddressUrl - + Constants.WPSCancelComputationServlet; + wpsProcessingServlet = serviceAddressUrl + Constants.WPSWebProcessingService; + wpsCancelComputationServlet = serviceAddressUrl + Constants.WPSCancelComputationServlet; } @@ -249,8 +232,7 @@ public class SClient4WPS extends SClient { List operatorsClassifications = getOperatorsClassifications(); - if (operatorsClassifications != null - && operatorsClassifications.size() > 0) { + if (operatorsClassifications != null && operatorsClassifications.size() > 0) { Operator operator = null; for (OperatorsClassification oc : operatorsClassifications) { for (Operator op : oc.getOperators()) { @@ -270,8 +252,7 @@ public class SClient4WPS extends SClient { logger.error(error); throw new ServiceException(error); } else { - logger.debug("Operator Name: " + operator.getName() + " (" - + operator.getId() + ")"); + logger.debug("Operator Name: " + operator.getName() + " (" + operator.getId() + ")"); logger.debug("Operator: " + operator); return operator; } @@ -286,8 +267,7 @@ public class SClient4WPS extends SClient { } @Override - public List getOperatorsClassifications() - throws ServiceException { + public List getOperatorsClassifications() throws ServiceException { LinkedHashMap operatorsToCategoriesMap = new LinkedHashMap<>(); LinkedHashMap> categoriesToOperatorsMap = new LinkedHashMap<>(); @@ -310,34 +290,26 @@ public class SClient4WPS extends SClient { categoryName = categorySplitted[0]; } } - operatorsToCategoriesMap.put(processBrief.getIdentifier() - .getStringValue(), categoryName); + operatorsToCategoriesMap.put(processBrief.getIdentifier().getStringValue(), categoryName); } String briefDescription; for (ProcessBriefType processDescriptionType : processesDescriptionType) { - briefDescription = processDescriptionType.getAbstract() - .getStringValue(); + briefDescription = processDescriptionType.getAbstract().getStringValue(); - String categoryName = operatorsToCategoriesMap - .get(processDescriptionType.getIdentifier() - .getStringValue()); + String categoryName = operatorsToCategoriesMap.get(processDescriptionType.getIdentifier().getStringValue()); if (categoryName == null || categoryName.isEmpty()) { categoryName = OTHERS; } - List listOperators = categoriesToOperatorsMap - .get(categoryName); + List listOperators = categoriesToOperatorsMap.get(categoryName); if (listOperators == null) { listOperators = new ArrayList<>(); } - listOperators - .add(new Operator(processDescriptionType.getIdentifier() - .getStringValue(), processDescriptionType - .getTitle().getStringValue(), briefDescription, - processDescriptionType.getAbstract() - .getStringValue(), null)); + listOperators.add(new Operator(processDescriptionType.getIdentifier().getStringValue(), + processDescriptionType.getTitle().getStringValue(), briefDescription, + processDescriptionType.getAbstract().getStringValue(), null)); categoriesToOperatorsMap.put(categoryName, listOperators); @@ -359,10 +331,8 @@ public class SClient4WPS extends SClient { }; for (String categoryName : categoriesToOperatorsMap.keySet()) { - OperatorCategory category = new OperatorCategory(categoryName, - categoryName, categoryName); - List listOperators = categoriesToOperatorsMap - .get(categoryName); + OperatorCategory category = new OperatorCategory(categoryName, categoryName, categoryName); + List listOperators = categoriesToOperatorsMap.get(categoryName); for (Operator operator : listOperators) { operator.setCategory(category); } @@ -377,8 +347,8 @@ public class SClient4WPS extends SClient { List operatorsClass = new ArrayList<>(); - OperatorsClassification op = new OperatorsClassification( - Constants.UserClassificationName, categories, operators); + OperatorsClassification op = new OperatorsClassification(Constants.UserClassificationName, categories, + operators); operatorsClass.add(op); @@ -386,13 +356,11 @@ public class SClient4WPS extends SClient { return operatorsClass; } - private ProcessInformations describeProcess(String processId) - throws ServiceException { + private ProcessInformations describeProcess(String processId) throws ServiceException { return describeProcess(processId, null); } - private ProcessInformations describeProcess(String processId, - URL processDescriptionURL) throws ServiceException { + private ProcessInformations describeProcess(String processId, URL processDescriptionURL) throws ServiceException { if (process.containsKey(processId)) { return process.get(processId); } @@ -405,11 +373,9 @@ public class SClient4WPS extends SClient { ProcessDescriptionType processDescription = null; for (int k = 0; k <= 3; k++) { try { - processDescription = wpsClient.getProcessDescription( - wpsProcessingServlet, processId); + processDescription = wpsClient.getProcessDescription(wpsProcessingServlet, processId); } catch (Throwable e) { - logger.error("Error getProcessDescription for process " - + processId + " with WPS URL: " + logger.error("Error getProcessDescription for process " + processId + " with WPS URL: " + wpsProcessingServlet); if (k == 3) throw e; @@ -418,24 +384,20 @@ public class SClient4WPS extends SClient { break; } - ProcessInformations processInformations = new ProcessInformations( - processDescription); + ProcessInformations processInformations = new ProcessInformations(processDescription); if (processDescriptionURL != null) - processDescription.set(XmlString.Factory - .parse(processDescriptionURL)); + processDescription.set(XmlString.Factory.parse(processDescriptionURL)); logger.debug("ProcessDescription: " + processDescription); - InputDescriptionType[] inputList = processDescription - .getDataInputs().getInputArray(); + InputDescriptionType[] inputList = processDescription.getDataInputs().getInputArray(); logger.debug("WPSClient->Fetching Inputs"); for (InputDescriptionType input : inputList) { logger.debug("WPSClient->Input: " + input); } - OutputDescriptionType[] outputList = processDescription - .getProcessOutputs().getOutputArray(); + OutputDescriptionType[] outputList = processDescription.getProcessOutputs().getOutputArray(); logger.debug("WPSClient->Fetching Outputs"); for (OutputDescriptionType output : outputList) { logger.debug("WPSClient->Output: " + output); @@ -466,22 +428,17 @@ public class SClient4WPS extends SClient { wpsClient.connect(wpsProcessingServlet); - processesDescriptionType = wpsClient - .getAllProcessDescriptions(wpsProcessingServlet); + processesDescriptionType = wpsClient.getAllProcessDescriptions(wpsProcessingServlet); - CapabilitiesDocument capabilitiesDocument = wpsClient - .getWPSCaps(wpsProcessingServlet); + CapabilitiesDocument capabilitiesDocument = wpsClient.getWPSCaps(wpsProcessingServlet); - Operation[] operations = capabilitiesDocument.getCapabilities() - .getOperationsMetadata().getOperationArray(); + Operation[] operations = capabilitiesDocument.getCapabilities().getOperationsMetadata().getOperationArray(); for (Operation operation : operations) { - operation.getDCPArray()[0].getHTTP().getPostArray()[0] - .setHref(wpsProcessingServlet + "?"); + operation.getDCPArray()[0].getHTTP().getPostArray()[0].setHref(wpsProcessingServlet + "?"); } - - processesBriefs = capabilitiesDocument.getCapabilities() - .getProcessOfferings().getProcessArray(); + + processesBriefs = capabilitiesDocument.getCapabilities().getProcessOfferings().getProcessArray(); return; } catch (Throwable e) { @@ -496,20 +453,18 @@ public class SClient4WPS extends SClient { } - private String executeProcessAsync(ExecuteRequestBuilder executeBuilder, - ProcessDescriptionType processDescription) throws ServiceException { + private String executeProcessAsync(ExecuteRequestBuilder executeBuilder, ProcessDescriptionType processDescription) + throws ServiceException { SClient4WPSSession wpsClient = null; try { try { - OutputDescriptionType[] odts = processDescription - .getProcessOutputs().getOutputArray(); + OutputDescriptionType[] odts = processDescription.getProcessOutputs().getOutputArray(); for (OutputDescriptionType odt : odts) { // executeBuilder.setMimeTypeForOutput("text/xml", // "result"); if (odt.isSetComplexOutput()) - executeBuilder.setMimeTypeForOutput("text/xml", odt - .getIdentifier().getStringValue()); + executeBuilder.setMimeTypeForOutput("text/xml", odt.getIdentifier().getStringValue()); } } catch (Exception e) { logger.debug("Execute Process-> Warning, no xml structured objects will be provided: " @@ -521,43 +476,36 @@ public class SClient4WPS extends SClient { ExecuteDocument execute = executeBuilder.getExecute(); execute.getExecute().setService("WPS"); - // System.out.println("RESPONSE FORM:"+execute.getExecute().getResponseForm()); + // System.out.println("RESPONSE + // FORM:"+execute.getExecute().getResponseForm()); wpsClient = createWPSClientSession(); wpsClient.connect(wpsProcessingServlet); logger.debug("Sending: " + execute); if (execute.getExecute().getResponseForm() != null) { - ResponseDocumentType documentType = execute.getExecute() - .getResponseForm().getResponseDocument(); + ResponseDocumentType documentType = execute.getExecute().getResponseForm().getResponseDocument(); documentType.setStoreExecuteResponse(true); documentType.setStatus(true); documentType.setLineage(false); - execute.getExecute().getResponseForm() - .setResponseDocument(documentType); + execute.getExecute().getResponseForm().setResponseDocument(documentType); } - Object responseObject = wpsClient.execute(wpsProcessingServlet, - execute); + Object responseObject = wpsClient.execute(wpsProcessingServlet, execute); String processLocation = null; Date creationData = null; if (responseObject != null) { if (responseObject instanceof ExecuteResponseDocumentImpl) { ExecuteResponseDocumentImpl executeResponseDocumentImpl = ((ExecuteResponseDocumentImpl) responseObject); - processLocation = executeResponseDocumentImpl - .getExecuteResponse().getStatusLocation(); - creationData = executeResponseDocumentImpl - .getExecuteResponse().getStatus().getCreationTime() + processLocation = executeResponseDocumentImpl.getExecuteResponse().getStatusLocation(); + creationData = executeResponseDocumentImpl.getExecuteResponse().getStatus().getCreationTime() .getTime(); } else { - throw new ServiceException( - "Invalid response from service, " - + "response isn't instance of ExecuteResponseDocumentImpl, class is " - + responseObject.getClass()); + throw new ServiceException("Invalid response from service, " + + "response isn't instance of ExecuteResponseDocumentImpl, class is " + + responseObject.getClass()); } } else { - throw new ServiceException("Invalid Response from service, " - + responseObject); + throw new ServiceException("Invalid Response from service, " + responseObject); } - logger.debug("Retrieved: [ProcessLocation=" + processLocation - + ", CreationDate=" + creationData + "]"); + logger.debug("Retrieved: [ProcessLocation=" + processLocation + ", CreationDate=" + creationData + "]"); return processLocation; } catch (Throwable e) { @@ -569,14 +517,12 @@ public class SClient4WPS extends SClient { if (wpsClient != null) wpsClient.disconnect(wpsProcessingServlet); } catch (Exception e) { - logger.debug("Problems in wps disconnect! " - + e.getLocalizedMessage()); + logger.debug("Problems in wps disconnect! " + e.getLocalizedMessage()); } } } - private ProcessOutputs retrieveProcessResult(String processLocation) - throws ServiceException { + private ProcessOutputs retrieveProcessResult(String processLocation) throws ServiceException { SClient4WPSSession wpsClient = null; try { logger.debug("RetrieveProcessResult: " + processLocation); @@ -591,8 +537,7 @@ public class SClient4WPS extends SClient { throw new ServiceException("Process Location is null!"); logger.debug("Response:\n" + responseObject); - return ((ExecuteResponseDocument) responseObject) - .getExecuteResponse().getProcessOutputs(); + return ((ExecuteResponseDocument) responseObject).getExecuteResponse().getProcessOutputs(); } catch (Throwable e) { logger.debug("RetrieveProcessResult: " + e.getLocalizedMessage()); @@ -617,16 +562,14 @@ public class SClient4WPS extends SClient { return dimcounter; } - private static void addBoundingBoxInput( - org.n52.wps.client.ExecuteRequestBuilder executeBuilder, - String identifier, String BBstring) { + private static void addBoundingBoxInput(org.n52.wps.client.ExecuteRequestBuilder executeBuilder, String identifier, + String BBstring) { ExecuteDocument executor = executeBuilder.getExecute(); InputType input1 = executor.getExecute().getDataInputs().addNewInput(); input1.addNewIdentifier().setStringValue(identifier); - net.opengis.ows.x11.BoundingBoxType bbtype = input1.addNewData() - .addNewBoundingBoxData(); + net.opengis.ows.x11.BoundingBoxType bbtype = input1.addNewData().addNewBoundingBoxData(); // bboxInput=46,102,47,103,urn:ogc:def:crs:EPSG:6.6:4326,2 String[] bbinput = BBstring.split(","); @@ -653,8 +596,7 @@ public class SClient4WPS extends SClient { } - private static LinkedHashMap retrieveURLsFromWPSResponse( - ComplexDataType cdt) { + private static LinkedHashMap retrieveURLsFromWPSResponse(ComplexDataType cdt) { org.w3c.dom.Node node = cdt.getDomNode(); LinkedHashMap urls = new LinkedHashMap<>(); getURLFromXML(node, urls); @@ -679,8 +621,7 @@ public class SClient4WPS extends SClient { * "Backend error in WPS Execution"; } } */ - private static void getURLFromXML(org.w3c.dom.Node node, - ResponseWPS responseWPS) { + private static void getURLFromXML(org.w3c.dom.Node node, ResponseWPS responseWPS) { if (node == null) return; @@ -717,8 +658,7 @@ public class SClient4WPS extends SClient { } - private static void getURLFromXML(org.w3c.dom.Node node, - LinkedHashMap urls) { + private static void getURLFromXML(org.w3c.dom.Node node, LinkedHashMap urls) { if (node == null) return; @@ -780,8 +720,7 @@ public class SClient4WPS extends SClient { // TODO @Override - public List getInputParameters(Operator operator) - throws ServiceException { + public List getInputParameters(Operator operator) throws ServiceException { try { logger.debug("Input Parameters of algorithm " + operator.getId()); @@ -799,8 +738,7 @@ public class SClient4WPS extends SClient { List parameters = new ArrayList<>(); Parameter inputParameter; - for (InputDescriptionType inputDesc : processInformations - .getInputs()) { + for (InputDescriptionType inputDesc : processInformations.getInputs()) { inputParameter = WPS2DM.convert2DMType(inputDesc); logger.debug("InputParameter: " + inputParameter); parameters.add(inputParameter); @@ -810,16 +748,14 @@ public class SClient4WPS extends SClient { return parameters; } catch (Throwable e) { - logger.error("Error in getInputParameters: "+e.getLocalizedMessage(),e); + logger.error("Error in getInputParameters: " + e.getLocalizedMessage(), e); throw new ServiceException(e.getLocalizedMessage()); } } - - + @Override - public List getOutputParameters(Operator operator) - throws Exception { + public List getOutputParameters(Operator operator) throws Exception { try { logger.debug("Output Parameters of algorithm " + operator.getId()); @@ -837,8 +773,7 @@ public class SClient4WPS extends SClient { List parameters = new ArrayList<>(); Parameter outputParameter; - for (OutputDescriptionType outputDesc : processInformations - .getOutputs()) { + for (OutputDescriptionType outputDesc : processInformations.getOutputs()) { outputParameter = WPS2DM.convert2DMType(outputDesc); logger.debug("OutputParameter: " + outputParameter); parameters.add(outputParameter); @@ -848,16 +783,14 @@ public class SClient4WPS extends SClient { return parameters; } catch (Throwable e) { - logger.error("Error in getOutputParameters: "+e.getLocalizedMessage(),e); + logger.error("Error in getOutputParameters: " + e.getLocalizedMessage(), e); throw new ServiceException(e.getLocalizedMessage()); } } - @Override - public ComputationId startComputation(Operator operator) - throws ServiceException { + public ComputationId startComputation(Operator operator) throws ServiceException { ProcessInformations processInformations; try { processInformations = describeProcess(operator.getId()); @@ -880,13 +813,11 @@ public class SClient4WPS extends SClient { Map userInputs = new LinkedHashMap<>(); for (Parameter parm : params) { userInputs.put(parm.getName(), parm.getValue()); - logger.debug("UserInputs[key=" + parm.getName() + ", value=" - + parm.getValue() + "]"); + logger.debug("UserInputs[key=" + parm.getName() + ", value=" + parm.getValue() + "]"); } LinkedHashMap equivalentRequestMap = new LinkedHashMap<>(); - String processUrl = compute(processInformations, userInputs, - inputParameters, equivalentRequestMap); + String processUrl = compute(processInformations, userInputs, inputParameters, equivalentRequestMap); logger.debug("Stated Computation ProcessLocation:" + processUrl); int idIndex = processUrl.lastIndexOf("?id="); @@ -898,11 +829,10 @@ public class SClient4WPS extends SClient { throw new ServiceException("Invalid processLocation: " + processUrl); } - String equivalentRequest = extractEquivalentRequestForComputation( - operator, equivalentRequestMap); + String equivalentRequest = extractEquivalentRequestForComputation(operator, equivalentRequestMap); - ComputationId computationId = new ComputationId(id, processUrl, - operator.getId(), operator.getName(), equivalentRequest); + ComputationId computationId = new ComputationId(id, processUrl, operator.getId(), operator.getName(), + equivalentRequest); logger.debug("ComputationId: " + computationId); runningProcess.put(computationId, processInformations); @@ -912,109 +842,80 @@ public class SClient4WPS extends SClient { private String extractEquivalentRequestForComputation(Operator operator, LinkedHashMap equivalentRequestMap) { - String equivalentRequest = wpsProcessingServlet + "?" - + "request=Execute&service=WPS&Version=1.0.0&gcube-token=" - + wpsToken + "&lang=en-US&Identifier=" + operator.getId() - + "&DataInputs="; + String equivalentRequest = wpsProcessingServlet + "?" + "request=Execute&service=WPS&Version=1.0.0&gcube-token=" + + wpsToken + "&lang=en-US&Identifier=" + operator.getId() + "&DataInputs="; for (String key : equivalentRequestMap.keySet()) { String keyEncoded = ""; try { keyEncoded = URLEncoder.encode(key, "UTF-8"); } catch (UnsupportedEncodingException e) { - logger.error( - "Error in equivalent request creation: Unsupported Encoding for parameter=" - + key, e); + logger.error("Error in equivalent request creation: Unsupported Encoding for parameter=" + key, e); break; } String valueEncoded = ""; try { - valueEncoded = URLEncoder.encode(equivalentRequestMap.get(key), - "UTF-8"); + valueEncoded = URLEncoder.encode(equivalentRequestMap.get(key), "UTF-8"); } catch (UnsupportedEncodingException e) { - logger.error( - "Error in equivalent request creation: Unsupported Encoding for value=" - + equivalentRequestMap.get(key) - + " of parameter=" + key, e); + logger.error("Error in equivalent request creation: Unsupported Encoding for value=" + + equivalentRequestMap.get(key) + " of parameter=" + key, e); break; } - equivalentRequest = equivalentRequest + keyEncoded + "=" - + valueEncoded + ";"; + equivalentRequest = equivalentRequest + keyEncoded + "=" + valueEncoded + ";"; } return equivalentRequest; } - private String compute(ProcessInformations processInformations, - Map userInputs, - Map inputParameters, - LinkedHashMap equivalentRequestMap) + private String compute(ProcessInformations processInformations, Map userInputs, + Map inputParameters, LinkedHashMap equivalentRequestMap) throws ServiceException { try { // setup the inputs org.n52.wps.client.ExecuteRequestBuilder executeBuilder = new org.n52.wps.client.ExecuteRequestBuilder( processInformations.getProcessDescription()); for (InputDescriptionType input : processInformations.getInputs()) { - String value = userInputs.get(input.getIdentifier() - .getStringValue()); + String value = userInputs.get(input.getIdentifier().getStringValue()); if (value != null && value.trim().length() > 0) { if (input.isSetLiteralData()) { - logger.debug("Configuring Literal: " - + input.getIdentifier().getStringValue() - + " to: " + value); - equivalentRequestMap.put(input.getIdentifier() - .getStringValue(), value); - executeBuilder.addLiteralData(input.getIdentifier() - .getStringValue(), value); + logger.debug( + "Configuring Literal: " + input.getIdentifier().getStringValue() + " to: " + value); + equivalentRequestMap.put(input.getIdentifier().getStringValue(), value); + executeBuilder.addLiteralData(input.getIdentifier().getStringValue(), value); } else if (input.isSetBoundingBoxData()) { - logger.debug("Configuring Bounding Box: " - + input.getIdentifier().getStringValue() - + " to: " + value); - equivalentRequestMap.put(input.getIdentifier() - .getStringValue(), value); - addBoundingBoxInput(executeBuilder, input - .getIdentifier().getStringValue(), value); + logger.debug("Configuring Bounding Box: " + input.getIdentifier().getStringValue() + " to: " + + value); + equivalentRequestMap.put(input.getIdentifier().getStringValue(), value); + addBoundingBoxInput(executeBuilder, input.getIdentifier().getStringValue(), value); } else { if (input.isSetComplexData()) { - logger.debug("Configuring Complex: " - + input.getIdentifier().getStringValue() - + " to: " + value); - SupportedComplexDataInputType complex = input - .getComplexData(); - Parameter par = inputParameters.get(input - .getIdentifier().getStringValue()); + logger.debug( + "Configuring Complex: " + input.getIdentifier().getStringValue() + " to: " + value); + SupportedComplexDataInputType complex = input.getComplexData(); + Parameter par = inputParameters.get(input.getIdentifier().getStringValue()); String publicLink; if (par instanceof TabularListParameter) { // TabularListParameter tabularListParameter = // ((TabularListParameter) par); - InputStream tablesStream = new ByteArrayInputStream( - value.getBytes()); - publicLink = StorageUtil - .saveOnStorageInTemporalFile(tablesStream); + InputStream tablesStream = new ByteArrayInputStream(value.getBytes()); + publicLink = StorageUtil.saveOnStorageInTemporalFile(tablesStream); } else { publicLink = value; } - equivalentRequestMap.put(input.getIdentifier() - .getStringValue(), value); - executeBuilder.addComplexDataReference(input - .getIdentifier().getStringValue(), - publicLink, complex.getDefault() - .getFormat().getSchema(), complex - .getDefault().getFormat() - .getEncoding(), complex - .getDefault().getFormat() - .getMimeType()); + equivalentRequestMap.put(input.getIdentifier().getStringValue(), value); + executeBuilder.addComplexDataReference(input.getIdentifier().getStringValue(), publicLink, + complex.getDefault().getFormat().getSchema(), + complex.getDefault().getFormat().getEncoding(), + complex.getDefault().getFormat().getMimeType()); } else { - logger.error("This input parameter type is not supported by client library: " - + input); + logger.error("This input parameter type is not supported by client library: " + input); throw new ServiceException( - "This input parameter is not supported by client library: " - + input); + "This input parameter is not supported by client library: " + input); } } @@ -1022,8 +923,7 @@ public class SClient4WPS extends SClient { } // Submit the execution - String statusLocation = executeProcessAsync(executeBuilder, - processInformations.getProcessDescription()); + String statusLocation = executeProcessAsync(executeBuilder, processInformations.getProcessDescription()); logger.debug("Starting Process: " + statusLocation); return statusLocation; @@ -1035,120 +935,86 @@ public class SClient4WPS extends SClient { } @Override - public ComputationStatus getComputationStatus(ComputationId computationId) - throws ServiceException { + public ComputationStatus getComputationStatus(ComputationId computationId) throws ServiceException { SClient4WPSSession wpsClient = null; try { - logger.debug("GetComputationStatus(): ComputationId=" - + computationId); + logger.debug("GetComputationStatus(): ComputationId=" + computationId); wpsClient = createWPSClientSession(); wpsClient.connectForMonitoring(wpsProcessingServlet); Object responseObject = null; - if (computationId == null || computationId.getUrlId() == null - || computationId.getUrlId().isEmpty()) { + if (computationId == null || computationId.getUrlId() == null || computationId.getUrlId().isEmpty()) { throw new ServiceException("Process Location is null!"); } else { ComputationStatus computationStatus = null; try { - responseObject = wpsClient.executeViaGET( - computationId.getUrlId(), ""); + responseObject = wpsClient.executeViaGET(computationId.getUrlId(), ""); - logger.debug("ComputationStatus ResponseObject: " - + responseObject); + logger.debug("ComputationStatus ResponseObject: " + responseObject); if (responseObject instanceof ExecuteResponseDocumentImpl) { - if (((ExecuteResponseDocumentImpl) responseObject) - .getExecuteResponse() == null) { + if (((ExecuteResponseDocumentImpl) responseObject).getExecuteResponse() == null) { logger.debug("WPS FAILURE: ExecuteResponse is null"); - computationStatus = new ComputationStatus( - Status.FAILED, 100f); + computationStatus = new ComputationStatus(Status.FAILED, 100f); } else { - StatusType statusType = ((ExecuteResponseDocumentImpl) responseObject) - .getExecuteResponse().getStatus(); + StatusType statusType = ((ExecuteResponseDocumentImpl) responseObject).getExecuteResponse() + .getStatus(); if (statusType == null) { logger.debug("WPS FAILURE: Status Type is null"); computationStatus = null; } else { String failure = statusType.getProcessFailed() == null ? null - : statusType.getProcessFailed() - .getExceptionReport() - .toString(); + : statusType.getProcessFailed().getExceptionReport().toString(); if ((failure != null && !failure.isEmpty())) { logger.debug("WPS FAILURE: " + failure); - computationStatus = new ComputationStatus( - new ServiceException(failure)); + computationStatus = new ComputationStatus(new ServiceException(failure)); } else { - String paused = statusType - .getProcessPaused() == null ? null - : statusType.getProcessPaused() - .getStringValue(); + String paused = statusType.getProcessPaused() == null ? null + : statusType.getProcessPaused().getStringValue(); if (paused != null && !paused.isEmpty()) { logger.debug("WPS PAUSED: " + paused); - computationStatus = new ComputationStatus( - new ServiceException(paused)); + computationStatus = new ComputationStatus(new ServiceException(paused)); } else { - String success = statusType - .getProcessSucceeded() == null ? null - : statusType - .getProcessSucceeded(); + String success = statusType.getProcessSucceeded() == null ? null + : statusType.getProcessSucceeded(); - if (success != null - && !success.isEmpty()) { + if (success != null && !success.isEmpty()) { logger.debug("WPS SUCCESS"); - computationStatus = new ComputationStatus( - Status.COMPLETE, 100f); + computationStatus = new ComputationStatus(Status.COMPLETE, 100f); } else { - String accepted = statusType - .getProcessAccepted() == null ? null - : statusType - .getProcessAccepted(); - if (accepted != null - && !accepted.isEmpty()) { + String accepted = statusType.getProcessAccepted() == null ? null + : statusType.getProcessAccepted(); + if (accepted != null && !accepted.isEmpty()) { logger.debug("WPS ACCEPTED"); - computationStatus = new ComputationStatus( - Status.ACCEPTED, 0f); + computationStatus = new ComputationStatus(Status.ACCEPTED, 0f); } else { - int status = statusType - .getProcessStarted() == null ? -1 - : statusType - .getProcessStarted() - .getPercentCompleted(); + int status = statusType.getProcessStarted() == null ? -1 + : statusType.getProcessStarted().getPercentCompleted(); if (status >= 0) { Float statusd = (float) status; try { - statusd = Float - .parseFloat(statusType - .getProcessStarted() - .getStringValue()); + statusd = Float.parseFloat( + statusType.getProcessStarted().getStringValue()); } catch (Exception e) { - logger.debug(e - .getLocalizedMessage()); + logger.debug(e.getLocalizedMessage()); } - logger.debug("WPS STATUS:" - + statusd); - computationStatus = new ComputationStatus( - Status.RUNNING, - statusd); + logger.debug("WPS STATUS:" + statusd); + computationStatus = new ComputationStatus(Status.RUNNING, statusd); } else { if (status == -1) { logger.debug("WPS STATUS: Computation cancelled, " - + statusType - .getProcessStarted()); - computationStatus = new ComputationStatus( - Status.CANCELLED, - -1); + + statusType.getProcessStarted()); + computationStatus = new ComputationStatus(Status.CANCELLED, -1); } else { logger.debug("WPS STATUS: Not Started, " - + statusType - .getProcessStarted()); + + statusType.getProcessStarted()); } } } @@ -1160,18 +1026,15 @@ public class SClient4WPS extends SClient { logger.debug("ComputationStatus: " + computationStatus); return computationStatus; } else { - logger.error("Error in ResponceObject: " - + responseObject); + logger.error("Error in ResponceObject: " + responseObject); logger.error("WPS FAILURE: "); - computationStatus = new ComputationStatus( - Status.FAILED, 100f); + computationStatus = new ComputationStatus(Status.FAILED, 100f); return computationStatus; } } catch (Throwable e) { logger.error("WPS FAILURE: " + e.getLocalizedMessage()); e.printStackTrace(); - computationStatus = new ComputationStatus(Status.FAILED, - 100f); + computationStatus = new ComputationStatus(Status.FAILED, 100f); return computationStatus; } @@ -1188,51 +1051,41 @@ public class SClient4WPS extends SClient { } @Override - public OutputData getOutputDataByComputationId(ComputationId computationId) - throws ServiceException { + public OutputData getOutputDataByComputationId(ComputationId computationId) throws ServiceException { LinkedHashMap resources = retrieveOutput(computationId); - MapResource mapResource = new MapResource("mapResource", "Resources", - "Resources", resources); + MapResource mapResource = new MapResource("mapResource", "Resources", "Resources", resources); OutputData outputData = new OutputData(computationId, mapResource); return outputData; } - private LinkedHashMap retrieveOutput( - ComputationId computationId) throws ServiceException { + private LinkedHashMap retrieveOutput(ComputationId computationId) throws ServiceException { LinkedHashMap outputResource = new LinkedHashMap<>(); LinkedHashMap outputParameters = new LinkedHashMap<>(); - ProcessInformations processInformations = runningProcess - .get(computationId); + ProcessInformations processInformations = runningProcess.get(computationId); Parameter outputParameter; - if (processInformations != null - && processInformations.getOutputs() != null) { - for (OutputDescriptionType outputDesc : processInformations - .getOutputs()) { + if (processInformations != null && processInformations.getOutputs() != null) { + for (OutputDescriptionType outputDesc : processInformations.getOutputs()) { outputParameter = WPS2DM.convert2DMType(outputDesc); logger.debug("OutputParameter: " + outputParameter); - outputParameters - .put(outputParameter.getName(), outputParameter); + outputParameters.put(outputParameter.getName(), outputParameter); } } - retrieveProcessOutput(computationId.getUrlId(), outputParameters, - outputResource); + retrieveProcessOutput(computationId.getUrlId(), outputParameters, outputResource); return outputResource; } - private void retrieveProcessOutput(String processLocation, - Map outputParameters, + private void retrieveProcessOutput(String processLocation, Map outputParameters, Map outputResource) throws ServiceException { ProcessOutputs outs = retrieveProcessResult(processLocation); logger.debug("Process Executed"); // retrieve the output objs if (outs == null) - throw new ServiceException( - "Error during the execution of the WPS process: returned an empty document"); + throw new ServiceException("Error during the execution of the WPS process: returned an empty document"); else { OutputDataType[] outputData = outs.getOutputArray(); @@ -1244,28 +1097,21 @@ public class SClient4WPS extends SClient { Parameter paramLiteral = outputParameters.get(outputID); if (paramLiteral != null) { paramLiteral.setValue(value); - logger.debug("Assigning value: " + value - + " to output named: " + outputID); - Resource resource = new ObjectResource(outputID, - paramLiteral.getName(), - paramLiteral.getDescription(), - paramLiteral.getValue()); + logger.debug("Assigning value: " + value + " to output named: " + outputID); + Resource resource = new ObjectResource(outputID, paramLiteral.getName(), + paramLiteral.getDescription(), paramLiteral.getValue()); outputResource.put(outputID, resource); } } else { if (out.getData().isSetComplexData()) { if (out.getReference() != null) { value = out.getReference().getHref(); - Parameter paramComplexData = outputParameters - .get(outputID); + Parameter paramComplexData = outputParameters.get(outputID); if (paramComplexData != null) { paramComplexData.setValue(value); - logger.debug("Assigning value: " + value - + " to output named: " + outputID); - Resource resource = new ObjectResource( - outputID, paramComplexData.getName(), - paramComplexData.getDescription(), - paramComplexData.getValue()); + logger.debug("Assigning value: " + value + " to output named: " + outputID); + Resource resource = new ObjectResource(outputID, paramComplexData.getName(), + paramComplexData.getDescription(), paramComplexData.getValue()); outputResource.put(outputID, resource); } } else @@ -1278,93 +1124,61 @@ public class SClient4WPS extends SClient { for (String key : urls.keySet()) { logger.debug("Adding OBJ:" + key); ResponseWPS responseWPS = urls.get(key); - ObjectParameter objP = new ObjectParameter(key, - responseWPS.getDescription(), + ObjectParameter objP = new ObjectParameter(key, responseWPS.getDescription(), String.class.getName(), " "); objP.setValue(responseWPS.getData()); logger.debug("ObjectParameter: " + objP); outputParameters.put(key, objP); - if (responseWPS != null - && responseWPS.getMimeType() != null) { + if (responseWPS != null && responseWPS.getMimeType() != null) { Resource resource; switch (responseWPS.getMimeType()) { case "image/bmp": case "image/gif": case "image/jpeg": case "image/png": - resource = new ImageResource(key, - responseWPS.getDescription(), - responseWPS.getDescription(), - responseWPS.getData(), + resource = new ImageResource(key, responseWPS.getDescription(), + responseWPS.getDescription(), responseWPS.getData(), responseWPS.getMimeType()); outputResource.put(key, resource); break; case "text/csv": - if (responseWPS.getData() != null - && !responseWPS.getData().isEmpty()) { - if (responseWPS.getData().startsWith( - "http:") - || responseWPS.getData() - .startsWith("https:") - || responseWPS.getData() - .startsWith("smp:")) { - resource = new FileResource(key, - responseWPS - .getDescription(), - responseWPS - .getDescription(), - responseWPS.getData(), + if (responseWPS.getData() != null && !responseWPS.getData().isEmpty()) { + if (responseWPS.getData().startsWith("http:") + || responseWPS.getData().startsWith("https:") + || responseWPS.getData().startsWith("smp:")) { + resource = new FileResource(key, responseWPS.getDescription(), + responseWPS.getDescription(), responseWPS.getData(), responseWPS.getMimeType()); outputResource.put(key, resource); } else { - resource = new ObjectResource(key, - responseWPS - .getDescription(), - responseWPS - .getDescription(), - responseWPS.getData()); + resource = new ObjectResource(key, responseWPS.getDescription(), + responseWPS.getDescription(), responseWPS.getData()); outputResource.put(key, resource); } } else { - resource = new ObjectResource(key, - responseWPS.getDescription(), - responseWPS.getDescription(), - responseWPS.getData()); + resource = new ObjectResource(key, responseWPS.getDescription(), + responseWPS.getDescription(), responseWPS.getData()); outputResource.put(key, resource); } break; default: - if (responseWPS.getData() != null - && !responseWPS.getData().isEmpty()) { - if (responseWPS.getData().startsWith( - "http:") - || responseWPS.getData() - .startsWith("https:") - || responseWPS.getData() - .startsWith("smp:")) { - resource = new FileResource(key, - responseWPS - .getDescription(), - responseWPS - .getDescription(), - responseWPS.getData(), + if (responseWPS.getData() != null && !responseWPS.getData().isEmpty()) { + if (responseWPS.getData().startsWith("http:") + || responseWPS.getData().startsWith("https:") + || responseWPS.getData().startsWith("smp:")) { + resource = new FileResource(key, responseWPS.getDescription(), + responseWPS.getDescription(), responseWPS.getData(), responseWPS.getMimeType()); outputResource.put(key, resource); } else { - resource = new ObjectResource(key, - responseWPS - .getDescription(), - responseWPS - .getDescription(), - responseWPS.getData()); + resource = new ObjectResource(key, responseWPS.getDescription(), + responseWPS.getDescription(), responseWPS.getData()); outputResource.put(key, resource); } } else { - resource = new ObjectResource(key, - responseWPS.getDescription(), - responseWPS.getDescription(), - responseWPS.getData()); + resource = new ObjectResource(key, responseWPS.getDescription(), + responseWPS.getDescription(), responseWPS.getData()); outputResource.put(key, resource); } break; @@ -1382,14 +1196,12 @@ public class SClient4WPS extends SClient { } @Override - public String cancelComputation(ComputationId computationId) - throws ServiceException { + public String cancelComputation(ComputationId computationId) throws ServiceException { SClient4WPSSession wpsClient = null; try { wpsClient = createWPSClientSession(); - String result = wpsClient.cancelComputation( - wpsCancelComputationServlet, computationId.getId()); + String result = wpsClient.cancelComputation(wpsCancelComputationServlet, computationId.getId()); return result; @@ -1404,16 +1216,13 @@ public class SClient4WPS extends SClient { } - public ComputationId resubmitComputation( - Map computationProperties) throws ServiceException { + public ComputationId resubmitComputation(Map computationProperties) throws ServiceException { ProcessInformations processInformations; if (computationProperties == null || computationProperties.isEmpty()) { - throw new ServiceException("Invalid computation properties: " - + computationProperties); + throw new ServiceException("Invalid computation properties: " + computationProperties); } try { - processInformations = describeProcess(computationProperties - .get("operator_id")); + processInformations = describeProcess(computationProperties.get("operator_id")); } catch (Throwable e) { logger.error("GetParameters: " + e.getLocalizedMessage()); e.printStackTrace(); @@ -1434,27 +1243,22 @@ public class SClient4WPS extends SClient { if (key.startsWith("input")) { int inputSeparatorIndex = key.indexOf("_"); String inputKey = key.substring(inputSeparatorIndex + 1); - if (inputKey.compareToIgnoreCase("user.name") != 0 - && inputKey.compareToIgnoreCase("scope") != 0) { + if (inputKey.compareToIgnoreCase("user.name") != 0 && inputKey.compareToIgnoreCase("scope") != 0) { userInputs.put(inputKey, computationProperties.get(key)); - logger.debug("UserInputs[key=" + inputKey + ", value=" - + computationProperties.get(key) + "]"); + logger.debug("UserInputs[key=" + inputKey + ", value=" + computationProperties.get(key) + "]"); } } } if (userInputs.isEmpty()) { - logger.error("Attention no inputs parameters retrieved for this computation: " - + computationProperties); + logger.error("Attention no inputs parameters retrieved for this computation: " + computationProperties); throw new ServiceException( - "Attention no inputs parameters retrieved for this computation: " - + computationProperties); + "Attention no inputs parameters retrieved for this computation: " + computationProperties); } LinkedHashMap equivalentRequestMap = new LinkedHashMap<>(); - String processUrl = compute(processInformations, userInputs, - inputParameters, equivalentRequestMap); + String processUrl = compute(processInformations, userInputs, inputParameters, equivalentRequestMap); logger.debug("Stated Computation ProcessLocation:" + processUrl); int idIndex = processUrl.lastIndexOf("?id="); @@ -1466,11 +1270,9 @@ public class SClient4WPS extends SClient { throw new ServiceException("Invalid processLocation: " + processUrl); } - String equivalentRequest = extractEquivalentRequestForResubmit( - computationProperties, equivalentRequestMap); + String equivalentRequest = extractEquivalentRequestForResubmit(computationProperties, equivalentRequestMap); - ComputationId computationId = new ComputationId(id, processUrl, - computationProperties.get("operator_id"), + ComputationId computationId = new ComputationId(id, processUrl, computationProperties.get("operator_id"), computationProperties.get("operator_name"), equivalentRequest); logger.debug("ComputationId: " + computationId); @@ -1479,59 +1281,47 @@ public class SClient4WPS extends SClient { return computationId; } - private String extractEquivalentRequestForResubmit( - Map computationProperties, + private String extractEquivalentRequestForResubmit(Map computationProperties, LinkedHashMap equivalentRequestMap) { - String equivalentRequest = wpsProcessingServlet + "?" - + "request=Execute&service=WPS&Version=1.0.0&gcube-token=" - + wpsToken + "&lang=en-US&Identifier=" - + computationProperties.get("operator_id") + "&DataInputs="; + String equivalentRequest = wpsProcessingServlet + "?" + "request=Execute&service=WPS&Version=1.0.0&gcube-token=" + + wpsToken + "&lang=en-US&Identifier=" + computationProperties.get("operator_id") + "&DataInputs="; for (String key : equivalentRequestMap.keySet()) { String keyEncoded = ""; try { keyEncoded = URLEncoder.encode(key, "UTF-8"); } catch (UnsupportedEncodingException e) { - logger.error( - "Error in equivalent request creation: Unsupported Encoding for parameter=" - + key, e); + logger.error("Error in equivalent request creation: Unsupported Encoding for parameter=" + key, e); break; } String valueEncoded = ""; try { - valueEncoded = URLEncoder.encode(equivalentRequestMap.get(key), - "UTF-8"); + valueEncoded = URLEncoder.encode(equivalentRequestMap.get(key), "UTF-8"); } catch (UnsupportedEncodingException e) { - logger.error( - "Error in equivalent request creation: Unsupported Encoding for value=" - + equivalentRequestMap.get(key) - + " of parameter=" + key, e); + logger.error("Error in equivalent request creation: Unsupported Encoding for value=" + + equivalentRequestMap.get(key) + " of parameter=" + key, e); break; } - equivalentRequest = equivalentRequest + keyEncoded + "=" - + valueEncoded + ";"; + equivalentRequest = equivalentRequest + keyEncoded + "=" + valueEncoded + ";"; } return equivalentRequest; } @Override - public ComputationData getComputationDataByComputationProperties( - Map computationProperties) throws ServiceException { + public ComputationData getComputationDataByComputationProperties(Map computationProperties) + throws ServiceException { try { - if (computationProperties == null - || computationProperties.isEmpty()) { - throw new Exception("Invalid computation properties: " - + computationProperties); + if (computationProperties == null || computationProperties.isEmpty()) { + throw new Exception("Invalid computation properties: " + computationProperties); } String compId = computationProperties.get("computation_id"); String operatorId = computationProperties.get("operator_id"); String operatorName = computationProperties.get("operator_name"); - String operatorDescritpion = computationProperties - .get("operator_description"); + String operatorDescritpion = computationProperties.get("operator_description"); String vre = computationProperties.get("VRE"); String startDate = computationProperties.get("start_date"); String endDate = computationProperties.get("end_date"); @@ -1550,21 +1340,18 @@ public class SClient4WPS extends SClient { if (key != null) { if (key.startsWith("input")) { int inputSeparatorIndex = key.indexOf("_"); - String inputKey = key - .substring(inputSeparatorIndex + 1); + String inputKey = key.substring(inputSeparatorIndex + 1); if (inputKey.compareToIgnoreCase("user.name") != 0 && inputKey.compareToIgnoreCase("scope") != 0) { - String inputOrder = key.substring(5, - inputSeparatorIndex); + String inputOrder = key.substring(5, inputSeparatorIndex); Integer order; try { order = Integer.parseInt(inputOrder); } catch (NumberFormatException e) { order = 0; } - ComputationItemPropertiesValue inputProps = new ComputationItemPropertiesValue( - order, inputKey, - computationProperties.get(key)); + ComputationItemPropertiesValue inputProps = new ComputationItemPropertiesValue(order, + inputKey, computationProperties.get(key)); inputParametersAsProperties.add(inputProps); } @@ -1572,20 +1359,17 @@ public class SClient4WPS extends SClient { } else { if (key.startsWith("output")) { int outputSeparatorIndex = key.indexOf("_"); - String outputKey = key - .substring(outputSeparatorIndex + 1); + String outputKey = key.substring(outputSeparatorIndex + 1); - String outputOrder = key.substring(6, - outputSeparatorIndex); + String outputOrder = key.substring(6, outputSeparatorIndex); Integer order; try { order = Integer.parseInt(outputOrder); } catch (NumberFormatException e) { order = 0; } - ComputationItemPropertiesValue outputProps = new ComputationItemPropertiesValue( - order, outputKey, - computationProperties.get(key)); + ComputationItemPropertiesValue outputProps = new ComputationItemPropertiesValue(order, + outputKey, computationProperties.get(key)); outputParametersAsProperties.add(outputProps); @@ -1599,34 +1383,26 @@ public class SClient4WPS extends SClient { Collections.sort(inputParametersAsProperties); Collections.sort(outputParametersAsProperties); - ComputationValueBuilder computationValueBuilder = new ComputationValueBuilder( - inputParametersAsProperties); - LinkedHashMap inputParameters = computationValueBuilder - .create(); - computationValueBuilder = new ComputationValueBuilder( - outputParametersAsProperties); - LinkedHashMap outputParameters = computationValueBuilder - .create(); + ComputationValueBuilder computationValueBuilder = new ComputationValueBuilder(inputParametersAsProperties); + LinkedHashMap inputParameters = computationValueBuilder.create(); + computationValueBuilder = new ComputationValueBuilder(outputParametersAsProperties); + LinkedHashMap outputParameters = computationValueBuilder.create(); logger.debug("inputParameters: " + inputParameters); logger.debug("outputParameters: " + outputParameters); - ComputationData computationData = new ComputationData( - computationId, inputParameters, outputParameters, - operatorDescritpion, startDate, endDate, status, - executionType, vre); + ComputationData computationData = new ComputationData(computationId, inputParameters, outputParameters, + operatorDescritpion, startDate, endDate, status, executionType, vre); logger.debug("ComputationData: " + computationData); return computationData; } catch (ServiceException e) { - logger.error("Error in getComutationDataByComputationProperties: " - + e.getLocalizedMessage()); + logger.error("Error in getComutationDataByComputationProperties: " + e.getLocalizedMessage()); e.printStackTrace(); throw e; } catch (Throwable e) { - logger.error("Error in getComutationDataByComputationProperties: " - + e.getLocalizedMessage()); + logger.error("Error in getComutationDataByComputationProperties: " + e.getLocalizedMessage()); e.printStackTrace(); throw new ServiceException(e.getLocalizedMessage(), e); diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPSBuilder.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPSBuilder.java index 622a187..bde89de 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPSBuilder.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClient4WPSBuilder.java @@ -8,13 +8,12 @@ import org.slf4j.LoggerFactory; /** * Builder of Client 4 WPS Service * - * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class SClient4WPSBuilder extends SClientBuilder { - private static Logger logger = LoggerFactory - .getLogger(SClient4WPSBuilder.class); + private static Logger logger = LoggerFactory.getLogger(SClient4WPSBuilder.class); private ServiceCredentials serviceCredendials; private String serviceAddressUrl; private boolean useUrl; @@ -22,6 +21,7 @@ public class SClient4WPSBuilder extends SClientBuilder { /** * * @param serviceCredentials + * service credentials */ public SClient4WPSBuilder(ServiceCredentials serviceCredentials) { this.serviceCredendials = serviceCredentials; @@ -31,12 +31,12 @@ public class SClient4WPSBuilder extends SClientBuilder { /** * * @param serviceCredentials + * service credentials * @param serviceAddressUrl * valid url for example: * http://dataminer1-devnext.d4science.org/wps/ */ - public SClient4WPSBuilder(ServiceCredentials serviceCredentials, - String serviceAddressUrl) { + public SClient4WPSBuilder(ServiceCredentials serviceCredentials, String serviceAddressUrl) { this.serviceCredendials = serviceCredentials; this.serviceAddressUrl = serviceAddressUrl; this.useUrl = true; diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientBuilder.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientBuilder.java index 11bc458..b67663f 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientBuilder.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientBuilder.java @@ -3,8 +3,8 @@ package org.gcube.data.analysis.dataminermanagercl.server.dmservice; /** * Abstract class for build client of service * - * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public abstract class SClientBuilder { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientDirector.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientDirector.java index c919c2d..e9007c6 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientDirector.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientDirector.java @@ -5,8 +5,8 @@ package org.gcube.data.analysis.dataminermanagercl.server.dmservice; /** * Director * - * @author "Giancarlo Panichi" - * email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class SClientDirector { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientSpec.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientSpec.java index aec1b62..d197e56 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientSpec.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/SClientSpec.java @@ -3,8 +3,8 @@ package org.gcube.data.analysis.dataminermanagercl.server.dmservice; /** * Specification * - * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class SClientSpec { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/DClientDescribeProcessRequest.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/DClientDescribeProcessRequest.java index 71f0eaa..ee3d710 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/DClientDescribeProcessRequest.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/DClientDescribeProcessRequest.java @@ -5,7 +5,7 @@ import org.n52.wps.client.AbstractClientGETRequest; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class DClientDescribeProcessRequest extends AbstractClientGETRequest { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ProcessInformations.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ProcessInformations.java index a9674a7..d2f46ac 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ProcessInformations.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ProcessInformations.java @@ -10,7 +10,7 @@ import net.opengis.wps.x100.ProcessDescriptionType; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class ProcessInformations implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ResponseWPS.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ResponseWPS.java index 33d35cc..8329c91 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ResponseWPS.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/ResponseWPS.java @@ -5,7 +5,7 @@ import java.io.Serializable; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class ResponseWPS implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/SClient4WPSSession.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/SClient4WPSSession.java index 9420eab..17ea05f 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/SClient4WPSSession.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/SClient4WPSSession.java @@ -43,15 +43,14 @@ import org.xml.sax.SAXException; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class SClient4WPSSession implements Serializable { private static final long serialVersionUID = -1387670579312851370L; - private static Logger logger = LoggerFactory - .getLogger(SClient4WPSSession.class); + private static Logger logger = LoggerFactory.getLogger(SClient4WPSSession.class); private static final String OGC_OWS_URI = "http://www.opengeospatial.net/ows"; private static String SUPPORTED_VERSION = "1.0.0"; @@ -70,8 +69,7 @@ public class SClient4WPSSession implements Serializable { */ public SClient4WPSSession(String user, String password) { super(); - logger.debug("Create SClient4WPSSession: [user=" + user - + ", password=" + password + "]"); + logger.debug("Create SClient4WPSSession: [user=" + user + ", password=" + password + "]"); this.user = user; this.password = password; options = new XmlOptions(); @@ -90,6 +88,7 @@ public class SClient4WPSSession implements Serializable { * further identification of the service. * @return true, if connect succeeded, false else. * @throws WPSClientException + * WPSClientException */ public boolean connect(String url) throws WPSClientException { @@ -111,11 +110,9 @@ public class SClient4WPSSession implements Serializable { ProcessDescriptionsDocument processDescs = describeAllProcesses(url); if (processDescs != null && capsDoc != null) { - logger.debug("Adding processes descriptions to logged services " - + url); + logger.debug("Adding processes descriptions to logged services " + url); processDescriptions.put(url, processDescs); - logger.debug("ProcessDescriptions key: " - + processDescriptions.keySet()); + logger.debug("ProcessDescriptions key: " + processDescriptions.keySet()); return true; } else { @@ -135,6 +132,7 @@ public class SClient4WPSSession implements Serializable { * further identification of the service. * @return true, if connect succeeded, false else. * @throws WPSClientException + * WPSClientException */ public boolean connectForMonitoring(String url) throws WPSClientException { logger.debug("CONNECT"); @@ -151,6 +149,7 @@ public class SClient4WPSSession implements Serializable { * removes a service from the session * * @param url + * url */ public void disconnect(String url) { /* @@ -163,7 +162,7 @@ public class SClient4WPSSession implements Serializable { /** * returns the serverIDs of all loggedServices * - * @return + * @return list of server ids */ public List getLoggedServices() { if (loggedServices != null && loggedServices.keySet() != null) { @@ -178,6 +177,7 @@ public class SClient4WPSSession implements Serializable { * the session. in normal case it should return true :) * * @param serverID + * server id * @return success */ public boolean descriptionsAvailableInCache(String serverID) { @@ -185,14 +185,16 @@ public class SClient4WPSSession implements Serializable { } /** - * returns the cached processdescriptions of a service. + * Returns the cached processdescriptions of a service. * - * @param serverID - * @return success + * + * @param wpsUrl + * url + * @return process descriptions document * @throws IOException + * IOException */ - private ProcessDescriptionsDocument getProcessDescriptionsFromCache( - String wpsUrl) throws IOException { + private ProcessDescriptionsDocument getProcessDescriptionsFromCache(String wpsUrl) throws IOException { if (!descriptionsAvailableInCache(wpsUrl)) { try { connect(wpsUrl); @@ -204,17 +206,18 @@ public class SClient4WPSSession implements Serializable { } /** - * return the processDescription for a specific process from Cache. * * @param serverID + * server id * @param processID + * process id * @return a ProcessDescription for a specific process from Cache. * @throws IOException + * IOException */ - public ProcessDescriptionType getProcessDescription(String serverID, - String processID) throws IOException { - ProcessDescriptionType[] processes = getProcessDescriptionsFromCache( - serverID).getProcessDescriptions().getProcessDescriptionArray(); + public ProcessDescriptionType getProcessDescription(String serverID, String processID) throws IOException { + ProcessDescriptionType[] processes = getProcessDescriptionsFromCache(serverID).getProcessDescriptions() + .getProcessDescriptionArray(); for (ProcessDescriptionType process : processes) { if (process.getIdentifier().getStringValue().equals(processID)) { return process; @@ -230,15 +233,18 @@ public class SClient4WPSSession implements Serializable { * the URL of the WPS * @return An Array of ProcessDescriptions * @throws IOException + * IOException */ - public ProcessDescriptionType[] getAllProcessDescriptions(String wpsUrl) - throws IOException { - return getProcessDescriptionsFromCache(wpsUrl).getProcessDescriptions() - .getProcessDescriptionArray(); + public ProcessDescriptionType[] getAllProcessDescriptions(String wpsUrl) throws IOException { + return getProcessDescriptionsFromCache(wpsUrl).getProcessDescriptions().getProcessDescriptionArray(); } /** * looks up, if the service exists already in session. + * + * @param serverID + * server id + * @return true if registered */ public boolean serviceAlreadyRegistered(String serverID) { return loggedServices.containsKey(serverID); @@ -248,7 +254,8 @@ public class SClient4WPSSession implements Serializable { * provides you the cached capabilities for a specified service. * * @param url - * @return + * url + * @return CapabilitiesDocument */ public CapabilitiesDocument getWPSCaps(String url) { return loggedServices.get(url); @@ -261,18 +268,18 @@ public class SClient4WPSSession implements Serializable { * descriptions will not be cached, so only transient information! * * @param url - * @return + * url + * @return process descriptions document * @throws WPSClientException + * WPSClientException */ - public ProcessDescriptionsDocument describeAllProcesses(String url) - throws WPSClientException { + public ProcessDescriptionsDocument describeAllProcesses(String url) throws WPSClientException { CapabilitiesDocument doc = loggedServices.get(url); if (doc == null) { logger.warn("serviceCaps are null, perhaps server does not exist"); return null; } - ProcessBriefType[] processes = doc.getCapabilities() - .getProcessOfferings().getProcessArray(); + ProcessBriefType[] processes = doc.getCapabilities().getProcessOfferings().getProcessArray(); String[] processIDs = new String[processes.length]; for (int i = 0; i < processIDs.length; i++) { processIDs[i] = processes[i].getIdentifier().getStringValue(); @@ -288,48 +295,46 @@ public class SClient4WPSSession implements Serializable { * @param processIDs * one or more processIDs * @param serverID + * server id * @throws WPSClientException + * WPSClientExpcetion */ - public ProcessDescriptionsDocument describeProcess(String[] processIDs, - String serverID) throws WPSClientException { + public ProcessDescriptionsDocument describeProcess(String[] processIDs, String serverID) throws WPSClientException { CapabilitiesDocument caps = this.loggedServices.get(serverID); - Operation[] operations = caps.getCapabilities().getOperationsMetadata() - .getOperationArray(); + Operation[] operations = caps.getCapabilities().getOperationsMetadata().getOperationArray(); String url = null; for (Operation operation : operations) { if (operation.getName().equals("DescribeProcess")) { - url = operation.getDCPArray()[0].getHTTP().getGetArray()[0] - .getHref(); + url = operation.getDCPArray()[0].getHTTP().getGetArray()[0].getHref(); } } if (url == null) { - throw new WPSClientException( - "Missing DescribeOperation in Capabilities"); + throw new WPSClientException("Missing DescribeOperation in Capabilities"); } return retrieveDescriptionViaGET(processIDs, url); } /** * Executes a process at a WPS - * - * @param url - * url of server not the entry additionally defined in the caps. + * + * @param serverID + * server id * @param execute * Execute document + * @param rawData + * true if is raw data * @return either an ExecuteResponseDocument or an InputStream if asked for * RawData or an Exception Report + * @throws WPSClientException WPSClientException */ - private Object execute(String serverID, ExecuteDocument execute, - boolean rawData) throws WPSClientException { + private Object execute(String serverID, ExecuteDocument execute, boolean rawData) throws WPSClientException { CapabilitiesDocument caps = loggedServices.get(serverID); - Operation[] operations = caps.getCapabilities().getOperationsMetadata() - .getOperationArray(); + Operation[] operations = caps.getCapabilities().getOperationsMetadata().getOperationArray(); String url = null; for (Operation operation : operations) { if (operation.getName().equals("Execute")) { - url = operation.getDCPArray()[0].getHTTP().getPostArray()[0] - .getHref(); + url = operation.getDCPArray()[0].getHTTP().getPostArray()[0].getHref(); } } if (url == null) { @@ -343,17 +348,19 @@ public class SClient4WPSSession implements Serializable { /** * Executes a process at a WPS * - * @param url - * url of server not the entry additionally defined in the caps. + * + * + * @param serverID + * server id * @param execute - * Execute document + * exceute document * @return either an ExecuteResponseDocument or an InputStream if asked for * RawData or an Exception Report + * @throws WPSClientException + * WPSClientException */ - public Object execute(String serverID, ExecuteDocument execute) - throws WPSClientException { - if (execute.getExecute().isSetResponseForm() == true - && execute.getExecute().isSetResponseForm() == true + public Object execute(String serverID, ExecuteDocument execute) throws WPSClientException { + if (execute.getExecute().isSetResponseForm() == true && execute.getExecute().isSetResponseForm() == true && execute.getExecute().getResponseForm().isSetRawDataOutput() == true) { return execute(serverID, execute, true); } else { @@ -362,8 +369,7 @@ public class SClient4WPSSession implements Serializable { } - private CapabilitiesDocument retrieveCapsViaGET(String url) - throws WPSClientException { + private CapabilitiesDocument retrieveCapsViaGET(String url) throws WPSClientException { logger.debug("retrieveCapsViaGET: " + url); ClientCapabiltiesRequest req = new ClientCapabiltiesRequest(); url = req.getRequest(url); @@ -376,50 +382,41 @@ public class SClient4WPSSession implements Serializable { logger.debug("Base64 encoded auth string: " + encoded); URL urlObj = new URL(url); - HttpURLConnection connection = (HttpURLConnection) urlObj - .openConnection(); + HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setRequestProperty("Authorization", "Basic " + encoded); InputStream is = connection.getInputStream(); Document doc = checkInputStream(is); - CapabilitiesDocument capabilitiesDocument = CapabilitiesDocument.Factory - .parse(doc, options); + CapabilitiesDocument capabilitiesDocument = CapabilitiesDocument.Factory.parse(doc, options); return capabilitiesDocument; } catch (MalformedURLException e) { e.printStackTrace(); - throw new WPSClientException( - "Capabilities URL seems to be unvalid: " + url, e); + throw new WPSClientException("Capabilities URL seems to be unvalid: " + url, e); } catch (IOException e) { e.printStackTrace(); - throw new WPSClientException( - "Error occured while retrieving capabilities from url: " - + url, e); + throw new WPSClientException("Error occured while retrieving capabilities from url: " + url, e); } catch (XmlException e) { e.printStackTrace(); throw new WPSClientException("Error occured while parsing XML", e); } } - private ProcessDescriptionsDocument retrieveDescriptionViaGET( - String[] processIDs, String url) throws WPSClientException { + private ProcessDescriptionsDocument retrieveDescriptionViaGET(String[] processIDs, String url) + throws WPSClientException { try { - logger.debug("RetrieveDescription GET: " + processIDs + " url:" - + url); + logger.debug("RetrieveDescription GET: " + processIDs + " url:" + url); - Path tempFile = Files.createTempFile("WPSProcessDescriptions", - "txt"); + Path tempFile = Files.createTempFile("WPSProcessDescriptions", "txt"); List lines = new ArrayList<>(); lines.add(""); - Files.write(tempFile, lines, Charset.defaultCharset(), - StandardOpenOption.APPEND); + Files.write(tempFile, lines, Charset.defaultCharset(), StandardOpenOption.APPEND); for (String processId : processIDs) { String[] process = { processId }; @@ -428,42 +425,36 @@ public class SClient4WPSSession implements Serializable { String requestURL = req.getRequest(url); String authString = user + ":" + password; - //logger.debug("auth string: " + authString); - byte[] authEncBytes = Base64 - .encodeBase64(authString.getBytes()); + // logger.debug("auth string: " + authString); + byte[] authEncBytes = Base64.encodeBase64(authString.getBytes()); String encoded = new String(authEncBytes); - //logger.debug("Base64 encoded auth string: " + encoded); + // logger.debug("Base64 encoded auth string: " + encoded); URL urlObj = new URL(requestURL); - HttpURLConnection connection = (HttpURLConnection) urlObj - .openConnection(); + HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); - connection.setRequestProperty("Authorization", "Basic " - + encoded); + connection.setRequestProperty("Authorization", "Basic " + encoded); InputStream is = connection.getInputStream(); - lines=retrievesSingleDescription(is); - Files.write(tempFile, lines, Charset.defaultCharset(), - StandardOpenOption.APPEND); + lines = retrievesSingleDescription(is); + Files.write(tempFile, lines, Charset.defaultCharset(), StandardOpenOption.APPEND); } lines = new ArrayList<>(); lines.add(""); - Files.write(tempFile, lines, Charset.defaultCharset(), - StandardOpenOption.APPEND); + Files.write(tempFile, lines, Charset.defaultCharset(), StandardOpenOption.APPEND); logger.debug(tempFile.toString()); - Document doc=null; - try (InputStream inputStream = Files.newInputStream(tempFile, - StandardOpenOption.READ)){ + Document doc = null; + try (InputStream inputStream = Files.newInputStream(tempFile, StandardOpenOption.READ)) { doc = checkInputStream(inputStream); - - } - ProcessDescriptionsDocument processDescriptionsDocument = ProcessDescriptionsDocument.Factory.parse(doc, options); - + + } + ProcessDescriptionsDocument processDescriptionsDocument = ProcessDescriptionsDocument.Factory.parse(doc, + options); + Files.delete(tempFile); return processDescriptionsDocument; - - + } catch (MalformedURLException e) { logger.error("URL seems not to be valid"); e.printStackTrace(); @@ -471,23 +462,19 @@ public class SClient4WPSSession implements Serializable { } catch (IOException e) { logger.error("Error occured while receiving data"); e.printStackTrace(); - throw new WPSClientException("Error occured while receiving data", - e); + throw new WPSClientException("Error occured while receiving data", e); } catch (XmlException e) { logger.error("Error occured while parsing ProcessDescription document"); e.printStackTrace(); - throw new WPSClientException( - "Error occured while parsing ProcessDescription document", - e); + throw new WPSClientException("Error occured while parsing ProcessDescription document", e); } catch (Throwable e) { logger.error(e.getLocalizedMessage()); e.printStackTrace(); - throw new WPSClientException(e.getLocalizedMessage(), - new Exception(e)); + throw new WPSClientException(e.getLocalizedMessage(), new Exception(e)); } } - protected List retrievesSingleDescription(InputStream is) throws WPSClientException { + protected List retrievesSingleDescription(InputStream is) throws WPSClientException { try { BufferedReader br = new BufferedReader(new InputStreamReader(is)); @@ -536,13 +523,11 @@ public class SClient4WPSSession implements Serializable { } catch (Throwable e) { logger.error(e.getLocalizedMessage()); e.printStackTrace(); - throw new WPSClientException(e.getLocalizedMessage(), - new Exception(e)); + throw new WPSClientException(e.getLocalizedMessage(), new Exception(e)); } } - private InputStream retrieveDataViaPOST(XmlObject obj, String urlString) - throws WPSClientException { + private InputStream retrieveDataViaPOST(XmlObject obj, String urlString) throws WPSClientException { try { logger.debug("RetrieveDataViaPost(): " + urlString); String authString = user + ":" + password; @@ -584,45 +569,34 @@ public class SClient4WPSSession implements Serializable { logger.debug("Document: " + doc); if (doc == null) { logger.error("Document is null"); - throw new WPSClientException( - "Error in check input stream: Document is null"); + throw new WPSClientException("Error in check input stream: Document is null"); } - if (getFirstElementNode(doc.getFirstChild()).getLocalName().equals( - "ExceptionReport") - && getFirstElementNode(doc.getFirstChild()) - .getNamespaceURI().equals(OGC_OWS_URI)) { + if (getFirstElementNode(doc.getFirstChild()).getLocalName().equals("ExceptionReport") + && getFirstElementNode(doc.getFirstChild()).getNamespaceURI().equals(OGC_OWS_URI)) { try { - ExceptionReportDocument exceptionDoc = ExceptionReportDocument.Factory - .parse(doc); + ExceptionReportDocument exceptionDoc = ExceptionReportDocument.Factory.parse(doc); logger.debug(exceptionDoc.xmlText(options)); - throw new WPSClientException( - "Error occured while executing query", exceptionDoc); + throw new WPSClientException("Error occured while executing query", exceptionDoc); } catch (XmlException e) { - throw new WPSClientException( - "Error while parsing ExceptionReport retrieved from server", - e); + throw new WPSClientException("Error while parsing ExceptionReport retrieved from server", e); } } else { logger.debug("No Exception Report"); } return doc; } catch (SAXException e) { - logger.error("Error while parsing input: " - + e.getLocalizedMessage()); + logger.error("Error while parsing input: " + e.getLocalizedMessage()); e.printStackTrace(); throw new WPSClientException("Error while parsing input", e); } catch (IOException e) { - logger.error("Error occured while transfer: " - + e.getLocalizedMessage()); + logger.error("Error occured while transfer: " + e.getLocalizedMessage()); e.printStackTrace(); throw new WPSClientException("Error occured while transfer", e); } catch (ParserConfigurationException e) { - logger.error("Error occured, parser is not correctly configured: " - + e.getLocalizedMessage()); + logger.error("Error occured, parser is not correctly configured: " + e.getLocalizedMessage()); e.printStackTrace(); - throw new WPSClientException( - "Error occured, parser is not correctly configured", e); + throw new WPSClientException("Error occured, parser is not correctly configured", e); } catch (WPSClientException e) { throw e; } @@ -650,8 +624,8 @@ public class SClient4WPSSession implements Serializable { * @return * @throws WPSClientException */ - private Object retrieveExecuteResponseViaPOST(String url, - ExecuteDocument doc, boolean rawData) throws WPSClientException { + private Object retrieveExecuteResponseViaPOST(String url, ExecuteDocument doc, boolean rawData) + throws WPSClientException { InputStream is = retrieveDataViaPOST(doc, url); if (rawData) { return is; @@ -665,16 +639,15 @@ public class SClient4WPSSession implements Serializable { try { erDoc = ExceptionReportDocument.Factory.parse(documentObj); } catch (XmlException e1) { - throw new WPSClientException( - "Error occured while parsing executeResponse", e); + throw new WPSClientException("Error occured while parsing executeResponse", e); } return erDoc; } } public String[] getProcessNames(String url) throws IOException { - ProcessDescriptionType[] processes = getProcessDescriptionsFromCache( - url).getProcessDescriptions().getProcessDescriptionArray(); + ProcessDescriptionType[] processes = getProcessDescriptionsFromCache(url).getProcessDescriptions() + .getProcessDescriptionArray(); String[] processNames = new String[processes.length]; for (int i = 0; i < processNames.length; i++) { processNames[i] = processes[i].getIdentifier().getStringValue(); @@ -685,15 +658,17 @@ public class SClient4WPSSession implements Serializable { /** * Executes a process at a WPS * - * @param url + * + * @param urlString * url of server not the entry additionally defined in the caps. * @param executeAsGETString * KVP Execute request * @return either an ExecuteResponseDocument or an InputStream if asked for * RawData or an Exception Report + * @throws WPSClientException + * WSPClientException */ - public Object executeViaGET(String urlString, String executeAsGETString) - throws WPSClientException { + public Object executeViaGET(String urlString, String executeAsGETString) throws WPSClientException { urlString = urlString + executeAsGETString; logger.debug("ExecuteViaGet() Url: " + urlString); try { @@ -727,28 +702,22 @@ public class SClient4WPSSession implements Serializable { erDoc = ExceptionReportDocument.Factory.parse(doc); } catch (XmlException e1) { e1.printStackTrace(); - throw new WPSClientException( - "Error occured while parsing executeResponse", e); + throw new WPSClientException("Error occured while parsing executeResponse", e); } - throw new WPSClientException( - "Error occured while parsing executeResponse", erDoc); + throw new WPSClientException("Error occured while parsing executeResponse", erDoc); } } catch (MalformedURLException e) { e.printStackTrace(); - throw new WPSClientException( - "Capabilities URL seems to be unvalid: " + urlString, e); + throw new WPSClientException("Capabilities URL seems to be unvalid: " + urlString, e); } catch (IOException e) { e.printStackTrace(); - throw new WPSClientException( - "Error occured while retrieving capabilities from url: " - + urlString, e); + throw new WPSClientException("Error occured while retrieving capabilities from url: " + urlString, e); } } - public String cancelComputation(String url, String computationId) - throws WPSClientException { + public String cancelComputation(String url, String computationId) throws WPSClientException { try { String authString = user + ":" + password; @@ -759,8 +728,7 @@ public class SClient4WPSSession implements Serializable { url += "?id=" + computationId; URL urlObj = new URL(url); - HttpURLConnection connection = (HttpURLConnection) urlObj - .openConnection(); + HttpURLConnection connection = (HttpURLConnection) urlObj.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setRequestProperty("Authorization", "Basic " + encoded); @@ -768,13 +736,10 @@ public class SClient4WPSSession implements Serializable { return responseMessage; } catch (MalformedURLException e) { e.printStackTrace(); - throw new WPSClientException( - "Capabilities URL seems to be unvalid: " + url, e); + throw new WPSClientException("Capabilities URL seems to be unvalid: " + url, e); } catch (IOException e) { e.printStackTrace(); - throw new WPSClientException( - "Error occured while retrieving capabilities from url: " - + url, e); + throw new WPSClientException("Error occured while retrieving capabilities from url: " + url, e); } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java index f99d54d..2e71600 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java @@ -34,6 +34,12 @@ import org.gcube.data.analysis.dataminermanagercl.shared.parameters.WKTParameter import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * + * @author Giancarlo Panichi + * + * + */ public class WPS2DM { private final static String SEPARATOR = "|"; @@ -42,30 +48,32 @@ public class WPS2DM { /** * * @param title + * title * @param minOcc + * min occurences * @param maxOcc + * max occurences * @param rangeOccs + * range occurences * @param id + * id * @param crs - * @return + * crs + * @return Parameter */ - public static Parameter manageBoundingBoxInformation(String title, - int minOcc, int maxOcc, int rangeOccs, String id, String crs) { + public static Parameter manageBoundingBoxInformation(String title, int minOcc, int maxOcc, int rangeOccs, String id, + String crs) { Parameter converted = null; - title = "Bounding Box Input in OGC 06-121r3 spec. E.g. 102,46,103,47,urn:ogc:def:crs:EPSG:4328 " - + title; + title = "Bounding Box Input in OGC 06-121r3 spec. E.g. 102,46,103,47,urn:ogc:def:crs:EPSG:4328 " + title; if (crs != null && crs.length() > 0) title += " Supported CRS " + crs; - title = buildParameterDescription(title, null, null, minOcc, maxOcc, - null); + title = buildParameterDescription(title, null, null, minOcc, maxOcc, null); if ((maxOcc == 1) || (maxOcc < 0) || (maxOcc == 0)) - converted = new ObjectParameter(id, title, String.class.getName(), - " "); + converted = new ObjectParameter(id, title, String.class.getName(), " "); else - converted = new ListParameter(id, title, String.class.getName(), - SEPARATOR); + converted = new ListParameter(id, title, String.class.getName(), SEPARATOR); return converted; } @@ -73,18 +81,25 @@ public class WPS2DM { /** * * @param title + * title * @param minOcc + * min occurences * @param maxOcc + * max occurences * @param rangeOccs + * range occurrences * @param defaultValue + * default value * @param id + * id * @param uoms + * uoms * @param type - * @return + * type + * @return Parameter */ - public static Parameter manageLiteral(String title, int minOcc, int maxOcc, - int rangeOccs, String defaultValue, String id, String uoms, - DomainMetadataType type) { + public static Parameter manageLiteral(String title, int minOcc, int maxOcc, int rangeOccs, String defaultValue, + String id, String uoms, DomainMetadataType type) { Parameter converted = null; logger.debug("WPS type:" + type.getStringValue()); String guessedType = guessWPSLiteralType(type); @@ -96,8 +111,7 @@ public class WPS2DM { logger.debug("Guessed default value: " + defaultValue); - title = buildParameterDescription(title, null, uoms, minOcc, maxOcc, - defaultValue); + title = buildParameterDescription(title, null, uoms, minOcc, maxOcc, defaultValue); if ((maxOcc == 1) || (maxOcc < 0) || (maxOcc == 0)) { if (title != null && !title.isEmpty()) { if (title.contains("[a sequence of names of columns from ")) { @@ -111,72 +125,56 @@ public class WPS2DM { logger.debug("Machter end: " + matcher.end()); logger.debug("Machter Group Count: " + matcher.groupCount()); String referredTabularParameterName = matcher.group(1); - logger.debug("Matcher referredTabularParameterName: " - + referredTabularParameterName); + logger.debug("Matcher referredTabularParameterName: " + referredTabularParameterName); String separator = matcher.group(2); logger.debug("Matcher separator: " + separator); - converted = new ColumnListParameter(id, title, - referredTabularParameterName, separator); + converted = new ColumnListParameter(id, title, referredTabularParameterName, separator); } else { if (title.contains("[the name of a column from ")) { - Pattern pattern = Pattern - .compile("the name of a column from (\\w+)"); + Pattern pattern = Pattern.compile("the name of a column from (\\w+)"); Matcher matcher = pattern.matcher(title); logger.debug("Machter title: " + title); logger.debug("Machter find: " + matcher.find()); logger.debug("Machter group: " + matcher.group()); logger.debug("Machter start: " + matcher.start()); logger.debug("Machter end: " + matcher.end()); - logger.debug("Machter Group Count: " - + matcher.groupCount()); + logger.debug("Machter Group Count: " + matcher.groupCount()); String referredTabularParameterName = matcher.group(1); - logger.debug("Matcher referredTabularParameterName: " - + referredTabularParameterName); + logger.debug("Matcher referredTabularParameterName: " + referredTabularParameterName); - converted = new ColumnParameter(id, title, - referredTabularParameterName, defaultValue); + converted = new ColumnParameter(id, title, referredTabularParameterName, defaultValue); } else { - if (title - .contains("[a sequence of values separated by ")) { - Pattern pattern = Pattern - .compile("a sequence of values separated by (\\p{ASCII})"); + if (title.contains("[a sequence of values separated by ")) { + Pattern pattern = Pattern.compile("a sequence of values separated by (\\p{ASCII})"); Matcher matcher = pattern.matcher(title); logger.debug("Machter title: " + title); logger.debug("Machter find: " + matcher.find()); logger.debug("Machter group: " + matcher.group()); logger.debug("Machter start: " + matcher.start()); logger.debug("Machter end: " + matcher.end()); - logger.debug("Machter Group Count: " - + matcher.groupCount()); + logger.debug("Machter Group Count: " + matcher.groupCount()); String separator = matcher.group(1); logger.debug("Matcher separator: " + separator); - converted = new ListParameter(id, title, - guessedType, separator); + converted = new ListParameter(id, title, guessedType, separator); } else { if (title.contains("[WKT_")) { logger.debug("WKT parameter: " + title); - converted = retrieveWKTParameter(id, title, - defaultValue); + converted = retrieveWKTParameter(id, title, defaultValue); } else { if (title.contains("[DATE]")) { logger.debug("DATE parameter: " + title); title = title.replace("[DATE]", ""); - converted = new DateParameter(id, title, - defaultValue); + converted = new DateParameter(id, title, defaultValue); } else { if (title.contains("[TIME]")) { logger.debug("TIME parameter: " + title); title = title.replace("[TIME]", ""); - converted = new TimeParameter(id, - title, defaultValue); + converted = new TimeParameter(id, title, defaultValue); } else { - converted = new ObjectParameter( - id, - title, - guessPrimitiveType(guessedType), + converted = new ObjectParameter(id, title, guessPrimitiveType(guessedType), defaultValue); } } @@ -186,78 +184,59 @@ public class WPS2DM { } } else { - converted = new ObjectParameter(id, title, - guessPrimitiveType(guessedType), defaultValue); + converted = new ObjectParameter(id, title, guessPrimitiveType(guessedType), defaultValue); } } else { - if(guessedType.compareTo(Boolean.class.getName())==0){ + if (guessedType.compareTo(Boolean.class.getName()) == 0) { converted = new ObjectParameter(id, title, guessedType, defaultValue); } else { - converted = new ListParameter(id, title, String.class.getName(), - SEPARATOR); + converted = new ListParameter(id, title, String.class.getName(), SEPARATOR); } - + } return converted; } - private static Parameter retrieveWKTParameter(String id, String title, - String defaultValue) { + private static Parameter retrieveWKTParameter(String id, String title, String defaultValue) { if (title.contains("[WKT_POINT]")) { title = title.replace("[WKT_POINT]", ""); - return new WKTParameter(id, title, WKTGeometryType.Point, - defaultValue); + return new WKTParameter(id, title, WKTGeometryType.Point, defaultValue); } else { if (title.contains("[WKT_LINESTRING]")) { title = title.replace("[WKT_LINESTRING]", ""); - return new WKTParameter(id, title, WKTGeometryType.LineString, - defaultValue); + return new WKTParameter(id, title, WKTGeometryType.LineString, defaultValue); } else { if (title.contains("[WKT_POLYGON]")) { title = title.replace("[WKT_POLYGON]", ""); - return new WKTParameter(id, title, WKTGeometryType.Polygon, - defaultValue); + return new WKTParameter(id, title, WKTGeometryType.Polygon, defaultValue); } else { if (title.contains("[WKT_CIRCLE]")) { title = title.replace("[WKT_CIRCLE]", ""); - return new WKTParameter(id, title, - WKTGeometryType.Circle, defaultValue); + return new WKTParameter(id, title, WKTGeometryType.Circle, defaultValue); } else { if (title.contains("[WKT_TRIANGLE]")) { title = title.replace("[WKT_TRIANGLE]", ""); - return new WKTParameter(id, title, - WKTGeometryType.Triangle, defaultValue); + return new WKTParameter(id, title, WKTGeometryType.Triangle, defaultValue); } else { if (title.contains("[WKT_SQUARE]")) { title = title.replace("[WKT_SQUARE]", ""); - return new WKTParameter(id, title, - WKTGeometryType.Square, defaultValue); + return new WKTParameter(id, title, WKTGeometryType.Square, defaultValue); } else { if (title.contains("[WKT_PENTAGON]")) { title = title.replace("[WKT_PENTAGON]", ""); - return new WKTParameter(id, title, - WKTGeometryType.Pentagon, - defaultValue); + return new WKTParameter(id, title, WKTGeometryType.Pentagon, defaultValue); } else { if (title.contains("[WKT_HEXAGON]")) { - title = title.replace("[WKT_HEXAGON]", - ""); - return new WKTParameter(id, title, - WKTGeometryType.Hexagon, - defaultValue); + title = title.replace("[WKT_HEXAGON]", ""); + return new WKTParameter(id, title, WKTGeometryType.Hexagon, defaultValue); } else { if (title.contains("[WKT_BOX]")) { - title = title.replace("[WKT_BOX]", - ""); - return new WKTParameter(id, title, - WKTGeometryType.Box, - defaultValue); + title = title.replace("[WKT_BOX]", ""); + return new WKTParameter(id, title, WKTGeometryType.Box, defaultValue); } else { - return new WKTParameter(id, title, - WKTGeometryType.Polygon, - defaultValue); + return new WKTParameter(id, title, WKTGeometryType.Polygon, defaultValue); } } } @@ -272,18 +251,25 @@ public class WPS2DM { /** * * @param maxMegaBytes + * max mega bytes * @param title + * title * @param minOcc + * min occurences * @param maxOcc + * max occurences * @param rangeOccs + * range occurences * @param id + * id * @param defaultType - * @return + * default type + * @param supportedTypes + * supported types + * @return Parameter */ - public static Parameter manageComplexData(String maxMegaBytes, - String title, int minOcc, int maxOcc, int rangeOccs, String id, - ComplexDataDescriptionType defaultType, - ComplexDataDescriptionType[] supportedTypes) { + public static Parameter manageComplexData(String maxMegaBytes, String title, int minOcc, int maxOcc, int rangeOccs, + String id, ComplexDataDescriptionType defaultType, ComplexDataDescriptionType[] supportedTypes) { Parameter converted = null; String mimeType = null; String schema = null; @@ -303,68 +289,56 @@ public class WPS2DM { supportedMimeTypes.add(supported.getMimeType()); } // rebuild title - title = buildParameterDescription(title, maxMegaBytes, null, minOcc, - maxOcc, null); + title = buildParameterDescription(title, maxMegaBytes, null, minOcc, maxOcc, null); if ((maxOcc == 1) || (maxOcc < 0) || (maxOcc == 0)) { if (title != null && !title.isEmpty()) { if (title.contains("[a http link to a table")) { - converted = new TabularParameter(id, title, " ", - new ArrayList(), mimeType, + converted = new TabularParameter(id, title, " ", new ArrayList(), mimeType, supportedMimeTypes); } else { if (title.contains("[a http link to a file")) { - converted = new FileParameter(id, title, mimeType, - supportedMimeTypes); + converted = new FileParameter(id, title, mimeType, supportedMimeTypes); } else { if (title.contains("[a sequence of http links")) { - Pattern pattern = Pattern - .compile("\\[a sequence of http links separated by (\\p{ASCII}) , each indicating a table"); + Pattern pattern = Pattern.compile( + "\\[a sequence of http links separated by (\\p{ASCII}) , each indicating a table"); Matcher matcher = pattern.matcher(title); boolean match = false; if (match = matcher.find()) { logger.debug("Machter title: " + title); logger.debug("Machter find: " + match); - logger.debug("Machter group: " - + matcher.group()); - logger.debug("Machter start: " - + matcher.start()); + logger.debug("Machter group: " + matcher.group()); + logger.debug("Machter start: " + matcher.start()); logger.debug("Machter end: " + matcher.end()); - logger.debug("Machter Group Count: " - + matcher.groupCount()); + logger.debug("Machter Group Count: " + matcher.groupCount()); String separator = matcher.group(1); logger.debug("Matcher separator: " + separator); - converted = new TabularListParameter(id, title, - separator, mimeType, supportedMimeTypes); + converted = new TabularListParameter(id, title, separator, mimeType, + supportedMimeTypes); } else { - converted = new FileParameter(id, title, - mimeType, supportedMimeTypes); + converted = new FileParameter(id, title, mimeType, supportedMimeTypes); } } else { - converted = new FileParameter(id, title, mimeType, - supportedMimeTypes); + converted = new FileParameter(id, title, mimeType, supportedMimeTypes); } } } } else { - converted = new FileParameter(id, title, mimeType, - supportedMimeTypes); + converted = new FileParameter(id, title, mimeType, supportedMimeTypes); } } else { - converted = new FileParameter(id, title, mimeType, - supportedMimeTypes); + converted = new FileParameter(id, title, mimeType, supportedMimeTypes); } return converted; } - public static Parameter convert2DMType(InputDescriptionType wpsType) - throws ServiceException { + public static Parameter convert2DMType(InputDescriptionType wpsType) throws ServiceException { try { String id = wpsType.getIdentifier().getStringValue(); - String title = wpsType.getTitle() != null ? wpsType.getTitle() - .getStringValue() : ""; + String title = wpsType.getTitle() != null ? wpsType.getTitle().getStringValue() : ""; int minOcc = wpsType.getMinOccurs().intValue(); int maxOcc = wpsType.getMaxOccurs().intValue(); int rangeOccs = maxOcc - minOcc; @@ -372,30 +346,24 @@ public class WPS2DM { rangeOccs = 1; // default - Parameter converted = new ObjectParameter(id, title, - String.class.getName(), " "); + Parameter converted = new ObjectParameter(id, title, String.class.getName(), " "); if (rangeOccs > 1) - converted = new ListParameter(id, title, - String.class.getName(), SEPARATOR); + converted = new ListParameter(id, title, String.class.getName(), SEPARATOR); // Bounding Boxes if (wpsType.isSetBoundingBoxData()) { - logger.debug("Conversion to DM Type->" + id - + " is a Bounding Box Input"); - converted = manageBoundingBoxInformation(title, minOcc, maxOcc, - rangeOccs, id, wpsType.getBoundingBoxData() - .getDefault().getCRS()); + logger.debug("Conversion to DM Type->" + id + " is a Bounding Box Input"); + converted = manageBoundingBoxInformation(title, minOcc, maxOcc, rangeOccs, id, + wpsType.getBoundingBoxData().getDefault().getCRS()); } // Literals else if (wpsType.isSetLiteralData()) { - logger.debug("Conversion to DM Type->" + id - + " is a Literal Input"); + logger.debug("Conversion to DM Type->" + id + " is a Literal Input"); LiteralInputType literal = wpsType.getLiteralData(); - String uoms = literal.getUOMs() == null ? "" : literal - .getUOMs().getDefault().getUOM().getStringValue(); + String uoms = literal.getUOMs() == null ? "" : literal.getUOMs().getDefault().getUOM().getStringValue(); String defaultValue = literal.getDefaultValue(); - converted = manageLiteral(title, minOcc, maxOcc, rangeOccs, - defaultValue, id, uoms, literal.getDataType()); + converted = manageLiteral(title, minOcc, maxOcc, rangeOccs, defaultValue, id, uoms, + literal.getDataType()); AllowedValues allowedValues = literal.getAllowedValues(); if (allowedValues != null) { ValueType[] values = allowedValues.getValueArray(); @@ -407,35 +375,27 @@ public class WPS2DM { } if (values.length > 1) { ObjectParameter conv = (ObjectParameter) converted; - if (conv.getType() != null - && !conv.getType().isEmpty() - && conv.getType().compareToIgnoreCase( - Boolean.class.getName()) != 0){ - converted = new EnumParameter(conv.getName(), - conv.getDescription(), enumValues, + if (conv.getType() != null && !conv.getType().isEmpty() + && conv.getType().compareToIgnoreCase(Boolean.class.getName()) != 0) { + converted = new EnumParameter(conv.getName(), conv.getDescription(), enumValues, conv.getDefaultValue()); } } } } else if (wpsType.isSetComplexData()) { - logger.debug("Conversion to DM Type->" + id - + " is a Complex Input"); - SupportedComplexDataInputType complex = wpsType - .getComplexData(); - String maxMegaBytes = complex.getMaximumMegabytes() != null ? complex - .getMaximumMegabytes().toString() : "1"; + logger.debug("Conversion to DM Type->" + id + " is a Complex Input"); + SupportedComplexDataInputType complex = wpsType.getComplexData(); + String maxMegaBytes = complex.getMaximumMegabytes() != null ? complex.getMaximumMegabytes().toString() + : "1"; logger.debug("Max Megabytes: " + maxMegaBytes); - converted = manageComplexData(maxMegaBytes, title, minOcc, - maxOcc, rangeOccs, id, - complex.getDefault().getFormat(), complex - .getSupported().getFormatArray()); + converted = manageComplexData(maxMegaBytes, title, minOcc, maxOcc, rangeOccs, id, + complex.getDefault().getFormat(), complex.getSupported().getFormatArray()); } logger.debug("Conversion to DM Type->Name=" + id); logger.debug("Conversion to DM Type->Title=" + title); - logger.debug("Conversion to DM Type->Number of Inputs to Manage=" - + rangeOccs); + logger.debug("Conversion to DM Type->Number of Inputs to Manage=" + rangeOccs); return converted; @@ -449,12 +409,10 @@ public class WPS2DM { public static Parameter convert2DMType(OutputDescriptionType wpsType) { String id = wpsType.getIdentifier().getStringValue(); - String title = wpsType.getTitle() != null ? wpsType.getTitle() - .getStringValue() : ""; + String title = wpsType.getTitle() != null ? wpsType.getTitle().getStringValue() : ""; // default - Parameter converted = new ObjectParameter(id, title, - String.class.getName(), " "); + Parameter converted = new ObjectParameter(id, title, String.class.getName(), " "); logger.debug("Conversion to DM Type->Output id:" + id); logger.debug("Conversion to DM Type->Title:" + title); @@ -468,16 +426,13 @@ public class WPS2DM { else if (wpsType.isSetLiteralOutput()) { logger.debug("Literal Output"); LiteralOutputType literal = wpsType.getLiteralOutput(); - String uoms = literal.getUOMs() == null ? "" : literal.getUOMs() - .toString(); - converted = manageLiteral(title, -1, -1, -1, "", id, uoms, - literal.getDataType()); + String uoms = literal.getUOMs() == null ? "" : literal.getUOMs().toString(); + converted = manageLiteral(title, -1, -1, -1, "", id, uoms, literal.getDataType()); } else if (wpsType.isSetComplexOutput()) { logger.debug("Complex Output"); SupportedComplexDataType complex = wpsType.getComplexOutput(); - converted = manageComplexData("", title, -1, -1, -1, id, complex - .getDefault().getFormat(), complex.getSupported() - .getFormatArray()); + converted = manageComplexData("", title, -1, -1, -1, id, complex.getDefault().getFormat(), + complex.getSupported().getFormatArray()); } return converted; @@ -486,16 +441,21 @@ public class WPS2DM { /** * * @param title + * title * @param maxMegabytes + * max mega bytes * @param UoM + * uom * @param minElements + * min elements * @param maxElements + * max elements * @param defaultValue - * @return + * default value + * @return description */ - public static String buildParameterDescription(String title, - String maxMegabytes, String UoM, int minElements, int maxElements, - String defaultValue) { + public static String buildParameterDescription(String title, String maxMegabytes, String UoM, int minElements, + int maxElements, String defaultValue) { String description = title; /* @@ -527,8 +487,7 @@ public class WPS2DM { String typeS = type.getReference().trim(); if (typeS.length() == 0) return String.class.getName(); - else if (typeS.contains("float") || typeS.contains("double") - || typeS.contains("decimal")) + else if (typeS.contains("float") || typeS.contains("double") || typeS.contains("decimal")) return Double.class.getName(); else if (typeS.contains("int")) return Integer.class.getName(); @@ -538,7 +497,7 @@ public class WPS2DM { return Short.class.getName(); else if (typeS.contains("boolean")) return Boolean.class.getName(); - + } return String.class.getName(); @@ -552,7 +511,7 @@ public class WPS2DM { } public static String guessPrimitiveType(String type) { - + if (type.equals(Integer.class.getName())) { return Integer.class.getName(); } else if (type.equals(String.class.getName())) { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/computationsvalue/ComputationValueBuilder.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/computationsvalue/ComputationValueBuilder.java index 751374b..b0bd953 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/computationsvalue/ComputationValueBuilder.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/computationsvalue/ComputationValueBuilder.java @@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class ComputationValueBuilder { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/is/InformationSystemUtils.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/is/InformationSystemUtils.java index e8846ed..72a2d03 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/is/InformationSystemUtils.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/is/InformationSystemUtils.java @@ -13,8 +13,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class InformationSystemUtils { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitor.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitor.java index ca2db7d..779229f 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitor.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitor.java @@ -12,8 +12,8 @@ import org.slf4j.LoggerFactory; /** * DataManager basic Monitor * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DMMonitor { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorListener.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorListener.java index 6cd1417..64d794b 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorListener.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorListener.java @@ -3,46 +3,49 @@ package org.gcube.data.analysis.dataminermanagercl.server.monitor; /** * Defines a listener for operation progress. * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public interface DMMonitorListener { - - /** * Called when the operation is starting. */ public void accepted(); - + /** * Called when there is a progress for the operation. - * @param elaborated the elaborated part. + * + * @param elaborated + * the elaborated part. */ public void cancelled(); - + /** * Called when the operation is complete - * @param percentage - * @param endDate + * + * @param percentage + * percentage */ public void complete(double percentage); - - + /** * Called when the operation is failed - * @param exception - * @param string + * + * @param message + * message + * @param exception + * exception */ public void failed(String message, Exception exception); - - + /** * Called when the operation is running - * @param percentage + * + * @param percentage + * percentage */ public void running(double percentage); - - + } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorTask.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorTask.java index 5b074d8..3dca40d 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorTask.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/monitor/DMMonitorTask.java @@ -12,8 +12,8 @@ import org.slf4j.LoggerFactory; /** * - * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DMMonitorTask extends TimerTask { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/storage/StorageUtil.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/storage/StorageUtil.java index 2462d1c..3b44c6d 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/storage/StorageUtil.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/storage/StorageUtil.java @@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class StorageUtil { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/util/ServiceCredentials.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/util/ServiceCredentials.java index b3a7269..189d745 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/util/ServiceCredentials.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/util/ServiceCredentials.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ServiceCredentials implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/Constants.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/Constants.java index 7869335..f36b025 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/Constants.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/Constants.java @@ -3,7 +3,7 @@ package org.gcube.data.analysis.dataminermanagercl.shared; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class Constants { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/StringUtil.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/StringUtil.java index 5846f8d..14c70fe 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/StringUtil.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/StringUtil.java @@ -6,7 +6,7 @@ package org.gcube.data.analysis.dataminermanagercl.shared; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class StringUtil { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/ColumnItem.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/ColumnItem.java index 51e0e1d..00cfcba 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/ColumnItem.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/ColumnItem.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ColumnItem implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/OutputData.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/OutputData.java index 220c4fb..76e8716 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/OutputData.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/OutputData.java @@ -8,8 +8,8 @@ import org.gcube.data.analysis.dataminermanagercl.shared.data.output.Resource; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class OutputData implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/TableItemSimple.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/TableItemSimple.java index 581b4b0..89f8aac 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/TableItemSimple.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/TableItemSimple.java @@ -5,8 +5,8 @@ import java.util.ArrayList; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class TableItemSimple implements Serializable { @@ -29,12 +29,17 @@ public class TableItemSimple implements Serializable { } /** + * + * @param id + * id * @param name + * name * @param description + * description * @param type + * type */ - public TableItemSimple(String id, String name, String description, - String type) { + public TableItemSimple(String id, String name, String description, String type) { super(); columns = new ArrayList(); this.id = id; @@ -45,9 +50,13 @@ public class TableItemSimple implements Serializable { } /** - * @param id2 - * @param name2 - * @param description2 + * + * @param id + * id + * @param name + * name + * @param description + * description */ public TableItemSimple(String id, String name, String description) { super(); @@ -135,10 +144,8 @@ public class TableItemSimple implements Serializable { @Override public String toString() { - return "TableItemSimple [id=" + id + ", name=" + name - + ", description=" + description + ", type=" + type - + ", columns=" + columns + ", tabularResource=" - + tabularResource + "]"; + return "TableItemSimple [id=" + id + ", name=" + name + ", description=" + description + ", type=" + type + + ", columns=" + columns + ", tabularResource=" + tabularResource + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationData.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationData.java index edb4ddf..6e8a7c4 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationData.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationData.java @@ -5,8 +5,8 @@ import java.util.LinkedHashMap; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationData implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationId.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationId.java index 2563b43..2e2e67c 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationId.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationId.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationId implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationItemPropertiesValue.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationItemPropertiesValue.java index cc1615c..07cbf4d 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationItemPropertiesValue.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationItemPropertiesValue.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationItemPropertiesValue implements Serializable, diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValue.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValue.java index c944a47..c0c9127 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValue.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValue.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationValue implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFile.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFile.java index b7a8629..6ab4212 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFile.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFile.java @@ -2,8 +2,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.data.computations; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationValueFile extends ComputationValue { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFileList.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFileList.java index f5fbd45..8d1d14c 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFileList.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueFileList.java @@ -4,8 +4,8 @@ import java.util.ArrayList; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationValueFileList extends ComputationValue { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueImage.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueImage.java index 026b4eb..c961911 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueImage.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueImage.java @@ -2,8 +2,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.data.computations; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationValueImage extends ComputationValue { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueType.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueType.java index 5095d5a..7143859 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueType.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/computations/ComputationValueType.java @@ -3,7 +3,7 @@ package org.gcube.data.analysis.dataminermanagercl.shared.data.computations; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public enum ComputationValueType { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/FileResource.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/FileResource.java index de30817..3a7466c 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/FileResource.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/FileResource.java @@ -5,8 +5,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.data.output; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class FileResource extends Resource { @@ -30,13 +30,17 @@ public class FileResource extends Resource { /** * * @param resourceId + * resource id * @param name + * name * @param description + * description * @param url + * url * @param mimeType + * mime type */ - public FileResource(String resourceId, String name, String description, - String url, String mimeType) { + public FileResource(String resourceId, String name, String description, String url, String mimeType) { super(resourceId, name, description, ResourceType.FILE); this.url = url; this.mimeType = mimeType; @@ -74,10 +78,9 @@ public class FileResource extends Resource { @Override public String toString() { - return "FileResource [url=" + url + ", mimeType=" + mimeType - + ", getResourceId()=" + getResourceId() + ", getName()=" - + getName() + ", getDescription()=" + getDescription() - + ", getResourceType()=" + getResourceType() + "]"; + return "FileResource [url=" + url + ", mimeType=" + mimeType + ", getResourceId()=" + getResourceId() + + ", getName()=" + getName() + ", getDescription()=" + getDescription() + ", getResourceType()=" + + getResourceType() + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ImageResource.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ImageResource.java index 4bb6058..6c5038f 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ImageResource.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ImageResource.java @@ -5,8 +5,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.data.output; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ImageResource extends Resource { @@ -29,12 +29,17 @@ public class ImageResource extends Resource { /** * * @param resourceId + * resource id * @param name + * name * @param description + * description * @param link + * link + * @param mimeType + * mime type */ - public ImageResource(String resourceId, String name, String description, - String link, String mimeType) { + public ImageResource(String resourceId, String name, String description, String link, String mimeType) { super(resourceId, name, description, ResourceType.IMAGE); this.link = link; this.mimeType = mimeType; @@ -51,6 +56,7 @@ public class ImageResource extends Resource { /** * * @param link + * link */ public void setLink(String link) { this.link = link; @@ -66,10 +72,9 @@ public class ImageResource extends Resource { @Override public String toString() { - return "ImagesResource [link=" + link + ", mimeType=" + mimeType - + ", getResourceId()=" + getResourceId() + ", getName()=" - + getName() + ", getDescription()=" + getDescription() - + ", getResourceType()=" + getResourceType() + "]"; + return "ImagesResource [link=" + link + ", mimeType=" + mimeType + ", getResourceId()=" + getResourceId() + + ", getName()=" + getName() + ", getDescription()=" + getDescription() + ", getResourceType()=" + + getResourceType() + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/MapResource.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/MapResource.java index 8d86b38..530da61 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/MapResource.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/MapResource.java @@ -8,8 +8,8 @@ import java.util.Map; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class MapResource extends Resource { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ObjectResource.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ObjectResource.java index a7f9b11..3bfda72 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ObjectResource.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/ObjectResource.java @@ -3,11 +3,10 @@ */ package org.gcube.data.analysis.dataminermanagercl.shared.data.output; - /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class ObjectResource extends Resource { @@ -28,9 +27,16 @@ public class ObjectResource extends Resource { /** * + * @param resourceId + * resource id + * @param name + * name + * @param description + * description + * @param value + * value */ - public ObjectResource(String resourceId, String name, String description, - String value) { + public ObjectResource(String resourceId, String name, String description, String value) { super(resourceId, name, description, ResourceType.OBJECT); this.value = value; } @@ -43,8 +49,9 @@ public class ObjectResource extends Resource { } /** - * @param url - * the url to set + * + * @param value + * value */ public void setValue(String value) { this.value = value; @@ -52,10 +59,8 @@ public class ObjectResource extends Resource { @Override public String toString() { - return "ObjectResource [value=" + value + ", getResourceId()=" - + getResourceId() + ", getName()=" + getName() - + ", getDescription()=" + getDescription() - + ", getResourceType()=" + getResourceType() + "]"; + return "ObjectResource [value=" + value + ", getResourceId()=" + getResourceId() + ", getName()=" + getName() + + ", getDescription()=" + getDescription() + ", getResourceType()=" + getResourceType() + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/Resource.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/Resource.java index ad578e8..88b0d5a 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/Resource.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/Resource.java @@ -8,7 +8,7 @@ import java.io.Serializable; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class Resource implements Serializable { @@ -35,12 +35,15 @@ public class Resource implements Serializable { /** * * @param resourceId + * resource id * @param name + * name * @param description + * description * @param resourceType + * resource type */ - public Resource(String resourceId, String name, String description, - ResourceType resourceType) { + public Resource(String resourceId, String name, String description, ResourceType resourceType) { super(); this.resourceId = resourceId; this.name = name; @@ -128,13 +131,10 @@ public class Resource implements Serializable { return this.resourceType == ResourceType.IMAGE; } - - @Override public String toString() { - return "Resource [resourceId=" + resourceId + ", name=" + name - + ", description=" + description + ", resourceType=" - + resourceType + "]"; + return "Resource [resourceId=" + resourceId + ", name=" + name + ", description=" + description + + ", resourceType=" + resourceType + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/TableResource.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/TableResource.java index 23405ac..6fef3a8 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/TableResource.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/data/output/TableResource.java @@ -8,7 +8,7 @@ package org.gcube.data.analysis.dataminermanagercl.shared.data.output; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class TableResource extends Resource { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/exception/ServiceException.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/exception/ServiceException.java index c2eb29e..b0814e9 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/exception/ServiceException.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/exception/ServiceException.java @@ -5,16 +5,14 @@ package org.gcube.data.analysis.dataminermanagercl.shared.exception; /** * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ServiceException extends Exception { - private static final long serialVersionUID = -2255657546267656458L; - /** * */ @@ -24,15 +22,21 @@ public class ServiceException extends Exception { /** * @param message + * message */ public ServiceException(String message) { super(message); } - - - public ServiceException(String message,Throwable t) { - super(message,t); + + /** + * + * @param message + * message + * @param throwable + * throwable + */ + public ServiceException(String message, Throwable throwable) { + super(message, throwable); } - } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnListParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnListParameter.java index 0c6020f..381a5b5 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnListParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnListParameter.java @@ -5,8 +5,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ColumnListParameter extends Parameter { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnParameter.java index 4f75c48..78826f5 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ColumnParameter.java @@ -5,8 +5,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ColumnParameter extends Parameter { @@ -28,9 +28,16 @@ public class ColumnParameter extends Parameter { /** * + * @param name + * name + * @param description + * description + * @param referredTabularParameterName + * referred tabular parameter name + * @param defaultColumn + * default column */ - public ColumnParameter(String name, String description, - String referredTabularParameterName, String defaultColumn) { + public ColumnParameter(String name, String description, String referredTabularParameterName, String defaultColumn) { super(name, ParameterType.COLUMN, description); this.referredTabularParameterName = referredTabularParameterName; this.defaultColumn = defaultColumn; @@ -40,8 +47,7 @@ public class ColumnParameter extends Parameter { * @param referredTabularParameterName * the referredTabularParameterName to set */ - public void setReferredTabularParameterName( - String referredTabularParameterName) { + public void setReferredTabularParameterName(String referredTabularParameterName) { this.referredTabularParameterName = referredTabularParameterName; } @@ -60,8 +66,9 @@ public class ColumnParameter extends Parameter { } /** - * @param defaultValue - * the defaultValue to set + * + * @param defaultColumn + * default column */ public void setDefaultColumn(String defaultColumn) { this.defaultColumn = defaultColumn; @@ -69,11 +76,9 @@ public class ColumnParameter extends Parameter { @Override public String toString() { - return "ColumnParameter [referredTabularParameterName=" - + referredTabularParameterName + ", defaultColumn=" - + defaultColumn + ", value=" + value + ", name=" + name - + ", description=" + description + ", typology=" + typology - + "]"; + return "ColumnParameter [referredTabularParameterName=" + referredTabularParameterName + ", defaultColumn=" + + defaultColumn + ", value=" + value + ", name=" + name + ", description=" + description + ", typology=" + + typology + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/DateParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/DateParameter.java index e43694a..2f65425 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/DateParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/DateParameter.java @@ -5,8 +5,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DateParameter extends Parameter { @@ -23,9 +23,13 @@ public class DateParameter extends Parameter { } /** - * @param type + * + * @param name + * name + * @param description + * description * @param defaultValue - * @param value + * default value */ public DateParameter(String name, String description, String defaultValue) { super(name, ParameterType.DATE, description); @@ -49,9 +53,8 @@ public class DateParameter extends Parameter { @Override public String toString() { - return "DateParameter [defaultValue=" + defaultValue + ", value=" - + value + ", name=" + name + ", description=" + description - + ", typology=" + typology + "]"; + return "DateParameter [defaultValue=" + defaultValue + ", value=" + value + ", name=" + name + ", description=" + + description + ", typology=" + typology + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/EnumParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/EnumParameter.java index 56889cd..b697d38 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/EnumParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/EnumParameter.java @@ -8,8 +8,8 @@ import java.util.List; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class EnumParameter extends Parameter { @@ -27,19 +27,24 @@ public class EnumParameter extends Parameter { } /** - * @param type + * + * @param name + * name + * @param description + * description + * @param values + * list of values * @param defaultValue - * @param value + * default value */ - public EnumParameter(String name, String description, List values, - String defaultValue) { + public EnumParameter(String name, String description, List values, String defaultValue) { super(name, ParameterType.ENUM, description); this.values = values; this.defaultValue = defaultValue; } /** - * @return the defaultValue + * @return the default value */ public String getDefaultValue() { return defaultValue; @@ -47,7 +52,7 @@ public class EnumParameter extends Parameter { /** * @param defaultValue - * the defaultValue to set + * the default value to set */ public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; @@ -74,10 +79,8 @@ public class EnumParameter extends Parameter { @Override public String toString() { - return "EnumParameter [values=" + values + ", defaultValue=" - + defaultValue + ", value=" + value + ", name=" + name - + ", description=" + description + ", typology=" + typology - + "]"; + return "EnumParameter [values=" + values + ", defaultValue=" + defaultValue + ", value=" + value + ", name=" + + name + ", description=" + description + ", typology=" + typology + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/FileParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/FileParameter.java index f43f496..8893209 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/FileParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/FileParameter.java @@ -7,8 +7,8 @@ import java.util.ArrayList; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class FileParameter extends Parameter { @@ -28,12 +28,16 @@ public class FileParameter extends Parameter { /** * * @param name + * name * @param description - * @param fileName - * @param mimeType + * description + * @param defaultMimeType + * default mime type + * @param supportedMimeTypes + * supported mime type */ - public FileParameter(String name, String description, - String defaultMimeType, ArrayList supportedMimeTypes) { + public FileParameter(String name, String description, String defaultMimeType, + ArrayList supportedMimeTypes) { super(name, ParameterType.FILE, description); this.defaultMimeType = defaultMimeType; this.supportedMimeTypes = supportedMimeTypes; @@ -57,10 +61,9 @@ public class FileParameter extends Parameter { @Override public String toString() { - return "FileParameter [value=" + value + ", defaultMimeType=" - + defaultMimeType + ", supportedMimeTypes=" - + supportedMimeTypes + ", name=" + name + ", description=" - + description + ", typology=" + typology + "]"; + return "FileParameter [value=" + value + ", defaultMimeType=" + defaultMimeType + ", supportedMimeTypes=" + + supportedMimeTypes + ", name=" + name + ", description=" + description + ", typology=" + typology + + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ListParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ListParameter.java index d5334c1..27cf3b2 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ListParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ListParameter.java @@ -3,11 +3,10 @@ */ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; - /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ListParameter extends Parameter { @@ -25,11 +24,17 @@ public class ListParameter extends Parameter { } /** - * @param defaultValue - * @param value + * + * @param name + * name + * @param description + * description + * @param type + * type + * @param separator + * separator */ - public ListParameter(String name, String description, String type, - String separator) { + public ListParameter(String name, String description, String type, String separator) { super(name, ParameterType.LIST, description); this.type = type; this.separator = separator; @@ -50,7 +55,6 @@ public class ListParameter extends Parameter { this.type = type; } - /** * @return the separator */ @@ -64,10 +68,8 @@ public class ListParameter extends Parameter { @Override public String toString() { - return "ListParameter [type=" + type + ", value=" + value - + ", separator=" + separator + ", name=" + name - + ", description=" + description + ", typology=" + typology - + "]"; + return "ListParameter [type=" + type + ", value=" + value + ", separator=" + separator + ", name=" + name + + ", description=" + description + ", typology=" + typology + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ObjectParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ObjectParameter.java index 62553b6..e33dee1 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ObjectParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ObjectParameter.java @@ -2,8 +2,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ObjectParameter extends Parameter { @@ -23,12 +23,15 @@ public class ObjectParameter extends Parameter { /** * * @param name + * name * @param description + * description * @param type + * type * @param defaultValue + * default value */ - public ObjectParameter(String name, String description, String type, - String defaultValue) { + public ObjectParameter(String name, String description, String type, String defaultValue) { super(name, ParameterType.OBJECT, description); this.type = type; this.defaultValue = defaultValue; @@ -66,10 +69,8 @@ public class ObjectParameter extends Parameter { @Override public String toString() { - return "ObjectParameter [type=" + type + ", defaultValue=" - + defaultValue + ", value=" + value + ", name=" + name - + ", description=" + description + ", typology=" + typology - + "]"; + return "ObjectParameter [type=" + type + ", defaultValue=" + defaultValue + ", value=" + value + ", name=" + + name + ", description=" + description + ", typology=" + typology + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/Parameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/Parameter.java index f53d3e6..5468788 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/Parameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/Parameter.java @@ -7,8 +7,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public abstract class Parameter implements Serializable { @@ -30,13 +30,14 @@ public abstract class Parameter implements Serializable { super(); } - /** + * * @param name + * name * @param type + * type * @param description - * @param defaultValue - * @param value + * description */ public Parameter(String name, ParameterType type, String description) { super(); @@ -45,11 +46,11 @@ public abstract class Parameter implements Serializable { this.description = description; } - public void setValue(String value){ - this.value=value; + public void setValue(String value) { + this.value = value; } - public String getValue(){ + public String getValue() { return value; } @@ -93,10 +94,8 @@ public abstract class Parameter implements Serializable { @Override public String toString() { - return "Parameter [name=" + name + ", description=" + description - + ", typology=" + typology + ", value=" + value + "]"; + return "Parameter [name=" + name + ", description=" + description + ", typology=" + typology + ", value=" + + value + "]"; } - - } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ParameterType.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ParameterType.java index 8925d84..640d69d 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ParameterType.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/ParameterType.java @@ -2,8 +2,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public enum ParameterType { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularListParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularListParameter.java index 7125b86..ed10c21 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularListParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularListParameter.java @@ -7,8 +7,8 @@ import java.util.ArrayList; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class TabularListParameter extends Parameter { @@ -27,11 +27,19 @@ public class TabularListParameter extends Parameter { } /** - * @param defaultValue - * @param value + * + * @param name + * name + * @param description + * description + * @param separator + * separator + * @param defaultMimeType + * default mime type + * @param supportedMimeTypes + * supported mime types */ - public TabularListParameter(String name, String description, - String separator, String defaultMimeType, + public TabularListParameter(String name, String description, String separator, String defaultMimeType, ArrayList supportedMimeTypes) { super(name, ParameterType.TABULAR_LIST, description); this.separator = separator; @@ -87,11 +95,9 @@ public class TabularListParameter extends Parameter { @Override public String toString() { - return "TabularListParameter [separator=" + separator + ", templates=" - + templates + ", defaultMimeType=" + defaultMimeType - + ", supportedMimeTypes=" + supportedMimeTypes + ", name=" - + name + ", description=" + description + ", typology=" - + typology + ", value=" + value + "]"; + return "TabularListParameter [separator=" + separator + ", templates=" + templates + ", defaultMimeType=" + + defaultMimeType + ", supportedMimeTypes=" + supportedMimeTypes + ", name=" + name + ", description=" + + description + ", typology=" + typology + ", value=" + value + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularParameter.java index 1c541a6..7534a16 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TabularParameter.java @@ -7,8 +7,8 @@ import java.util.ArrayList; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class TabularParameter extends Parameter { @@ -17,9 +17,6 @@ public class TabularParameter extends Parameter { private ArrayList templates = new ArrayList(); private String defaultMimeType; private ArrayList supportedMimeTypes; - - - /** * @@ -32,11 +29,18 @@ public class TabularParameter extends Parameter { /** * * @param name + * name * @param description + * description * @param tableName + * table name + * @param defaultMimeType + * default mime type + * @param supportedMimeTypes + * supported mime type */ - public TabularParameter(String name, String description, String tableName, - String defaultMimeType, ArrayList supportedMimeTypes) { + public TabularParameter(String name, String description, String tableName, String defaultMimeType, + ArrayList supportedMimeTypes) { super(name, ParameterType.TABULAR, description); this.value = tableName; this.templates = null; @@ -47,13 +51,20 @@ public class TabularParameter extends Parameter { /** * * @param name + * name * @param description + * description * @param tableName + * table name * @param templates + * templates + * @param defaultMimeType + * default mime type + * @param supportedMimeTypes + * supported mime types */ - public TabularParameter(String name, String description, String tableName, - ArrayList templates, String defaultMimeType, - ArrayList supportedMimeTypes) { + public TabularParameter(String name, String description, String tableName, ArrayList templates, + String defaultMimeType, ArrayList supportedMimeTypes) { super(name, ParameterType.TABULAR, description); this.value = tableName; this.templates = templates; @@ -95,11 +106,9 @@ public class TabularParameter extends Parameter { @Override public String toString() { - return "TabularParameter [templates=" + templates - + ", defaultMimeType=" + defaultMimeType - + ", supportedMimeTypes=" + supportedMimeTypes + ", name=" - + name + ", description=" + description + ", typology=" - + typology + ", value=" + value + "]"; + return "TabularParameter [templates=" + templates + ", defaultMimeType=" + defaultMimeType + + ", supportedMimeTypes=" + supportedMimeTypes + ", name=" + name + ", description=" + description + + ", typology=" + typology + ", value=" + value + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TimeParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TimeParameter.java index b4d7eeb..08070d1 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TimeParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/TimeParameter.java @@ -5,8 +5,8 @@ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class TimeParameter extends Parameter { @@ -23,9 +23,13 @@ public class TimeParameter extends Parameter { } /** - * @param type + * + * @param name + * name + * @param description + * description * @param defaultValue - * @param value + * default value */ public TimeParameter(String name, String description, String defaultValue) { super(name, ParameterType.TIME, description); @@ -49,9 +53,8 @@ public class TimeParameter extends Parameter { @Override public String toString() { - return "TimeParameter [defaultValue=" + defaultValue + ", value=" - + value + ", name=" + name + ", description=" + description - + ", typology=" + typology + "]"; + return "TimeParameter [defaultValue=" + defaultValue + ", value=" + value + ", name=" + name + ", description=" + + description + ", typology=" + typology + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTGeometryType.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTGeometryType.java index 710b508..8f847be 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTGeometryType.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTGeometryType.java @@ -6,16 +6,17 @@ import java.util.List; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public enum WKTGeometryType { - Point("Point"), LineString("LineString"), Polygon("Polygon"), Circle( - "Circle"), Triangle("Triangle"), Square("Square"), Pentagon( - "Pentagon"), Hexagon("Hexagon"), Box("Box"); + Point("Point"), LineString("LineString"), Polygon("Polygon"), Circle("Circle"), Triangle("Triangle"), Square( + "Square"), Pentagon("Pentagon"), Hexagon("Hexagon"), Box("Box"); /** - * @param text + * + * @param label + * label */ private WKTGeometryType(final String label) { this.label = label; @@ -39,7 +40,8 @@ public enum WKTGeometryType { /** * * @param label - * @return + * label + * @return WKTGeometryType */ public static WKTGeometryType getFromLabel(String label) { if (label == null || label.isEmpty()) diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java index d1cc8f0..f59d539 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java @@ -3,11 +3,10 @@ */ package org.gcube.data.analysis.dataminermanagercl.shared.parameters; - /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class WKTParameter extends Parameter { @@ -25,12 +24,17 @@ public class WKTParameter extends Parameter { } /** - * @param type + * + * @param name + * name + * @param description + * description + * @param wktGeometryType + * wkt geometry type * @param defaultValue - * @param value + * default value */ - public WKTParameter(String name, String description, - WKTGeometryType wktGeometryType, String defaultValue) { + public WKTParameter(String name, String description, WKTGeometryType wktGeometryType, String defaultValue) { super(name, ParameterType.WKT, description); this.wktGeometryType = wktGeometryType; this.defaultValue = defaultValue; @@ -70,10 +74,8 @@ public class WKTParameter extends Parameter { @Override public String toString() { - return "WKTParameter [wktGeometryType=" + wktGeometryType - + ", defaultValue=" + defaultValue + ", value=" + value - + ", name=" + name + ", description=" + description - + ", typology=" + typology + "]"; + return "WKTParameter [wktGeometryType=" + wktGeometryType + ", defaultValue=" + defaultValue + ", value=" + + value + ", name=" + name + ", description=" + description + ", typology=" + typology + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/ComputationStatus.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/ComputationStatus.java index c0d2163..0cb32e3 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/ComputationStatus.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/ComputationStatus.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ComputationStatus implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/Operator.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/Operator.java index a4d25f7..21d81b9 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/Operator.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/Operator.java @@ -10,11 +10,10 @@ import java.util.List; import org.gcube.data.analysis.dataminermanagercl.shared.StringUtil; import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter; - /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class Operator implements Serializable, Comparable { @@ -37,12 +36,15 @@ public class Operator implements Serializable, Comparable { /** * @param id + * id * @param briefDescription + * brief description * @param description + * description * @param category + * category */ - public Operator(String id, String briefDescription, String description, - OperatorCategory category) { + public Operator(String id, String briefDescription, String description, OperatorCategory category) { super(); this.id = id; if (id != null) @@ -54,13 +56,18 @@ public class Operator implements Serializable, Comparable { /** * @param id + * id * @param briefDescription + * brief description * @param description + * description * @param category + * category * @param hasImage + * true if has image */ - public Operator(String id, String briefDescription, String description, - OperatorCategory category, boolean hasImage) { + public Operator(String id, String briefDescription, String description, OperatorCategory category, + boolean hasImage) { super(); this.id = id; if (id != null) @@ -71,15 +78,19 @@ public class Operator implements Serializable, Comparable { this.hasImage = hasImage; } - /** * @param id + * id + * @param name + * name * @param briefDescription + * brief description * @param description + * description * @param category + * category */ - public Operator(String id, String name, String briefDescription, - String description, OperatorCategory category) { + public Operator(String id, String name, String briefDescription, String description, OperatorCategory category) { super(); this.id = id; if (name != null) @@ -88,19 +99,24 @@ public class Operator implements Serializable, Comparable { this.description = description; this.category = category; } - /** * @param id + * id * @param name + * name * @param briefDescription + * brief description * @param description + * description * @param category + * category * @param operatorParameters + * operator parameters * @param hasImage + * true if has image */ - public Operator(String id, String name, String briefDescription, - String description, OperatorCategory category, + public Operator(String id, String name, String briefDescription, String description, OperatorCategory category, List operatorParameters, boolean hasImage) { super(); this.id = id; @@ -226,10 +242,8 @@ public class Operator implements Serializable, Comparable { @Override public String toString() { - return "Operator [id=" + id + ", name=" + name + ", briefDescription=" - + briefDescription + ", description=" + description - +", operatorParameters=" - + operatorParameters + ", hasImage=" + hasImage + "]"; + return "Operator [id=" + id + ", name=" + name + ", briefDescription=" + briefDescription + ", description=" + + description + ", operatorParameters=" + operatorParameters + ", hasImage=" + hasImage + "]"; } @Override diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorCategory.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorCategory.java index d8c4722..a81cdb0 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorCategory.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorCategory.java @@ -10,30 +10,33 @@ import java.util.List; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class OperatorCategory implements Serializable, Comparable { private static final long serialVersionUID = 7511425996378626337L; private String id; - private String name; + private String name; private String briefDescription; - private String description; + private String description; private List operators = new ArrayList(); private boolean hasImage = false; - + /** * */ public OperatorCategory() { super(); } - + /** * @param id + * id * @param briefDescription + * brief description * @param description + * description */ public OperatorCategory(String id, String briefDescription, String description) { super(); @@ -44,12 +47,17 @@ public class OperatorCategory implements Serializable, Comparable operators) { + public OperatorCategory(String id, String briefDescription, String description, List operators) { super(); this.id = id; setNameFromId(); @@ -75,15 +86,21 @@ public class OperatorCategory implements Serializable, Comparable operators) { + public OperatorCategory(String id, String name, String briefDescription, String description, + List operators) { super(); this.id = id; this.name = name; @@ -92,7 +109,6 @@ public class OperatorCategory implements Serializable, Comparable operators) { this.operators = operators; - } - + } + public void addOperator(Operator operator) { this.operators.add(operator); } - + /** * */ private void setNameFromId() { - if (id!=null) { + if (id != null) { String name = ""; - + boolean precUnderscore = true; - for (int i=0; i(operators)); + OperatorCategory op = new OperatorCategory(id, name, briefDescription, description, + new ArrayList(operators)); op.setHasImage(hasImage); return op; } @Override public String toString() { - return "OperatorCategory [id=" + id + ", name=" + name - + ", briefDescription=" + briefDescription + ", description=" - + description + ", operators=" + operators + ", hasImage=" - + hasImage + "]"; + return "OperatorCategory [id=" + id + ", name=" + name + ", briefDescription=" + briefDescription + + ", description=" + description + ", operators=" + operators + ", hasImage=" + hasImage + "]"; } @Override public int compareTo(OperatorCategory o) { return id.compareTo(o.getId()); } - - - + } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorsClassification.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorsClassification.java index c4a5b13..c0d5ec1 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorsClassification.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/OperatorsClassification.java @@ -10,7 +10,7 @@ import java.util.List; /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class OperatorsClassification implements Serializable { @@ -19,25 +19,31 @@ public class OperatorsClassification implements Serializable { private String name; private List operatorCategories = new ArrayList(); private List operators = new ArrayList(); - + public OperatorsClassification() { super(); } - + /** * + * @param name + * name */ public OperatorsClassification(String name) { super(); this.name = name; } - + /** + * + * @param name + * name * @param operatorCategories + * list of operator categories * @param operators + * list of operators */ - public OperatorsClassification(String name, List operatorCategories, - List operators) { + public OperatorsClassification(String name, List operatorCategories, List operators) { this(name); this.operatorCategories = operatorCategories; this.operators = operators; @@ -51,7 +57,8 @@ public class OperatorsClassification implements Serializable { } /** - * @param operatorCategories the operatorCategories to set + * @param operatorCategories + * the operatorCategories to set */ public void setOperatorCategories(List operatorCategories) { this.operatorCategories = operatorCategories; @@ -65,43 +72,45 @@ public class OperatorsClassification implements Serializable { } /** - * @param operators the operators to set + * @param operators + * the operators to set */ public void setOperators(List operators) { this.operators = operators; } - + public Operator getOperatorById(String id) { - if (id==null) + if (id == null) return null; Operator operator = null; - for (Operator op: operators) + for (Operator op : operators) if (op.getId().contentEquals(id)) { operator = op; break; } return operator; } - + public OperatorCategory getCategoryById(String id) { OperatorCategory category = null; - for (OperatorCategory cat: operatorCategories) + for (OperatorCategory cat : operatorCategories) if (cat.getId().contentEquals(id)) { category = cat; break; } return category; } - + /** * @return the name */ public String getName() { return name; } - + /** - * @param name the name to set + * @param name + * the name to set */ public void setName(String name) { this.name = name; @@ -109,11 +118,8 @@ public class OperatorsClassification implements Serializable { @Override public String toString() { - return "OperatorsClassification [name=" + name - + ", operatorCategories=" + operatorCategories + ", operators=" + return "OperatorsClassification [name=" + name + ", operatorCategories=" + operatorCategories + ", operators=" + operators + "]"; } - - - + } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/TemplateDescriptor.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/TemplateDescriptor.java index 9df8049..fdee266 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/TemplateDescriptor.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/process/TemplateDescriptor.java @@ -6,93 +6,72 @@ package org.gcube.data.analysis.dataminermanagercl.shared.process; import java.util.HashMap; import java.util.Map; - /** * * @author Giancarlo Panichi - * email: g.panichi@isti.cnr.it + * * */ public class TemplateDescriptor { - public static TemplateDescriptor descriptors[] = { - new TemplateDescriptor("HCAF", "HCAF Data Set", ""), - new TemplateDescriptor("OCCURRENCE_SPECIES", "Occurrence Species Data Set", ""), - new TemplateDescriptor("OCCURRENCE_AQUAMAPS", "Occurrence Aquamaps", ""), - new TemplateDescriptor("HSPEN", "HSPEN Data Set", ""), - new TemplateDescriptor("HSPEC", "HSPEC Data Set", ""), - new TemplateDescriptor("CLUSTER", "Cluster Data Set", ""), - new TemplateDescriptor("TRAININGSET", "Neural Network Training Set", ""), - new TemplateDescriptor("TESTSET", "Neural Network Test Set", ""), - new TemplateDescriptor("GENERIC", "Generic Data set", ""), - new TemplateDescriptor("MINMAXLAT", "Min Max Lat Data Set", ""), - new TemplateDescriptor("TIMESERIES", "time Series Data Set", ""), - }; + public static TemplateDescriptor descriptors[] = { new TemplateDescriptor("HCAF", "HCAF Data Set", ""), + new TemplateDescriptor("OCCURRENCE_SPECIES", "Occurrence Species Data Set", ""), + new TemplateDescriptor("OCCURRENCE_AQUAMAPS", "Occurrence Aquamaps", ""), + new TemplateDescriptor("HSPEN", "HSPEN Data Set", ""), + new TemplateDescriptor("HSPEC", "HSPEC Data Set", ""), + new TemplateDescriptor("CLUSTER", "Cluster Data Set", ""), + new TemplateDescriptor("TRAININGSET", "Neural Network Training Set", ""), + new TemplateDescriptor("TESTSET", "Neural Network Test Set", ""), + new TemplateDescriptor("GENERIC", "Generic Data set", ""), + new TemplateDescriptor("MINMAXLAT", "Min Max Lat Data Set", ""), + new TemplateDescriptor("TIMESERIES", "time Series Data Set", ""), }; - public static String[] s = new String[]{""}; + public static String[] s = new String[] { "" }; public static Map map; static { map = new HashMap(); - map.put("HCAF", new String[][]{ - {"csquarecode", "string"}, - {"depthmin", "real"}, - {"depthmax", "real"}, - {"depthmean", "real"}, - {"depthsd", "real"}, - {"sstanmean", "real"}, - {"sstansd", "real"}, - {"sstmnmax", "real"}, - {"sstmnmin", "real"}, - {"sstmnrange", "real"}, - {"sbtanmean", "real"}, - {"salinitymean", "real"}, - {"salinitysd", "real"}, - {"salinitymax", "real"}, - {"salinitymin", "real"}, - {"salinitybmean", "real"}, - {"primprodmean", "integer"}, - {"iceconann", "real"}, - {"iceconspr", "real"}, - {"iceconsum", "real"}, - {"iceconfal", "real"}, - {"iceconwin", "real"}, - {"faoaream", "integer"}, - {"eezall", "string"}, - {"lme", "integer"}, - {"landdist", "integer"}, - {"oceanarea", "real"}, - {"centerlat", "real"}, - {"centerlong", "real"}, - }); - } + map.put("HCAF", new String[][] { { "csquarecode", "string" }, { "depthmin", "real" }, { "depthmax", "real" }, + { "depthmean", "real" }, { "depthsd", "real" }, { "sstanmean", "real" }, { "sstansd", "real" }, + { "sstmnmax", "real" }, { "sstmnmin", "real" }, { "sstmnrange", "real" }, { "sbtanmean", "real" }, + { "salinitymean", "real" }, { "salinitysd", "real" }, { "salinitymax", "real" }, + { "salinitymin", "real" }, { "salinitybmean", "real" }, { "primprodmean", "integer" }, + { "iceconann", "real" }, { "iceconspr", "real" }, { "iceconsum", "real" }, { "iceconfal", "real" }, + { "iceconwin", "real" }, { "faoaream", "integer" }, { "eezall", "string" }, { "lme", "integer" }, + { "landdist", "integer" }, { "oceanarea", "real" }, { "centerlat", "real" }, + { "centerlong", "real" }, }); + } public static TemplateDescriptor defaultDescriptor = descriptors[0]; - // public enum Template { - // HCAF, - // OCCURRENCE_SPECIES, - // OCCURRENCE_AQUAMAPS, - // HSPEN, - // HSPEC, - // CLUSTER, - // TRAININGSET, - // TESTSET, - // GENERIC, - // MINMAXLAT, - // TIMESERIES, - // } - + // public enum Template { + // HCAF, + // OCCURRENCE_SPECIES, + // OCCURRENCE_AQUAMAPS, + // HSPEN, + // HSPEC, + // CLUSTER, + // TRAININGSET, + // TESTSET, + // GENERIC, + // MINMAXLAT, + // TIMESERIES, + // } private String id, title, description; /** + * + * @param id + * id * @param title + * title * @param description + * decription */ public TemplateDescriptor(String id, String title, String description) { super(); this.id = id; this.title = title; - this.description = description; + this.description = description; } /** @@ -114,5 +93,5 @@ public class TemplateDescriptor { */ public String getTitle() { return title; - } + } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/Computations.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/Computations.java index 8259123..28f4d27 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/Computations.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/Computations.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class Computations implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/DataMinerWorkArea.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/DataMinerWorkArea.java index 2e3379b..1057344 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/DataMinerWorkArea.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/DataMinerWorkArea.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DataMinerWorkArea implements Serializable { @@ -23,6 +23,7 @@ public class DataMinerWorkArea implements Serializable { /** * * @param dataMinerWorkAreaFolder + * DataMiner work area folder */ public DataMinerWorkArea(ItemDescription dataMinerWorkAreaFolder) { super(); @@ -33,13 +34,16 @@ public class DataMinerWorkArea implements Serializable { /** * * @param dataMinerWorkAreaFolder + * DataMiner work area folder * @param inputDataSets + * input data sets * @param outputDataSets + * output data sets * @param computations + * computations */ - public DataMinerWorkArea(ItemDescription dataMinerWorkAreaFolder, - InputDataSets inputDataSets, OutputDataSets outputDataSets, - Computations computations) { + public DataMinerWorkArea(ItemDescription dataMinerWorkAreaFolder, InputDataSets inputDataSets, + OutputDataSets outputDataSets, Computations computations) { super(); this.dataMinerWorkAreaFolder = dataMinerWorkAreaFolder; this.inputDataSets = inputDataSets; @@ -81,13 +85,8 @@ public class DataMinerWorkArea implements Serializable { @Override public String toString() { - return "DataMinerWorkArea [dataMinerWorkAreaFolder=" - + dataMinerWorkAreaFolder + ", inputDataSets=" + inputDataSets - + ", outputDataSets=" + outputDataSets + ", computations=" - + computations + "]"; + return "DataMinerWorkArea [dataMinerWorkAreaFolder=" + dataMinerWorkAreaFolder + ", inputDataSets=" + + inputDataSets + ", outputDataSets=" + outputDataSets + ", computations=" + computations + "]"; } - - - } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/InputDataSets.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/InputDataSets.java index 8c89187..98dce82 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/InputDataSets.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/InputDataSets.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class InputDataSets implements Serializable { diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/ItemDescription.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/ItemDescription.java index 73fa68e..6e5bcfd 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/ItemDescription.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/ItemDescription.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ItemDescription implements Serializable { @@ -23,8 +23,7 @@ public class ItemDescription implements Serializable { super(); } - public ItemDescription(String id, String name, String owner, String path, - String type) { + public ItemDescription(String id, String name, String owner, String path, String type) { super(); this.id = id; this.name = name; @@ -85,28 +84,25 @@ public class ItemDescription implements Serializable { * Compare basic information with another ItemDescription not null * * @param itemDescription - * @return boolean + * item description + * @return boolean true if comparison match * */ - public boolean compareInfo(ItemDescription itemDescription){ - if(itemDescription!=null && id.compareTo(itemDescription.getId())==0 && - name.compareTo(itemDescription.getName())==0 && - owner.compareTo(itemDescription.getOwner())==0 && - path.compareTo(itemDescription.getPath())==0 && - type.compareTo(itemDescription.getType())==0 - ){ + public boolean compareInfo(ItemDescription itemDescription) { + if (itemDescription != null && id.compareTo(itemDescription.getId()) == 0 + && name.compareTo(itemDescription.getName()) == 0 && owner.compareTo(itemDescription.getOwner()) == 0 + && path.compareTo(itemDescription.getPath()) == 0 && type.compareTo(itemDescription.getType()) == 0) { return true; } else { return false; } - + } @Override public String toString() { - return "ItemDescription [id=" + id + ", name=" + name + ", owner=" - + owner + ", path=" + path + ", type=" + type + ", publicLink=" - + publicLink + "]"; + return "ItemDescription [id=" + id + ", name=" + name + ", owner=" + owner + ", path=" + path + ", type=" + type + + ", publicLink=" + publicLink + "]"; } } diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/OutputDataSets.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/OutputDataSets.java index df7b544..5dbca72 100644 --- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/OutputDataSets.java +++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/workspace/OutputDataSets.java @@ -4,8 +4,8 @@ import java.io.Serializable; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class OutputDataSets implements Serializable { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/BionymLocalTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/BionymLocalTest.java index c18053c..b2a04e3 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/BionymLocalTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/BionymLocalTest.java @@ -23,8 +23,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class BionymLocalTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/CsquareColumnCreatorTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/CsquareColumnCreatorTest.java index 2de6bfb..e6a5c8a 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/CsquareColumnCreatorTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/CsquareColumnCreatorTest.java @@ -23,8 +23,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class CsquareColumnCreatorTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DBScanTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DBScanTest.java index f434c0a..c9f28d2 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DBScanTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DBScanTest.java @@ -31,8 +31,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DBScanTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerParametersTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerParametersTest.java index 458743d..b36396a 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerParametersTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerParametersTest.java @@ -14,8 +14,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DataMinerParametersTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerServiceTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerServiceTest.java index 92ec953..6027172 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerServiceTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/DataMinerServiceTest.java @@ -15,8 +15,8 @@ import junit.framework.TestCase; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class DataMinerServiceTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBInfoTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBInfoTest.java index 20faf7c..a2f8796 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBInfoTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBInfoTest.java @@ -22,8 +22,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ListDBInfoTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBNameTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBNameTest.java index becc44d..e8be516 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBNameTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBNameTest.java @@ -22,8 +22,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ListDBNameTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBSchemaTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBSchemaTest.java index df1e022..0426add 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBSchemaTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListDBSchemaTest.java @@ -23,8 +23,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ListDBSchemaTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListTablesTest.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListTablesTest.java index 374a980..bac0c6c 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListTablesTest.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/ListTablesTest.java @@ -23,8 +23,8 @@ import org.slf4j.LoggerFactory; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public class ListTablesTest extends TestCase { diff --git a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/OperatorId.java b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/OperatorId.java index be269ef..41b1c5d 100644 --- a/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/OperatorId.java +++ b/src/test/java/org/gcube/data/analysis/dataminermanagercl/test/OperatorId.java @@ -2,8 +2,8 @@ package org.gcube.data.analysis.dataminermanagercl.test; /** * - * @author Giancarlo Panichi email: g.panichi@isti.cnr.it + * @author Giancarlo Panichi + * * */ public enum OperatorId {