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:
parent
1c89571edf
commit
2f5abe7528
|
@ -279,6 +279,11 @@ public class SClient4WPS extends SClient {
|
||||||
LinkedHashMap<String, String> operatorsToCategoriesMap = new LinkedHashMap<>();
|
LinkedHashMap<String, String> operatorsToCategoriesMap = new LinkedHashMap<>();
|
||||||
LinkedHashMap<String, List<Operator>> categoriesToOperatorsMap = new LinkedHashMap<>();
|
LinkedHashMap<String, List<Operator>> categoriesToOperatorsMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
if(refresh){
|
||||||
|
logger.debug("Clear Processes Descriptions: Refresh");
|
||||||
|
process.clear();
|
||||||
|
}
|
||||||
|
|
||||||
requestCapability(refresh);
|
requestCapability(refresh);
|
||||||
if (processesBriefs == null || processesDescriptionType == null) {
|
if (processesBriefs == null || processesDescriptionType == null) {
|
||||||
throw new ServiceException("Algorithms WPS not available!");
|
throw new ServiceException("Algorithms WPS not available!");
|
||||||
|
@ -430,6 +435,8 @@ public class SClient4WPS extends SClient {
|
||||||
processesDescriptionType = null;
|
processesDescriptionType = null;
|
||||||
processesBriefs = null;
|
processesBriefs = null;
|
||||||
|
|
||||||
|
logger.debug("Request Capability: refresh="+refresh);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
wpsClient = createWPSClientSession();
|
wpsClient = createWPSClientSession();
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class SClient4WPSSession implements Serializable {
|
||||||
if (loggedServices.containsKey(url)) {
|
if (loggedServices.containsKey(url)) {
|
||||||
loggedServices.remove(url);
|
loggedServices.remove(url);
|
||||||
}
|
}
|
||||||
if(processDescriptions.containsKey(url)){
|
if (processDescriptions.containsKey(url)) {
|
||||||
processDescriptions.remove(url);
|
processDescriptions.remove(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,8 +238,7 @@ public class SClient4WPSSession implements Serializable {
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* IOException
|
* IOException
|
||||||
*/
|
*/
|
||||||
private ProcessDescriptionsDocument getProcessDescriptionsFromCache(String wpsUrl)
|
private ProcessDescriptionsDocument getProcessDescriptionsFromCache(String wpsUrl) throws IOException {
|
||||||
throws IOException {
|
|
||||||
if (!descriptionsAvailableInCache(wpsUrl)) {
|
if (!descriptionsAvailableInCache(wpsUrl)) {
|
||||||
try {
|
try {
|
||||||
connect(wpsUrl);
|
connect(wpsUrl);
|
||||||
|
@ -321,7 +320,7 @@ public class SClient4WPSSession implements Serializable {
|
||||||
public ProcessDescriptionsDocument describeAllProcesses(String url) throws WPSClientException {
|
public ProcessDescriptionsDocument describeAllProcesses(String url) throws WPSClientException {
|
||||||
CapabilitiesDocument doc = loggedServices.get(url);
|
CapabilitiesDocument doc = loggedServices.get(url);
|
||||||
if (doc == null) {
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
ProcessBriefType[] processes = doc.getCapabilities().getProcessOfferings().getProcessArray();
|
ProcessBriefType[] processes = doc.getCapabilities().getProcessOfferings().getProcessArray();
|
||||||
|
@ -420,7 +419,7 @@ public class SClient4WPSSession implements Serializable {
|
||||||
logger.debug("retrieveCapsViaGET: " + url);
|
logger.debug("retrieveCapsViaGET: " + url);
|
||||||
ClientCapabiltiesRequest req = new ClientCapabiltiesRequest();
|
ClientCapabiltiesRequest req = new ClientCapabiltiesRequest();
|
||||||
url = req.getRequest(url);
|
url = req.getRequest(url);
|
||||||
logger.debug("url req: "+url);
|
logger.debug("url req: " + url);
|
||||||
try {
|
try {
|
||||||
String authString = user + ":" + password;
|
String authString = user + ":" + password;
|
||||||
logger.debug("auth string: " + authString);
|
logger.debug("auth string: " + authString);
|
||||||
|
@ -433,19 +432,19 @@ public class SClient4WPSSession implements Serializable {
|
||||||
connection.setRequestMethod("GET");
|
connection.setRequestMethod("GET");
|
||||||
connection.setDoOutput(true);
|
connection.setDoOutput(true);
|
||||||
connection.setRequestProperty("Authorization", "Basic " + encoded);
|
connection.setRequestProperty("Authorization", "Basic " + encoded);
|
||||||
logger.debug("Request: "+connection.toString());
|
logger.debug("Request: " + connection.toString());
|
||||||
InputStream is = connection.getInputStream();
|
InputStream is = connection.getInputStream();
|
||||||
Document doc = checkInputStream(is);
|
Document doc = checkInputStream(is);
|
||||||
CapabilitiesDocument capabilitiesDocument = CapabilitiesDocument.Factory.parse(doc, options);
|
CapabilitiesDocument capabilitiesDocument = CapabilitiesDocument.Factory.parse(doc, options);
|
||||||
return capabilitiesDocument;
|
return capabilitiesDocument;
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
logger.error(e.getLocalizedMessage(),e);
|
logger.error(e.getLocalizedMessage(), e);
|
||||||
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) {
|
} 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);
|
throw new WPSClientException("Error occured while retrieving capabilities from url: " + url, e);
|
||||||
} catch (XmlException e) {
|
} catch (XmlException e) {
|
||||||
logger.error(e.getLocalizedMessage(),e);
|
logger.error(e.getLocalizedMessage(), e);
|
||||||
throw new WPSClientException("Error occured while parsing XML", e);
|
throw new WPSClientException("Error occured while parsing XML", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -501,6 +500,7 @@ public class SClient4WPSSession implements Serializable {
|
||||||
options);
|
options);
|
||||||
|
|
||||||
Files.delete(tempFile);
|
Files.delete(tempFile);
|
||||||
|
logger.debug("RetrieveDescriptions via GET: success");
|
||||||
return processDescriptionsDocument;
|
return processDescriptionsDocument;
|
||||||
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
|
|
Loading…
Reference in New Issue