Commit de13fc9a authored by Spiros Koulouzis's avatar Spiros Koulouzis

Created example code for component

parent 24adb25b
{ {
"creationDate": 1487002029722, "creationDate":1487002029722,
"parameters": [ "parameters":[
{ {
"url": null, "url":null,
"encoding": "UTF-8", "encoding":"UTF-8",
"value": {"cloud profile" :{ "cloud platform" :{ "identifier" : "cp001", "name" : "Mock ExoGENI", "description" : "Networked virtual infrastructure cloud platform ExoGENI.", "provides cloud" :[ { "identifier" : "cloud001", "name" : "ExoGENI Boston", "description" : "ExoGENI's Boston rack.", "domain" : "Boston", "end-point" : "r0.boston.exogeni.com", "provides VM" :[ "vm_type001", "vm_type002" ] }, { "identifier" : "cloud002", "name" : "ExoGENI Washington", "description" : "ExoGENI's Washington rack.", "domain" : "Washington", "end-point" : "r0.washington.exogeni.com", "provides VM" :[ "vm_type001", "vm_type002" ] } ], "accessed via" : "switch_default_broker" }, "virtual machines types" :[ { "identifier" : "ExoSmall", "name" : "ExoGENI small VM", "description" : "A small virtual machine with 1Ghz CPU and 512MB RAM.", "has property assignment" :[ { "assignment" : 1.0, "assigns to property" : "CpuClockSpeedProperty", "measured in unit" : "GigahertzUnit" }, { "assignment" : 512, "assigns to property" : "MemoryProperty", "measured in unit" : "MegaBytesUnit" } ], "allows VM image" :[ "vm_image_ubuntu0" ] }, { "identifier" : "ExoMedium", "name" : "ExoGENI medium VM", "description" : "A medium virtual machine with 3GHz CPU and 2GB RAM.", "has property assignment" :[ { "assignment" : 3.0, "assigns to property" : "CpuClockSpeedProperty", "measured in unit" : "GigahertzUnit" }, { "assignment" : 2, "assigns to property" : "MemoryProperty", "measured in unit" : "GigaBytesUnit" } ], "allows VM image" :[ "vm_image_ubuntu0", "vm_image_debian0" ] } ], "virtual machine images" :[ { "identifier" : "vm_image_ubuntu0", "name" : "Ubuntu 14.04 install image", "description" : "A VM image with Ubuntu 14.04 pre-installed.", "operating system" : "Ubuntu 14.04" }, { "identifier" : "vm_image_debian0", "name" : "Debian 8.0 install image", "description" : "A VM image with Debian 8.0 pre-installed.", "operating system" : "Debian 8.0" } ] }}, "value":{"cloudprofile":{"cloudplatform":{"identifier":"cp001","name":"MockExoGENI","description":"NetworkedvirtualinfrastructurecloudplatformExoGENI.","providescloud":[{"identifier":"cloud001","name":"ExoGENIBoston","description":"ExoGENI'sBostonrack.","domain":"Boston","end-point":"r0.boston.exogeni.com","providesVM":["vm_type001","vm_type002"]},{"identifier":"cloud002","name":"ExoGENIWashington","description":"ExoGENI'sWashingtonrack.","domain":"Washington","end-point":"r0.washington.exogeni.com","providesVM":["vm_type001","vm_type002"]}],"accessedvia":"switch_default_broker"},"virtualmachinestypes":[{"identifier":"ExoSmall","name":"ExoGENIsmallVM","description":"Asmallvirtualmachinewith1GhzCPUand512MBRAM.","haspropertyassignment":[{"assignment":1.0,"assignstoproperty":"CpuClockSpeedProperty","measuredinunit":"GigahertzUnit"},{"assignment":512,"assignstoproperty":"MemoryProperty","measuredinunit":"MegaBytesUnit"}],"allowsVMimage":["vm_image_ubuntu0"]},{"identifier":"ExoMedium","name":"ExoGENImediumVM","description":"Amediumvirtualmachinewith3GHzCPUand2GBRAM.","haspropertyassignment":[{"assignment":3.0,"assignstoproperty":"CpuClockSpeedProperty","measuredinunit":"GigahertzUnit"},{"assignment":2,"assignstoproperty":"MemoryProperty","measuredinunit":"GigaBytesUnit"}],"allowsVMimage":["vm_image_ubuntu0","vm_image_debian0"]}],"virtualmachineimages":[{"identifier":"vm_image_ubuntu0","name":"Ubuntu14.04installimage","description":"AVMimagewithUbuntu14.04pre-installed.","operatingsystem":"Ubuntu14.04"},{"identifier":"vm_image_debian0","name":"Debian8.0installimage","description":"AVMimagewithDebian8.0pre-installed.","operatingsystem":"Debian8.0"}]}},
"name": "profile", "name":"profile",
"attributes": null "attributes":null
} }
] ]
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{ {
"url": null, "url": null,
"encoding": "UTF-8", "encoding": "UTF-8",
"value": {u'2d13d708e3a9441ab8336ce874e08dd1': 'Small', u'8fcc1788d9ee462c826572c79fdb2a6a': 'Small', u'5e0add703c8a43938a39301f572e46c0': 'Small'}, "value": {"2d13d708e3a9441ab8336ce874e08dd1": "Small", "8fcc1788d9ee462c826572c79fdb2a6a": "Small", "5e0add703c8a43938a39301f572e46c0": "Small"},
"attributes": null "attributes": null
} }
] ]
......
...@@ -49,7 +49,7 @@ import org.json.JSONObject; ...@@ -49,7 +49,7 @@ import org.json.JSONObject;
* *
* @author S. Koulouzis * @author S. Koulouzis
*/ */
public class Consumer extends DefaultConsumer { public class Consumer extends DefaultConsumer {
private final Channel channel; private final Channel channel;
...@@ -72,7 +72,6 @@ public class Consumer extends DefaultConsumer { ...@@ -72,7 +72,6 @@ public class Consumer extends DefaultConsumer {
.build(); .build();
String response = ""; String response = "";
try { try {
//The queue only moves bytes so we need to convert them to stting //The queue only moves bytes so we need to convert them to stting
String message = new String(body, "UTF-8"); String message = new String(body, "UTF-8");
...@@ -85,7 +84,6 @@ public class Consumer extends DefaultConsumer { ...@@ -85,7 +84,6 @@ public class Consumer extends DefaultConsumer {
channel.basicPublish("", properties.getReplyTo(), replyProps, response.getBytes("UTF-8")); channel.basicPublish("", properties.getReplyTo(), replyProps, response.getBytes("UTF-8"));
channel.basicAck(envelope.getDeliveryTag(), false); channel.basicAck(envelope.getDeliveryTag(), false);
} }
} }
/** /**
......
...@@ -67,7 +67,7 @@ public class RPCServer { ...@@ -67,7 +67,7 @@ public class RPCServer {
Logger.getLogger(RPCServer.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(RPCServer.class.getName()).log(Level.SEVERE, null, ex);
} }
} else { } else {
String resourceName = "provisioner.properies"; String resourceName = "provisioner.properties";
ClassLoader loader = Thread.currentThread().getContextClassLoader(); ClassLoader loader = Thread.currentThread().getContextClassLoader();
try (InputStream resourceStream = loader.getResourceAsStream(resourceName)) { try (InputStream resourceStream = loader.getResourceAsStream(resourceName)) {
prop.load(resourceStream); prop.load(resourceStream);
......
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