Commit 5575312d authored by Spiros Koulouzis's avatar Spiros Koulouzis

Update planner controller to save tosca result

parent e4ff23bc
...@@ -87,26 +87,22 @@ public class PlannerController { ...@@ -87,26 +87,22 @@ public class PlannerController {
dripComponetens.add(planner); dripComponetens.add(planner);
Message plannerReturnedMessage = planner.call(plannerInvokationMessage); Message plannerReturnedMessage = planner.call(plannerInvokationMessage);
List<Parameter> toscaFiles = plannerReturnedMessage.getParameters(); List<Parameter> toscaFiles = plannerReturnedMessage.getParameters();
ToscaRepresentation tr = new ToscaRepresentation();
StringBuilder name = new StringBuilder();
StringBuilder value = new StringBuilder();
String prefix = "";
for (Parameter p : toscaFiles) { for (Parameter p : toscaFiles) {
ToscaRepresentation tr = new ToscaRepresentation();
Map<String, String> attributess = p.getAttributes(); Map<String, String> attributess = p.getAttributes();
String level = attributess.get("level"); String originalFileName = p.getName();
name.append(prefix); String name = System.currentTimeMillis() + "_" + originalFileName;
name.append(p.getName());
value.append(p.getValue()); tr.setName(name);
value.append("\n"); tr.setKvMap(Converter.ymlString2Map(p.getValue()));
toscaDao.save(tr);
} }
tr.setName(name.toString());
tr.setKvMap(Converter.ymlString2Map(toscaId));
toscaDao.save(tr);
// Message provisionerInvokationMessage = buildProvisionerMessage(plannerReturnedMessage, "58a7281c55363e65b3c9eb82"); // Message provisionerInvokationMessage = buildProvisionerMessage(plannerReturnedMessage, "58a7281c55363e65b3c9eb82");
// provisioner = new ProvisionerCaller(messageBrokerHost); // provisioner = new ProvisionerCaller(messageBrokerHost);
// dripComponetens.add(provisioner); // dripComponetens.add(provisioner);
// provisioner.call(provisionerInvokationMessage); // provisioner.call(provisionerInvokationMessage);
return tr.getId(); return "";//tr.getId();
} catch (JSONException | IOException | TimeoutException | InterruptedException ex) { } catch (JSONException | IOException | TimeoutException | InterruptedException ex) {
Logger.getLogger(PlannerController.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(PlannerController.class.getName()).log(Level.SEVERE, null, ex);
} finally { } finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment