@Test public void verifyGenerateSLATemplate() throws Exception { OvfDefinition ovfDefinition = OVFUtils.getOvfDefinition(threeTierWebAppOvfString); SLATemplate slaTemplate = SLATemplateCreator.generateSLATemplate(ovfDefinition, "http: assertEquals("ASCETiC-SLaTemplate-Example-01", slaTemplate.getUuid().getValue()); System.out.println(slaTemplate); System.out.println("##########################################################################################"); System.out.println("##########################################################################################"); System.out.println("##########################################################################################"); SLASOITemplateRenderer slasoiTemplateRenderer = new SLASOITemplateRenderer(); SLATemplateDocument slaTemplateRendered = SLATemplateDocument.Factory.parse(slasoiTemplateRenderer.renderSLATemplate(slaTemplate)); System.out.println("SLA rendered as XML:"); System.out.println(slaTemplateRendered.toString()); ovfDefinition = OVFUtils.getOvfDefinition(aAfString); slaTemplate = SLATemplateCreator.generateSLATemplate(ovfDefinition, "http: assertEquals("ASCETiC-SLaTemplate-Example-01", slaTemplate.getUuid().getValue()); System.out.println(slaTemplate); System.out.println("##########################################################################################"); System.out.println("##########################################################################################"); System.out.println("##########################################################################################"); slasoiTemplateRenderer = new SLASOITemplateRenderer(); slaTemplateRendered = SLATemplateDocument.Factory.parse(slasoiTemplateRenderer.renderSLATemplate(slaTemplate)); System.out.println("SLA rendered as XML:"); System.out.println(slaTemplateRendered.toString()); System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); System.out.println("##########################################################################################"); System.out.println("##########################################################################################"); }
public static SLATemplate generateSLATemplate(OvfDefinition ovf, String ovfURL, SLAApplicationTerms appTerms) { SLATemplate slaTemplate = new SLATemplate(); UUID uuid = new UUID("ASCETiC-SLaTemplate-Example-01"); slaTemplate.setUuid(uuid); addProperties(slaTemplate); addProviderEndPointToTemplate(slaTemplate); addUserEndPointToTemplate(slaTemplate); addInterfaceDclr(slaTemplate, ovf, ovfURL); addAppAgreementTerm(slaTemplate, ovf, APP_ENERGY_CONSUMPTION_OVF, APP_ENERGY_CONSUMPTION_SLA_OPERATOR, APP_ENERGY_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_POWER_CONSUMPTION_OVF, APP_POWER_CONSUMPTION_SLA_OPERATOR, APP_POWER_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_PRICE_PER_HOUR_OVF, APP_PRICE_PER_HOUR_SLA_OPERATOR, APP_PRICE_PER_HOUR_SLA, appTerms); addVMSpecificAgreementTerms(slaTemplate, ovf); AgreementTerm[] agreementTerms = slaTemplate.getAgreementTerms(); if(agreementTerms == null || agreementTerms.length == 0) { addSimpleAgreementTermForApp(slaTemplate, ovf); } return slaTemplate; }
SLATemplateCreator { public static SLATemplate generateSLATemplate(OvfDefinition ovf, String ovfURL, SLAApplicationTerms appTerms) { SLATemplate slaTemplate = new SLATemplate(); UUID uuid = new UUID("ASCETiC-SLaTemplate-Example-01"); slaTemplate.setUuid(uuid); addProperties(slaTemplate); addProviderEndPointToTemplate(slaTemplate); addUserEndPointToTemplate(slaTemplate); addInterfaceDclr(slaTemplate, ovf, ovfURL); addAppAgreementTerm(slaTemplate, ovf, APP_ENERGY_CONSUMPTION_OVF, APP_ENERGY_CONSUMPTION_SLA_OPERATOR, APP_ENERGY_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_POWER_CONSUMPTION_OVF, APP_POWER_CONSUMPTION_SLA_OPERATOR, APP_POWER_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_PRICE_PER_HOUR_OVF, APP_PRICE_PER_HOUR_SLA_OPERATOR, APP_PRICE_PER_HOUR_SLA, appTerms); addVMSpecificAgreementTerms(slaTemplate, ovf); AgreementTerm[] agreementTerms = slaTemplate.getAgreementTerms(); if(agreementTerms == null || agreementTerms.length == 0) { addSimpleAgreementTermForApp(slaTemplate, ovf); } return slaTemplate; } }
SLATemplateCreator { public static SLATemplate generateSLATemplate(OvfDefinition ovf, String ovfURL, SLAApplicationTerms appTerms) { SLATemplate slaTemplate = new SLATemplate(); UUID uuid = new UUID("ASCETiC-SLaTemplate-Example-01"); slaTemplate.setUuid(uuid); addProperties(slaTemplate); addProviderEndPointToTemplate(slaTemplate); addUserEndPointToTemplate(slaTemplate); addInterfaceDclr(slaTemplate, ovf, ovfURL); addAppAgreementTerm(slaTemplate, ovf, APP_ENERGY_CONSUMPTION_OVF, APP_ENERGY_CONSUMPTION_SLA_OPERATOR, APP_ENERGY_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_POWER_CONSUMPTION_OVF, APP_POWER_CONSUMPTION_SLA_OPERATOR, APP_POWER_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_PRICE_PER_HOUR_OVF, APP_PRICE_PER_HOUR_SLA_OPERATOR, APP_PRICE_PER_HOUR_SLA, appTerms); addVMSpecificAgreementTerms(slaTemplate, ovf); AgreementTerm[] agreementTerms = slaTemplate.getAgreementTerms(); if(agreementTerms == null || agreementTerms.length == 0) { addSimpleAgreementTermForApp(slaTemplate, ovf); } return slaTemplate; }  }
SLATemplateCreator { public static SLATemplate generateSLATemplate(OvfDefinition ovf, String ovfURL, SLAApplicationTerms appTerms) { SLATemplate slaTemplate = new SLATemplate(); UUID uuid = new UUID("ASCETiC-SLaTemplate-Example-01"); slaTemplate.setUuid(uuid); addProperties(slaTemplate); addProviderEndPointToTemplate(slaTemplate); addUserEndPointToTemplate(slaTemplate); addInterfaceDclr(slaTemplate, ovf, ovfURL); addAppAgreementTerm(slaTemplate, ovf, APP_ENERGY_CONSUMPTION_OVF, APP_ENERGY_CONSUMPTION_SLA_OPERATOR, APP_ENERGY_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_POWER_CONSUMPTION_OVF, APP_POWER_CONSUMPTION_SLA_OPERATOR, APP_POWER_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_PRICE_PER_HOUR_OVF, APP_PRICE_PER_HOUR_SLA_OPERATOR, APP_PRICE_PER_HOUR_SLA, appTerms); addVMSpecificAgreementTerms(slaTemplate, ovf); AgreementTerm[] agreementTerms = slaTemplate.getAgreementTerms(); if(agreementTerms == null || agreementTerms.length == 0) { addSimpleAgreementTermForApp(slaTemplate, ovf); } return slaTemplate; }  static SLATemplate generateSLATemplate(OvfDefinition ovf, String ovfURL, SLAApplicationTerms appTerms); }
SLATemplateCreator { public static SLATemplate generateSLATemplate(OvfDefinition ovf, String ovfURL, SLAApplicationTerms appTerms) { SLATemplate slaTemplate = new SLATemplate(); UUID uuid = new UUID("ASCETiC-SLaTemplate-Example-01"); slaTemplate.setUuid(uuid); addProperties(slaTemplate); addProviderEndPointToTemplate(slaTemplate); addUserEndPointToTemplate(slaTemplate); addInterfaceDclr(slaTemplate, ovf, ovfURL); addAppAgreementTerm(slaTemplate, ovf, APP_ENERGY_CONSUMPTION_OVF, APP_ENERGY_CONSUMPTION_SLA_OPERATOR, APP_ENERGY_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_POWER_CONSUMPTION_OVF, APP_POWER_CONSUMPTION_SLA_OPERATOR, APP_POWER_CONSUMPTION_SLA, appTerms); addAppAgreementTerm(slaTemplate, ovf, APP_PRICE_PER_HOUR_OVF, APP_PRICE_PER_HOUR_SLA_OPERATOR, APP_PRICE_PER_HOUR_SLA, appTerms); addVMSpecificAgreementTerms(slaTemplate, ovf); AgreementTerm[] agreementTerms = slaTemplate.getAgreementTerms(); if(agreementTerms == null || agreementTerms.length == 0) { addSimpleAgreementTermForApp(slaTemplate, ovf); } return slaTemplate; }  static SLATemplate generateSLATemplate(OvfDefinition ovf, String ovfURL, SLAApplicationTerms appTerms);  }