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, 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!");
|
||||
|
@ -430,6 +435,8 @@ public class SClient4WPS extends SClient {
|
|||
processesDescriptionType = null;
|
||||
processesBriefs = null;
|
||||
|
||||
logger.debug("Request Capability: refresh="+refresh);
|
||||
|
||||
try {
|
||||
wpsClient = createWPSClientSession();
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ public class SClient4WPSSession implements Serializable {
|
|||
if (loggedServices.containsKey(url)) {
|
||||
loggedServices.remove(url);
|
||||
}
|
||||
if(processDescriptions.containsKey(url)){
|
||||
if (processDescriptions.containsKey(url)) {
|
||||
processDescriptions.remove(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) {
|
||||
|
|
Loading…
Reference in New Issue