Commit 83650907 authored by Kyriakos Kritikos's avatar Kyriakos Kritikos

Updates due to modifications to CAMEL

parent 895763fb
......@@ -7,23 +7,18 @@
xsi:schemaLocation="http://www.paasage.eu/camel/location camel.ecore#//location"
name="Cloud Location Model">
<cloudLocations
name="Virtual Data Center"
abbreviation="VDC">
id="Virtual Data Center">
<subLocations
name="1ff16f43-4a82-34bf-8f07-ea6d210548ab"
abbreviation="KVM"
id="1ff16f43-4a82-34bf-8f07-ea6d210548ab"
parent="//@cloudLocations.0"/>
<subLocations
name="e92bb306-72cd-33a2-a952-908db2f47e98"
abbreviation="CEPH"
id="e92bb306-72cd-33a2-a952-908db2f47e98"
parent="//@cloudLocations.0"/>
</cloudLocations>
<cloudLocations
name="Region One"
abbreviation="One">
id="Region One">
<subLocations
name="Availability Zone Nova"
abbreviation="Nova"
id="Availability Zone Nova"
parent="//@cloudLocations.1"/>
</cloudLocations>
</location:LocationModel>
<?xml version="1.0" encoding="ASCII"?>
<camel:CamelModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://www.paasage.eu/camel" xmlns:organisation="http://www.paasage.eu/camel/organisation" xmlns:provider="http://www.paasage.eu/camel/provider" xmlns:type="http://www.paasage.eu/camel/type" xmlns:unit="http://www.paasage.eu/camel/unit" xsi:schemaLocation="http://www.paasage.eu/camel camel.ecore http://www.paasage.eu/camel/organisation camel.ecore#//organisation http://www.paasage.eu/camel/provider camel.ecore#//provider http://www.paasage.eu/camel/type camel.ecore#//type http://www.paasage.eu/camel/unit camel.ecore#//unit" name="Flexiant Camel Model">
<locationModels name="Flexiant Location">
<countries name="United Kingdom"/>
<countries name="United Kingdom" id="UK"/>
</locationModels>
<organisationModels name="Flexiant Organisation Model">
<provider name="Flexiant" www="www.flexiant.com" postalAddress="Flexiant Limited, Geddes House, Kirkton North, Livingston, EH54 6GU, UK" email="contact@flexiant.com" public="true" PaaS="true" IaaS="true" providerModel="//@providerModels.0"/>
......
<?xml version="1.0" encoding="ASCII"?>
<camel:CamelModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://www.paasage.eu/camel" xmlns:organisation="http://www.paasage.eu/camel/organisation" xmlns:provider="http://www.paasage.eu/camel/provider" xmlns:type="http://www.paasage.eu/camel/type" xmlns:unit="http://www.paasage.eu/camel/unit" xsi:schemaLocation="http://www.paasage.eu/camel camel.ecore http://www.paasage.eu/camel/organisation camel.ecore#//organisation http://www.paasage.eu/camel/provider camel.ecore#//provider http://www.paasage.eu/camel/type camel.ecore#//type http://www.paasage.eu/camel/unit camel.ecore#//unit" name="GWDG Camel Model">
<locationModels name="GWDG Location Model">
<countries name="Germany"/>
<countries name="Germany" id="DE"/>
</locationModels>
<organisationModels name="GWDG Organisation Model">
<provider xsi:type="organisation:CloudProvider" name="GWDG" www="www.gwdg.de" postalAddress="GWDG, Am Fa&#xdf;berg 11, 37077 G&#xf6;ttingen, Germany" email="gwdg@gwdg.de" public="true" PaaS="true" IaaS="true" providerModel="//@providerModels.0"/>
......
......@@ -48,6 +48,7 @@ import eu.paasage.camel.unit.TimeIntervalUnit;
import eu.paasage.camel.unit.TransactionUnit;
import eu.paasage.camel.unit.Unit;
import eu.paasage.camel.unit.UnitFactory;
import eu.paasage.camel.unit.UnitModel;
import eu.paasage.camel.unit.UnitType;
import eu.paasage.mddb.cdo.client.CDOClient;
import eu.paasage.mddb.model.importer.location.LocationGenerator;
......@@ -296,19 +297,18 @@ public class ModelImporter {
DataCenter flexiant = trans.createQuery("hql", "select dc from CloudProvider cp, DataCenter dc where cp.name='Flexiant' and dc.cloudProvider=cp").getResult(DataCenter.class).get(0);
DataCenter gwdg = trans.createQuery("hql", "select dc from CloudProvider cp, DataCenter dc where cp.name='GWDG' and dc.cloudProvider=cp").getResult(DataCenter.class).get(0);
for(CloudLocation cloc: cloudLocations){
String abrv = cloc.getAbbreviation();
System.out.println("Checking CloudLocation: " + cloc.getName() + " with abbreviation: " + abrv);
String id = cloc.getId();
System.out.println("Checking CloudLocation: " + id);
CloudLocation cloc2 = LocationFactory.eINSTANCE.createCloudLocation();
cloc2.setName(cloc.getName());
cloc2.setAbbreviation(cloc.getAbbreviation());
cloc2.setId(cloc.getId());
cloc2.setIsAssignable(cloc.isIsAssignable());
EList<CloudLocation> subLocs = cloc2.getSubLocations();
subLocs.addAll(cloc.getSubLocations());
for(CloudLocation subLoc: subLocs) subLoc.setParent(cloc2);
if (abrv.equals("VDC")){
if (id.equals("VDC")){
cloc2.setGeographicalRegion((GeographicalRegion)flexiant.getLocation());
}
else if (abrv.equals("One")){
else if (id.equals("One")){
//System.out.println("Adding CloudLocation for GWDG");
cloc2.setGeographicalRegion((GeographicalRegion)gwdg.getLocation());
}
......@@ -326,10 +326,9 @@ public class ModelImporter {
}
private EObject createUnitModel(){
//!!!Change to UnitModel in new CAMEL version
CamelModel cm = CamelFactory.eINSTANCE.createCamelModel();
cm.setName("Global Unit Model");
EList<Unit> units = cm.getUnits();
UnitModel um = UnitFactory.eINSTANCE.createUnitModel();
um.setName("Global Unit Model");
EList<Unit> units = um.getUnits();
//Create Units per Dimension
CoreUnit cu = UnitFactory.eINSTANCE.createCoreUnit();
cu.setName("cores");
......@@ -411,7 +410,7 @@ public class ModelImporter {
trans.setName("transactions");
trans.setUnit(UnitType.TRANSACTIONS);
units.add(trans);
return cm;
return um;
}
public void createRepositoryStructure(){
......
......@@ -71,6 +71,13 @@ public class LocationGenerator {
/*if (officialName.equals("Americas")) officialName = "America";
else if (officialName.equals("south-eastern Asia")) officialName = "south-Eastern Asia";*/
cn.setName(officialName);
st = ind.getProperty(code);
if (st == null){
cn.setId(officialName);
}
else{
cn.setId(st.getString());
}
EList<String> alternativeNames = cn.getAlternativeNames();
st = ind.getProperty(officialFrName);
alternativeNames.add(st.getString());
......@@ -125,7 +132,7 @@ public class LocationGenerator {
//ISO Code to short name
st = ind.getProperty(code);
cn.setAbbreviation(st.getString());
cn.setId(st.getString());
//Updating of location model and mapping to continents
lm.getCountries().add(cn);
......
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