Package com.jamesmurty.utils

Examples of com.jamesmurty.utils.XMLBuilder.e()


   protected String generateXml(String newName, String vApp, CloneVAppOptions options)
         throws ParserConfigurationException, FactoryConfigurationError, TransformerException {
      XMLBuilder rootBuilder = buildRoot(newName, options.isDeploy(), options.isPowerOn());
      if (options.getDescription() != null)
         rootBuilder.e("Description").text(options.getDescription());
      rootBuilder.e("VApp").a("xmlns", ns).a("href", vApp).a("type", TerremarkVCloudMediaType.VAPP_XML);
      Properties outputProperties = new Properties();
      outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
      return rootBuilder.asString(outputProperties);
   }
View Full Code Here


   protected String generateXml(String newName, String vApp, CloneVAppOptions options)
         throws ParserConfigurationException, FactoryConfigurationError, TransformerException {
      XMLBuilder rootBuilder = buildRoot(newName, options.isDeploy(), options.isPowerOn());
      if (options.getDescription() != null)
         rootBuilder.e("Description").text(options.getDescription());
      rootBuilder.e("VApp").a("xmlns", ns).a("href", vApp).a("type", TerremarkVCloudMediaType.VAPP_XML);
      Properties outputProperties = new Properties();
      outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
      return rootBuilder.asString(outputProperties);
   }
View Full Code Here

         XMLBuilder createHostedService = XMLBuilder.create("CreateHostedService")
                  .a("xmlns", "http://schemas.microsoft.com/windowsazure").e("ServiceName").t(serviceName).up()
                  .e("Label").t(label).up();

         if (options.getDescription().isPresent())
            createHostedService.e("Description").t(options.getDescription().get()).up();

         if (location.isPresent())
            createHostedService.e("Location").t(location.get()).up();
         else if (affinityGroup.isPresent())
            createHostedService.e("AffinityGroup").t(affinityGroup.get()).up();
View Full Code Here

         if (options.getDescription().isPresent())
            createHostedService.e("Description").t(options.getDescription().get()).up();

         if (location.isPresent())
            createHostedService.e("Location").t(location.get()).up();
         else if (affinityGroup.isPresent())
            createHostedService.e("AffinityGroup").t(affinityGroup.get()).up();
         else
            throw new IllegalArgumentException("you must specify either Location or AffinityGroup!");
View Full Code Here

            createHostedService.e("Description").t(options.getDescription().get()).up();

         if (location.isPresent())
            createHostedService.e("Location").t(location.get()).up();
         else if (affinityGroup.isPresent())
            createHostedService.e("AffinityGroup").t(affinityGroup.get()).up();
         else
            throw new IllegalArgumentException("you must specify either Location or AffinityGroup!");

         if (options.getExtendedProperties().isPresent() && options.getExtendedProperties().get().size() > 0) {
            XMLBuilder extendedProperties = createHostedService.e("ExtendedProperties");
View Full Code Here

            throw new IllegalArgumentException("you must specify either Location or AffinityGroup!");

         if (options.getExtendedProperties().isPresent() && options.getExtendedProperties().get().size() > 0) {
            XMLBuilder extendedProperties = createHostedService.e("ExtendedProperties");
            for (Entry<String, String> entry : options.getExtendedProperties().get().entrySet())
               extendedProperties.e("ExtendedProperty").e("Name").t(entry.getKey()).up().e("Value").t(entry.getValue());
         }
         return (R) request.toBuilder().payload(createHostedService.asString()).build();
      } catch (Exception e) {
         throw Throwables.propagate(e);
      }
View Full Code Here

                  .e("RoleType").t("PersistentVMRole").up()
                  .e("ConfigurationSets");
                 
        if (params.getOsType() == OSType.WINDOWS){
          XMLBuilder configBuilder = builder.e("ConfigurationSet"); // Windows
          configBuilder.e("ConfigurationSetType").t("WindowsProvisioningConfiguration").up()
              .e("ComputerName").t(params.getUsername()).up()
              .e("AdminPassword").t(params.getPassword()).up()
              .e("ResetPasswordOnFirstLogon").t("false").up()
              .e("EnableAutomaticUpdate").t("false").up()
              .e("DomainJoin")
View Full Code Here

              .up()// Domain Join
              .e("StoredCertificateSettings").up()
              .up();//Windows ConfigurationSet
        }else if (params.getOsType() == OSType.LINUX){
          XMLBuilder configBuilder = builder.e("ConfigurationSet"); // Linux
          configBuilder.e("ConfigurationSetType").t("LinuxProvisioningConfiguration").up()
              .e("HostName").t(params.getName()).up()
              .e("UserName").t(params.getUsername()).up()
              .e("UserPassword").t(params.getPassword()).up()
              .e("DisableSshPasswordAuthentication").t("false").up()
              .e("SSH").up()
View Full Code Here

              .e("SSH").up()
              .up();//Linux ConfigurationSet 
        }
       
        XMLBuilder configBuilder = builder.e("ConfigurationSet"); // Network
      configBuilder.e("ConfigurationSetType").t("NetworkConfiguration").up();
     
      XMLBuilder inputEndpoints = configBuilder.e("InputEndpoints");
      for (InputEndpoint endpoint : params.getEndpoints()){
        XMLBuilder inputBuilder = inputEndpoints.e("InputEndpoint");
              inputBuilder.e("LocalPort").t(endpoint.getLocalPort().toString()).up()
View Full Code Here

      configBuilder.e("ConfigurationSetType").t("NetworkConfiguration").up();
     
      XMLBuilder inputEndpoints = configBuilder.e("InputEndpoints");
      for (InputEndpoint endpoint : params.getEndpoints()){
        XMLBuilder inputBuilder = inputEndpoints.e("InputEndpoint");
              inputBuilder.e("LocalPort").t(endpoint.getLocalPort().toString()).up()
              .e("Name").t(endpoint.getName()).up()
              .e("Port").t(endpoint.getExternalPort().toString()).up()
              .e("Protocol").t(endpoint.getProtocol().name()).up()
              .up();//InputEndpoint 
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.