ref 11711: SAI - Add a simple text viewer so that log files created by Data Miner algorithms can be directly viewed in the browser
https://support.d4science.org/issues/11711 Added service info[ticket #12594] Added support to show log information [ticket #11711] Added support to show files html, json, pdf, txt [ticket #17106] Updated information show to the user when a computation is submitted [ticket #17030] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/data-miner-manager-cl@181877 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
99efe07a1c
commit
a39d350e59
|
@ -48,7 +48,6 @@ import org.gcube.data.analysis.dataminermanagercl.shared.process.Operator;
|
|||
import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorCategory;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorsClassification;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.service.ServiceInfo;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.service.ServiceInfoData;
|
||||
import org.n52.wps.client.ExecuteRequestBuilder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -216,19 +215,18 @@ public class SClient4WPS extends SClient {
|
|||
@Override
|
||||
public ServiceInfo getServiceInfo() throws ServiceException {
|
||||
try {
|
||||
ArrayList<ServiceInfoData> serviceProperties = new ArrayList<>();
|
||||
|
||||
ServiceInfo serviceInfo=null;
|
||||
if (discoveredByIS) {
|
||||
logger.info("DataMiner Service discovered by IS");
|
||||
serviceProperties = InformationSystemUtils.retrieveServiceProperties(
|
||||
serviceInfo = InformationSystemUtils.retrieveServiceInfo(
|
||||
Constants.DATAMINER_SERVICE_CATEGORY, Constants.DATA_MINER_SERVICE_NAME,
|
||||
serviceCredentials.getScope());
|
||||
} else {
|
||||
logger.info("DataMiner Service not discovered by IS no properties available");
|
||||
serviceProperties
|
||||
.add(new ServiceInfoData("Address", serviceAddress, Constants.DEFAULT_SERVICE_INFO_CATEGORY));
|
||||
serviceInfo=new ServiceInfo(serviceAddress,null);
|
||||
|
||||
}
|
||||
ServiceInfo serviceInfo = new ServiceInfo(serviceProperties);
|
||||
logger.info("Service Info retrieved: " + serviceInfo);
|
||||
return serviceInfo;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.gcube.common.resources.gcore.ServiceEndpoint.Property;
|
|||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.Constants;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.exception.ServiceException;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.service.ServiceInfo;
|
||||
import org.gcube.data.analysis.dataminermanagercl.shared.service.ServiceInfoData;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
||||
|
@ -69,13 +70,13 @@ public class InformationSystemUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static ArrayList<ServiceInfoData> retrieveServiceProperties(String category, String name, String scope)
|
||||
public static ServiceInfo retrieveServiceInfo(String category, String name, String scope)
|
||||
throws Exception {
|
||||
try {
|
||||
logger.debug("Retrieve Service Properties");
|
||||
ArrayList<ServiceInfoData> serviceProperties = new ArrayList<>();
|
||||
|
||||
if (scope == null || scope.length() == 0)
|
||||
return serviceProperties;
|
||||
return null;
|
||||
|
||||
ScopeProvider.instance.set(scope);
|
||||
|
||||
|
@ -86,14 +87,16 @@ public class InformationSystemUtils {
|
|||
DiscoveryClient<AccessPoint> client = ICFactory.clientFor(AccessPoint.class);
|
||||
List<AccessPoint> accessPointList = client.submit(query);
|
||||
|
||||
String serviceAddress=null;
|
||||
ArrayList<ServiceInfoData> serviceProperties = new ArrayList<>();
|
||||
|
||||
if (accessPointList != null && !accessPointList.isEmpty()) {
|
||||
AccessPoint accessPoint = accessPointList.get(0);
|
||||
if (accessPoint.address() != null && !accessPoint.address().isEmpty()) {
|
||||
String accessPointAddress = accessPoint.address();
|
||||
int wpsWebProcessingServiceIndex = accessPointAddress.indexOf(Constants.WPSWebProcessingService);
|
||||
if (wpsWebProcessingServiceIndex > 0) {
|
||||
String address = accessPointAddress.substring(0, wpsWebProcessingServiceIndex);
|
||||
serviceProperties.add(new ServiceInfoData("Address", address, Constants.DEFAULT_SERVICE_INFO_CATEGORY));
|
||||
serviceAddress = accessPointAddress.substring(0, wpsWebProcessingServiceIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,11 +121,13 @@ public class InformationSystemUtils {
|
|||
}
|
||||
|
||||
}
|
||||
logger.debug("Service Properties: " + serviceProperties);
|
||||
return serviceProperties;
|
||||
ServiceInfo serviceInfo=new ServiceInfo(serviceAddress,serviceProperties);
|
||||
|
||||
logger.debug("Service Info: " + serviceInfo);
|
||||
return serviceInfo;
|
||||
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in discovery DataMiner Service Endpoint Properties in scope: " + scope);
|
||||
logger.error("Error in discovery DataMiner Service Endpoint Info in scope: " + scope);
|
||||
logger.error(e.getLocalizedMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
|
|
|
@ -12,17 +12,27 @@ import java.util.ArrayList;
|
|||
public class ServiceInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 9046784925213335261L;
|
||||
private String serviceAddress;
|
||||
private ArrayList<ServiceInfoData> serviceProperties;
|
||||
|
||||
public ServiceInfo() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ServiceInfo(ArrayList<ServiceInfoData> serviceProperties) {
|
||||
public ServiceInfo(String serviceAddress, ArrayList<ServiceInfoData> serviceProperties) {
|
||||
super();
|
||||
this.serviceAddress = serviceAddress;
|
||||
this.serviceProperties = serviceProperties;
|
||||
}
|
||||
|
||||
public String getServiceAddress() {
|
||||
return serviceAddress;
|
||||
}
|
||||
|
||||
public void setServiceAddress(String serviceAddress) {
|
||||
this.serviceAddress = serviceAddress;
|
||||
}
|
||||
|
||||
public ArrayList<ServiceInfoData> getServiceProperties() {
|
||||
return serviceProperties;
|
||||
}
|
||||
|
@ -33,7 +43,7 @@ public class ServiceInfo implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ServiceInfo [serviceProperties=" + serviceProperties + "]";
|
||||
return "ServiceInfo [serviceAddress=" + serviceAddress + ", serviceProperties=" + serviceProperties + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue