Skip to content
Snippets Groups Projects
Commit fb138565 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

First version with support for piping of config from VIPSLogic to VIPSCore and...

First version with support for piping of config from VIPSLogic to VIPSCore and piping of results from VIPSCore all the way back to VIPSLogic.
parent c8d5ebd6
No related branches found
No related tags found
No related merge requests found
......@@ -7,10 +7,11 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import no.bioforsk.vips.entity.ModelRunRequest;
/**
* Interface for the ManagerResource. Implemented by ManagerResourceImpl
* in VIPSCoreManager and also as client in VIPSBatch
* in VIPSCoreManager and also as client in VIPSLogic
* @copyright 2013 <a href="http://www.bioforsk.no/">Bioforsk</a>
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/
......@@ -36,7 +37,7 @@ public interface ManagerResource {
@Path("models/{modelId}/run")
@Consumes("application/json")
@Produces("application/json")
public Response runModel(@PathParam("modelId") String modelId, Map<String,Object> input);
public Response runModel(@PathParam("modelId") String modelId, ModelRunRequest request);
}
......@@ -14,7 +14,7 @@ import java.util.Map;
public class ModelConfiguration {
private String modelId;
private Map<String, Object> configParameters;
public ModelConfiguration()
{
}
......@@ -71,5 +71,5 @@ public class ModelConfiguration {
this.configParameters = configParameters;
}
}
package no.bioforsk.vips.entity;
import java.util.Map;
/**
* @copyright 2013 <a href="http://www.bioforsk.no/">Bioforsk</a>
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/
public class ModelRunRequest {
private Map<String, Object> configParameters;
private Map<String,String> loginInfo;
private String modelId;
private Integer batchSystemClientId;
/**
* Dummy constructor for Jackson
*/
public ModelRunRequest(){
}
public ModelRunRequest(ModelConfiguration config)
{
this.configParameters = config.getConfigParameters();
this.modelId = config.getModelId();
}
/**
* @return the credentials
*/
public Map<String,String> getLoginInfo() {
return this.loginInfo;
}
/**
* @param credentials the credentials to set
*/
public void setLoginInfo(Map<String,String> loginInfo) {
this.loginInfo = loginInfo;
}
/**
* @return the batchSystemClientId
*/
public Integer getBatchSystemClientId() {
return batchSystemClientId;
}
/**
* @param batchSystemClientId the batchSystemClientId to set
*/
public void setBatchSystemClientId(Integer batchSystemClientId) {
this.batchSystemClientId = batchSystemClientId;
}
/**
* @return the modelId
*/
public String getModelId() {
return modelId;
}
/**
* @param modelId the modelId to set
*/
public void setModelId(String modelId) {
this.modelId = modelId;
}
/**
* @return the configParameters
*/
public Map<String, Object> getConfigParameters() {
return configParameters;
}
/**
* @param configParameters the configParameters to set
*/
public void setConfigParameters(Map<String, Object> configParameters) {
this.configParameters = configParameters;
}
}
......@@ -3,12 +3,14 @@ package no.bioforsk.vips.entity;
import java.util.Date;
import java.util.Map;
import java.util.Set;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
/**
* Represents a result from a model run
* @copyright 2013 {@link http://www.bioforsk.no Bioforsk}
* @author Tor-Einar Skog <tor-einar.skog@hyper.no>
*/
@JsonDeserialize(as=ResultImpl.class)
public interface Result extends Comparable{
public final static Integer WARNING_STATUS_NO_WARNING = 0;
......@@ -28,6 +30,7 @@ public interface Result extends Comparable{
/* Setting and getting values */
public void setValue(String key, String value);
public String getValue(String key);
public void setAllValues(Map<String,String> values);
public Map<String,String> getAllValues();
public void setWarningStatus(Integer warningStatus);
......
......@@ -13,7 +13,7 @@ import java.util.Set;
public class ResultImpl implements Result{
private Date resultValidTime;
private Set<String> keys;
private HashMap<String, String> values;
private Map<String, String> values;
private Integer warningStatus;
@Override
......@@ -52,6 +52,11 @@ public class ResultImpl implements Result{
public Map<String, String> getAllValues() {
return this.values;
}
@Override
public void setAllValues(Map<String, String> values){
this.values = values;
}
/**
* Sorting by timestamp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment