Permalink
Browse files

Fix error in serialization after diff

  • Loading branch information...
nicolasferry committed Nov 10, 2015
1 parent 1f41fb8 commit d150da69373d6ef749318733f096237e61acfa38
@@ -47,6 +47,7 @@
import java.io.IOException;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -226,6 +226,18 @@ public void deploy(Deployment targetModel, CloudMLModelComparator diff){
if(coordinator != null) {
coordinator.ack("Adaptation completed", this.getClass().getName());
}
//MODAClouds specific code
if(targetModel.getProperties().get("sla_url") != null && targetModel.getProperties().get("agreement_id") != null){
Boolean status=startSLA(targetModel.getProperties().get("sla_url").getValue(),targetModel.getProperties().get("agreement_id").getValue());
if(status){
journal.log(Level.INFO, ">> SLA management started");
}else{
journal.log(Level.INFO, ">> SLA management not started");
}
}
}
private void unlessNotNull(String message, Object... obj) {
@@ -420,6 +420,8 @@ private void saveMetadata(Deployment deploy2) {
diff = new CloudMLModelComparator(deploy, deploy2);
diff.compareCloudMLModel();
deploy.setName(deploy2.getName());
deploy.getComponents().addAll(deploy2.getComponents());
deploy.getRelationships().addAll(deploy2.getRelationships());
@@ -60,7 +60,7 @@
CommandExecutor executor = null;
List<Change> changeList = new ArrayList<Change>();
NodificationCentre notificationCentre = new NodificationCentre();
JsonCodec jsonCodec = new JsonCodec();
Instruction lastInstruction = null;
@@ -244,6 +244,7 @@ public String codec(Object object) {
if (object instanceof Deployment) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
JsonCodec jsonCodec = new JsonCodec();
jsonCodec.save((Deployment) object, baos);
return baos.toString("UTF-8");
} catch (UnsupportedEncodingException ex) {

0 comments on commit d150da6

Please sign in to comment.