public String getProcessID(){ return processDescription.getIdentifier().getStringValue(); }
@Override public String getWellKnownName() { return getDescription().getIdentifier().getStringValue(); }
private void addAlgorithm(File processDescriptionFile){ ProcessDescriptionType pd = this.loadProcessDescription(processDescriptionFile); String processID = pd.getIdentifier().getStringValue(); LOGGER.debug("Registering: " + processID); this.registeredProcessDescriptions.put(processID, pd); ToolParameter[] params = this.loadParameters(pd); this.registeredAlgorithmParameters.put(processID, params); if (!pd.validate()){ LOGGER.debug("ProcessDescription is not valid. Removing " + processID + " from Repository."); this.registeredProcessDescriptions.remove(processID); this.registeredAlgorithmParameters.remove(processID); } }
public boolean addAlgorithm(Object describeProcess) { String processName = ""; ProcessDescriptionType document = null; try { if(describeProcess instanceof File){ document = ProcessDescriptionType.Factory.parse((File)describeProcess); } if(describeProcess instanceof ProcessDescriptionType){ document = (ProcessDescriptionType) describeProcess; } } catch (IOException e) { LOGGER.warn("Could not add Sextante Extension Process. Identifier: Unknown", e); e.printStackTrace(); } catch (XmlException e) { e.printStackTrace(); } if(describeProcess == null){ throw new RuntimeException("Could not add process"); } registeredProcesses.put(document.getIdentifier().getStringValue(), document); LOGGER.info("Sextante Extension Process "+ processName + " added successfully"); return true; }
/** * return the processDescription for a specific process from Cache. * @param serverID * @param processID * @return a ProcessDescription for a specific process from Cache. * @throws IOException */ 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; } } return null; }
System.out.println("Load dynamic class <" + algorithmInput.getProcessDescription().getIdentifier().getStringValue() + ">."); .loadClass(algorithmInput.getProcessDescription().getIdentifier().getStringValue());
if (!processDescription.getIdentifier().getStringValue().equals(this.getClass().getName()) && !processDescription.getIdentifier().getStringValue().equals(this.getWellKnownName())) processDescription.getIdentifier().setStringValue(this.getClass().getName()); LOGGER.warn("Identifier was not correct, was changed now temporary for server use to " + this.getClass().getName() + ". Please change it later in the description!");
public String[] getProcessNames(String url) throws IOException { 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(); } return processNames; }
public Map<String, IData> run(Map<String, List<IData>> pInputData) { try { List<Map<String, List<IData>>> inputDataList = split(pInputData); UnicoreClient client = new UnicoreClient(); List<UnicoreAlgorithmOutput> outputDataList = client.perform(UnicoreAlgorithmInput.transform(inputDataList, embeddedAlgorithm.getDescription() .getIdentifier().getStringValue())); Map<String, IData> outputData = merge(UnicoreAlgorithmOutput.transform(outputDataList)); return outputData; } catch (Exception e) { LOGGER.error(e); throw new RuntimeException(e); } } }
public ExecuteRequestBuilder(ProcessDescriptionType processDesc) { this.processDesc = processDesc; execute = ExecuteDocument.Factory.newInstance(); Execute ex = execute.addNewExecute(); ex.setService("WPS"); ex.setVersion(SUPPORTED_VERSION); ex.addNewIdentifier().setStringValue(processDesc.getIdentifier().getStringValue()); ex.addNewDataInputs(); }
LOGGER.debug("Input cannot be found in description for " + this.processDesc.getIdentifier().getStringValue() + "," + inputID); throw new RuntimeException("Input cannot be found in description for " + this.processDesc.getIdentifier().getStringValue() + "," + inputID);
LOGGER.debug("Input cannot be found in description for " + processDesc.getIdentifier().getStringValue() + "," + inputId);
request = request + processDesc.getIdentifier().getStringValue(); request = request + "&DataInputs="; InputType[] inputs = execute.getExecute().getDataInputs().getInputArray();