use of org.vcell.api.client.VCellOptClient in project vcell by virtualcell.
the class OptimizationServerResource method get_json.
@Override
public JsonRepresentation get_json() {
try {
// VCellApiApplication application = ((VCellApiApplication)getApplication());
// User vcellUser = application.getVCellUser(getChallengeResponse(),AuthenticationPolicy.prohibitInvalidCredentials);
String optimizationId = (String) getRequestAttributes().get(VCellApiApplication.OPTIMIZATIONID);
VCellOptClient optClient = new VCellOptClient("opt", 8080);
String optRunString = optClient.getOptRunJson(optimizationId);
JsonRepresentation optRunJsonRep = new JsonRepresentation(optRunString);
return optRunJsonRep;
// } catch (PermissionException e) {
// e.printStackTrace();
// throw new ResourceException(Status.CLIENT_ERROR_UNAUTHORIZED, "permission denied to requested resource");
} catch (Exception e) {
throw new ResourceException(Status.SERVER_ERROR_INTERNAL, e.getMessage());
}
}
Aggregations