Package org.cloudfoundry.client.lib.domain

Examples of org.cloudfoundry.client.lib.domain.CloudServiceOffering


    GridDataFactory.fillDefaults().grab(true, false).applyTo(typeCombo);
    typeCombo.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        int index = typeCombo.getSelectionIndex();
        if (index != -1) {
          CloudServiceOffering configuration = serviceOfferings.get(index);
          setCloudService(service, configuration);
        }
        refreshPlan();
      }
    });
View Full Code Here


      pageBook.setVisible(true);

      for (Control control : planGroup.getChildren()) {
        control.dispose();
      }
      CloudServiceOffering configuration = serviceOfferings.get(index);
      List<CloudServicePlan> servicePlans = getPlans(configuration);

      if (servicePlans.size() > 1) {
        pageBook.showPage(planGroup);
        planGroup.setVisible(true);
View Full Code Here

      this.entry = entry;
    }

    public void run() {

      CloudServiceOffering cso = entry.getOffering();
      final String mapId = "" + cso.getName() + "-" + cso.getProvider(); //$NON-NLS-1$ //$NON-NLS-2$

      Image result = null;

      // Check the cache for the image
      synchronized (imageMap) {
View Full Code Here

  @Override
  public boolean equals(Object o) {
    if (!(o instanceof CFServiceWizUI)) {
      return false;
    }
    CloudServiceOffering offering = ((CFServiceWizUI) o).getOffering();
    String name1 = "" + getOffering().getName(); //$NON-NLS-1$
    String name2 = "" + offering.getName(); //$NON-NLS-1$

    return name1.equals(name2);
  }
View Full Code Here

  protected void deleteService(CloudService service) throws CoreException {
    harness.deleteService(service);
  }

  protected CloudService createCloudService(String name, String vendor) throws CoreException {
    CloudServiceOffering serviceConfiguration = getServiceConfiguration(vendor);
    if (serviceConfiguration != null) {
      CloudService service = new CloudService();
      service.setName(name);
      service.setLabel(vendor);
      service.setVersion(serviceConfiguration.getVersion());
      service.setPlan(serviceConfiguration.getCloudServicePlans().get(0).getName());

      createService(service);
      return service;
    }
    return null;
View Full Code Here

    StringBuilder sb = new StringBuilder();
    final Iterator<CloudServiceOffering> it = offerings.iterator();

    while (it.hasNext()) {
      CloudServiceOffering offering = it.next();
      sb.append(offering.getLabel());

      if (it.hasNext()) {
        sb.append(", ");
      }
    }
View Full Code Here

    List<CloudServiceOffering> offerings = connectedClient.getServiceOfferings();

    assertNotNull(offerings);
    assertTrue(offerings.size() >= 2);

    CloudServiceOffering offering = null;
    for (CloudServiceOffering so : offerings) {
      if (so.getLabel().equals(MYSQL_SERVICE_LABEL)) {
        offering = so;
        break;
      }
    }
    assertNotNull(offering);
    assertEquals(MYSQL_SERVICE_LABEL, offering.getLabel());
    assertNotNull(offering.getCloudServicePlans());
    assertTrue(offering.getCloudServicePlans().size() > 0);
    assertNotNull(offering.getName());
    assertNotNull(offering.getDescription());
    assertNotNull(offering.getLabel());
    assertNotNull(offering.getUniqueId());
    assertNotNull(offering.getExtra());

    CloudServicePlan plan = offering.getCloudServicePlans().get(0);
    assertNotNull(plan.getName());
    assertNotNull(plan.getUniqueId());
    assertNotNull(plan.getDescription());
    assertSame(offering, plan.getServiceOffering());
  }
View Full Code Here

        DEFAULT_MEMORY,
        uris, serviceNames);
  }

  private CloudService createMySqlServiceWithVersionAndProvider(String serviceName) {
    CloudServiceOffering databaseServiceOffering = getCloudServiceOffering(MYSQL_SERVICE_LABEL);

    CloudService service = new CloudService(CloudEntity.Meta.defaultMeta(), serviceName);
    service.setProvider(databaseServiceOffering.getProvider());
    service.setLabel(databaseServiceOffering.getLabel());
    service.setVersion(databaseServiceOffering.getVersion());
    service.setPlan(MYSQL_SERVICE_PLAN);

    connectedClient.createService(service);

    return service;
View Full Code Here

    }
    return cloudService;
  }

  private CloudServiceOffering mapServiceResource(Map<String, Object> resource) {
    CloudServiceOffering cloudServiceOffering = new CloudServiceOffering(
        getMeta(resource),
        getEntityAttribute(resource, "label", String.class),
        getEntityAttribute(resource, "provider", String.class),
        getEntityAttribute(resource, "version", String.class),
        getEntityAttribute(resource, "description", String.class),
        getEntityAttribute(resource, "active", Boolean.class),
        getEntityAttribute(resource, "bindable", Boolean.class),
        getEntityAttribute(resource, "url", String.class),
        getEntityAttribute(resource, "info_url", String.class),
        getEntityAttribute(resource, "unique_id", String.class),
        getEntityAttribute(resource, "extra", String.class),
        getEntityAttribute(resource, "documentation_url", String.class));
    List<Map<String, Object>> servicePlanList = getEmbeddedResourceList(getEntity(resource), "service_plans");
    if (servicePlanList != null) {
      for (Map<String, Object> servicePlanResource : servicePlanList) {
        Boolean publicPlan = getEntityAttribute(servicePlanResource, "public", Boolean.class);
        CloudServicePlan servicePlan =
            new CloudServicePlan(
                getMeta(servicePlanResource),
                getEntityAttribute(servicePlanResource, "name", String.class),
                getEntityAttribute(servicePlanResource, "description", String.class),
                getEntityAttribute(servicePlanResource, "free", Boolean.class),
                publicPlan == null ? true : publicPlan,
                getEntityAttribute(servicePlanResource, "extra", String.class),
                getEntityAttribute(servicePlanResource, "unique_id", String.class),
                cloudServiceOffering);
        cloudServiceOffering.addCloudServicePlan(servicePlan);
      }
    }
    return cloudServiceOffering;
  }
View Full Code Here

  public List<CloudServiceOffering> getServiceOfferings() {
    String urlPath = "/v2/services?inline-relations-depth=1";
    List<Map<String, Object>> resourceList = getAllResources(urlPath, null);
    List<CloudServiceOffering> serviceOfferings = new ArrayList<CloudServiceOffering>();
    for (Map<String, Object> resource : resourceList) {
      CloudServiceOffering serviceOffering = resourceMapper.mapResource(resource, CloudServiceOffering.class);
      serviceOfferings.add(serviceOffering);
    }
    return serviceOfferings;
  }
View Full Code Here

TOP

Related Classes of org.cloudfoundry.client.lib.domain.CloudServiceOffering

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.