ref 11819: SW Test org.gcube.portlet-user.data-miner-manager

https://support.d4science.org/issues/11819

Fixed to support System parameters on service

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/data-miner-manager-cl@167772 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-05-25 15:27:01 +00:00
parent 1c89571edf
commit 2f5abe7528
2 changed files with 21 additions and 14 deletions

View File

@ -278,7 +278,12 @@ public class SClient4WPS extends SClient {
logger.debug("getOperatorsClassifications: "+refresh);
LinkedHashMap<String, String> operatorsToCategoriesMap = new LinkedHashMap<>();
LinkedHashMap<String, List<Operator>> categoriesToOperatorsMap = new LinkedHashMap<>();
if(refresh){
logger.debug("Clear Processes Descriptions: Refresh");
process.clear();
}
requestCapability(refresh);
if (processesBriefs == null || processesDescriptionType == null) {
throw new ServiceException("Algorithms WPS not available!");
@ -429,7 +434,9 @@ public class SClient4WPS extends SClient {
SClient4WPSSession wpsClient = null;
processesDescriptionType = null;
processesBriefs = null;
logger.debug("Request Capability: refresh="+refresh);
try {
wpsClient = createWPSClientSession();

View File

@ -105,12 +105,12 @@ public class SClient4WPSSession implements Serializable {
if (refresh) {
logger.debug("LoggedServices: " + loggedServices.keySet());
if (loggedServices.containsKey(url)) {
loggedServices.remove(url);
loggedServices.remove(url);
}
if(processDescriptions.containsKey(url)){
if (processDescriptions.containsKey(url)) {
processDescriptions.remove(url);
}
CapabilitiesDocument capsDoc = retrieveCapsViaGET(url);
if (capsDoc != null) {
logger.debug("Adding caps to logged services " + url);
@ -141,7 +141,7 @@ public class SClient4WPSSession implements Serializable {
} else {
logger.debug("Service not registered");
}
CapabilitiesDocument capsDoc = retrieveCapsViaGET(url);
if (capsDoc != null) {
logger.debug("Adding caps to logged services " + url);
@ -238,8 +238,7 @@ public class SClient4WPSSession implements Serializable {
* @throws IOException
* IOException
*/
private ProcessDescriptionsDocument getProcessDescriptionsFromCache(String wpsUrl)
throws IOException {
private ProcessDescriptionsDocument getProcessDescriptionsFromCache(String wpsUrl) throws IOException {
if (!descriptionsAvailableInCache(wpsUrl)) {
try {
connect(wpsUrl);
@ -321,7 +320,7 @@ public class SClient4WPSSession implements Serializable {
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");
logger.debug("serviceCaps are null, perhaps server does not exist");
return null;
}
ProcessBriefType[] processes = doc.getCapabilities().getProcessOfferings().getProcessArray();
@ -420,7 +419,7 @@ public class SClient4WPSSession implements Serializable {
logger.debug("retrieveCapsViaGET: " + url);
ClientCapabiltiesRequest req = new ClientCapabiltiesRequest();
url = req.getRequest(url);
logger.debug("url req: "+url);
logger.debug("url req: " + url);
try {
String authString = user + ":" + password;
logger.debug("auth string: " + authString);
@ -433,19 +432,19 @@ public class SClient4WPSSession implements Serializable {
connection.setRequestMethod("GET");
connection.setDoOutput(true);
connection.setRequestProperty("Authorization", "Basic " + encoded);
logger.debug("Request: "+connection.toString());
logger.debug("Request: " + connection.toString());
InputStream is = connection.getInputStream();
Document doc = checkInputStream(is);
CapabilitiesDocument capabilitiesDocument = CapabilitiesDocument.Factory.parse(doc, options);
return capabilitiesDocument;
} catch (MalformedURLException e) {
logger.error(e.getLocalizedMessage(),e);
logger.error(e.getLocalizedMessage(), e);
throw new WPSClientException("Capabilities URL seems to be unvalid: " + url, e);
} catch (IOException e) {
logger.error(e.getLocalizedMessage(),e);
logger.error(e.getLocalizedMessage(), e);
throw new WPSClientException("Error occured while retrieving capabilities from url: " + url, e);
} catch (XmlException e) {
logger.error(e.getLocalizedMessage(),e);
logger.error(e.getLocalizedMessage(), e);
throw new WPSClientException("Error occured while parsing XML", e);
}
}
@ -501,6 +500,7 @@ public class SClient4WPSSession implements Serializable {
options);
Files.delete(tempFile);
logger.debug("RetrieveDescriptions via GET: success");
return processDescriptionsDocument;
} catch (MalformedURLException e) {