Package io.fabric8.api

Examples of io.fabric8.api.ContainerProvider


    public static List<CreateContainerBasicOptions.Builder> createContainerBuilders(MQBrokerConfigDTO dto,
                                                                                    FabricService fabricService, String containerProviderScheme,
                                                                                    String profileId, String version,
                                                                                    String[] createContainers) throws IOException {

        ContainerProvider containerProvider = fabricService.getProvider(containerProviderScheme);
        Objects.notNull(containerProvider, "No ContainerProvider available for scheme: " + containerProviderScheme);
        if (!containerProvider.isValidProvider()) {
            throw new IllegalArgumentException("ContainerProvider for scheme: " + containerProviderScheme + " is not valid in current environment");
        }

        List<CreateContainerBasicOptions.Builder> containerBuilders = new ArrayList<CreateContainerBasicOptions.Builder>();
        for (String container : createContainers) {

            String type = null;
            String parent = fabricService.getCurrentContainerName();
            String jvmOpts = dto.getJvmOpts();

            CreateContainerBasicOptions.Builder builder = containerProvider.newBuilder();

            builder = (CreateContainerBasicOptions.Builder) builder
                    .name(container)
                    .parent(parent)
                    .number(dto.requiredInstances())
View Full Code Here


          CreateJCloudsContainerOptions opts = args.withUser(args.getUser(), args.getPassword(), "admin").build();

          FabricPlugin.getLogger().debug("Compute Service: " + opts.getComputeService());

          // finally create the image
          final CreateJCloudsContainerMetadata metadata = provider.create(opts, new CreationStateListener() {
            @Override
            public void onStateChange(String message) {
              monitor.subTask(message);
            }
          });
View Full Code Here

          }
        }
      });
      return (T) answerHolder[0];
    } catch (Exception e) {
      throw new FabricException(e);
    }

  }
View Full Code Here

    int bounds = 100;
    int column = 0;
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status",
        new HealthLabelProvider(function));
    function = new Function1() {
      @Override
      public Double apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health",
        new PercentFunctionLabelProvider(function));
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

    int bounds = 100;
    int column = 0;
    Function1 function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getProfile();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Profile");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getCount();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Count");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMinimumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Minumum");
    function = new FunctionInteger() {
      @Override
      public Integer apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getMaximumInstances();
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Maximum");
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return toHealth(status);
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Status",
        new HealthLabelProvider(function));
    function = new Function1() {
      @Override
      public Double apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getHealth(status.getCount());
        }
        return null;
      }
    };
    column = addColumnFunction(bounds, column, function, "Health",
        new PercentFunctionLabelProvider(function));
    function = new Function1() {
      @Override
      public Object apply(Object element) {
        ProfileStatus status = asProfileStatus(element);
        if (status != null) {
          return status.getDependentProfiles();
        }
        return null;
      }
    };
    column = addColumnFunction(250, column, function, "Dependencies");
View Full Code Here

  protected Set<String> getSelectedVersionNames() {
    Set<String> answer = new HashSet<String>();
    List<Container> containers = getSelectedContainers();
    for (Container container : containers) {
      Version version = container.getVersion();
      if (version != null) {
        String name = version.getId();
        if (name != null) {
          answer.add(name);
        }
      }
    }
View Full Code Here

  protected Set<String> getSelectedVersionNames() {
    Set<String> answer = new HashSet<String>();
    List<Container> containers = getSelectedContainers();
    for (Container container : containers) {
      Version version = container.getVersion();
      if (version != null) {
        String name = version.getId();
        if (name != null) {
          answer.add(name);
        }
      }
    }
View Full Code Here

  /* (non-Javadoc)
   * @see java.lang.Comparable#compareTo(java.lang.Object)
   */
  @Override
  public int compareTo(Version o) {
    return new VersionSequence(getId()).compareTo(new VersionSequence(o.getId()));
  }
View Full Code Here

            Fabric8JMXPlugin.getLogger().warning(ex);
          return null;
        }
        final Set<ObjectName> queryNames = connection.queryNames(fabricObjectName, null);
        for (ObjectName fabric8ObjectName : queryNames) {
          FabricManagerMBean fabricMBean = MBeanServerInvocationHandler.newProxyInstance(connection, fabric8ObjectName, FabricManagerMBean.class, true);
          return callback.doWithFabricManagerMBean(fabricMBean);
        }
        return null;
      }
    });
View Full Code Here

public class CamelNodeProvider implements NodeProvider {

  @Override
  public void provide(final Root root) {
    if (root.containsDomain("org.apache.camel")) {
      CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(root.getConnection()));
      CamelContextsNode camel = new CamelContextsNode(root, facade);
      root.addChild(camel);
    }
  }
View Full Code Here

TOP

Related Classes of io.fabric8.api.ContainerProvider

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.