Package com.abiquo.server.core.pricing

Examples of com.abiquo.server.core.pricing.PricingTemplateDto


      buffer.append("</costCode>");
      return buffer.toString();
   }

   public static Object pricingtemplatePost() {
      PricingTemplateDto pricingtemplate = new PricingTemplateDto();
      pricingtemplate.setName("pricing template");
      pricingtemplate.setDescription("pt_description");
      pricingtemplate.setHdGB(new BigDecimal(0));
      pricingtemplate.setStandingChargePeriod(new BigDecimal(0));
      pricingtemplate.setVlan(new BigDecimal(0));
      pricingtemplate.setChargingPeriod(1);
      pricingtemplate.setMinimumChargePeriod(new BigDecimal(0));
      pricingtemplate.setShowChangesBefore(true);
      pricingtemplate.setShowMinimumCharge(false);
      pricingtemplate.setMinimumCharge(2);
      pricingtemplate.setPublicIp(new BigDecimal(0));
      pricingtemplate.setVcpu(new BigDecimal(0));
      pricingtemplate.setMemoryGB(new BigDecimal(0));
      pricingtemplate.setDefaultTemplate(true);
      pricingtemplate.addLink(new RESTLink("currency", "http://localhost/api/config/currencies/1"));
      return pricingtemplate;
   }
View Full Code Here


      pricingtemplate.addLink(new RESTLink("currency", "http://localhost/api/config/currencies/1"));
      return pricingtemplate;
   }

   public static Object pricingtemplatePut() {
      PricingTemplateDto pricingtemplate = new PricingTemplateDto();
      pricingtemplate.setName("pricing template");
      pricingtemplate.setDescription("pt_description");
      pricingtemplate.setHdGB(new BigDecimal(0));
      pricingtemplate.setStandingChargePeriod(new BigDecimal(0));
      pricingtemplate.setVlan(new BigDecimal(0));
      pricingtemplate.setChargingPeriod(1);
      pricingtemplate.setMinimumChargePeriod(new BigDecimal(0));
      pricingtemplate.setShowChangesBefore(true);
      pricingtemplate.setShowMinimumCharge(false);
      pricingtemplate.setMinimumCharge(2);
      pricingtemplate.setPublicIp(new BigDecimal(0));
      pricingtemplate.setVcpu(new BigDecimal(0));
      pricingtemplate.setMemoryGB(new BigDecimal(0));
      pricingtemplate.setDefaultTemplate(true);
      pricingtemplate.addLink(new RESTLink("currency", "http://localhost/api/config/currencies/1"));
      pricingtemplate.setId(1);
      pricingtemplate.addLink(new RESTLink("edit", "http://localhost/api/config/pricingtemplates/1"));
      return pricingtemplate;
   }
View Full Code Here

      return getFirst(listPricingTemplates(filter), null);
   }

   @Override
   public PricingTemplate getPricingTemplate(Integer pricingTemplateId) {
      PricingTemplateDto result = context.getApi().getPricingApi().getPricingTemplate(pricingTemplateId);
      return wrap(context, PricingTemplate.class, result);
   }
View Full Code Here

         this.currency = checkNotNull(currency, ValidationErrors.NULL_RESOURCE + Currency.class);
         return this;
      }

      public PricingTemplate build() {
         PricingTemplateDto dto = new PricingTemplateDto();
         dto.setName(name);
         dto.setDescription(description);
         dto.setHdGB(hdGB);
         dto.setStandingChargePeriod(standingChargePeriod);
         dto.setVlan(vlan);
         dto.setChargingPeriod(chargingPeriod.ordinal());
         dto.setMinimumCharge(minimumCharge.ordinal());
         dto.setMinimumChargePeriod(minimumChargePeriod);
         dto.setShowChangesBefore(showChangesBefore);
         dto.setShowMinimumCharge(showMinimumCharge);
         dto.setPublicIp(publicIp);
         dto.setVcpu(vcpu);
         dto.setMemoryGB(memoryGB);
         dto.setDefaultTemplate(defaultTemplate);
         dto.setLastUpdate(lastUpdate);

         RESTLink link = currency.unwrap().searchLink("edit");
         checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);
         dto.addLink(new RESTLink("currency", link.getHref()));

         PricingTemplate pricingTemplate = new PricingTemplate(context, dto);
         pricingTemplate.currency = currency;

         return pricingTemplate;
View Full Code Here

TOP

Related Classes of com.abiquo.server.core.pricing.PricingTemplateDto

Copyright © 2018 www.massapicom. 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.