Package io.fabric8.api.jmx

Examples of io.fabric8.api.jmx.ContainerDTO


  /* (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


     */
    @Override
    public List<ContainerDTO> containers(List<String> ids) {
        List<ContainerDTO> answer = new ArrayList<>();
        for (String id : ids) {
            ContainerDTO container = getContainer(id);
            if (container != null) {
                answer.add(container);
            }
        }
        return answer;
View Full Code Here

    }

    protected static boolean checkMinimumInstancesSuccessful(FabricController restAPI, String profile, int minimumInstances, List<String> containerIds, boolean wasValid) {
        int successful = 0;
        for (String containerId : containerIds) {
            ContainerDTO container = restAPI.getContainer(containerId);
            if (container == null) {
                System.out.println("No ContainerDTO for " + containerId);
            } else {
                if (!wasValid) {
                    System.out.println("Container " + containerId + " alive: " + container.isAlive() + " result: " + container.getProvisionResult()
                            + " status: " + container.getProvisionStatus() + " complete: " + container.isProvisioningComplete()
                            + " pending: " + container.isProvisioningPending() + " " + container.getProvisionException());
                }
                if (container.isAliveAndOK() && container.isProvisioningComplete() && !container.isProvisioningPending() && "success".equals(container.getProvisionResult())) {
                    successful += 1;
                    if (LOG.isDebugEnabled()) {
                        List<String> fields = BeanUtils.getFields(ContainerDTO.class);
                        for (String field : fields) {
                            LOG.debug("container " + containerId + " " + field + " = " + BeanUtils.getValue(container, field));
View Full Code Here

        this.registryLink = registryLink;
        this.zooKeeperLink = zooKeeperLink;
    }

    public static ContainerDTO createContainerDTO(Container container, String baseApiLink) {
        ContainerDTO answer = new ContainerDTO();
        String containerId = container.getId();
        answer.setId(containerId);
        answer.setType(container.getType());

        answer.setChildren(Containers.containerIds(container.getChildren()));
        List<String> profileIds = Profiles.profileIds(container.getProfiles());
        String profileLinkPrefix = baseApiLink + "/version/" + Profiles.versionId(container.getVersion()) + "/profile/";
        answer.setProfiles(Links.mapIdsToLinks(profileIds, profileLinkPrefix));
        answer.setVersion(Profiles.versionId(container.getVersion()));
        answer.setParent(Containers.containerId(container.getParent()));

        answer.setIp(container.getIp());
        answer.setLocalIp(container.getLocalIp());
        answer.setManualIp(container.getManualIp());
        answer.setPublicIp(container.getPublicIp());
        answer.setLocalHostName(container.getLocalHostname());
        answer.setPublicHostName(container.getPublicHostname());
        answer.setResolver(container.getResolver());
        answer.setMaximumPort(container.getMaximumPort());
        answer.setMinimumPort(container.getMinimumPort());

        answer.setGeoLocation(container.getGeoLocation());
        answer.setLocation(container.getLocation());

        answer.setProcessId(container.getProcessId());
        answer.setDebugPort(container.getDebugPort());
        answer.setHttpUrl(container.getHttpUrl());
        answer.setJmxUrl(container.getJmxUrl());
        answer.setJolokiaUrl(container.getJolokiaUrl());
        answer.setSshUrl(container.getSshUrl());

        answer.setProvisionException(container.getProvisionException());
        answer.setProvisionResult(container.getProvisionResult());
        answer.setProvisionStatus(container.getProvisionStatus());
        answer.setProvisionList(container.getProvisionList());
        answer.setJmxDomains(container.getJmxDomains());

        answer.setAlive(container.isAlive());
        answer.setAliveAndOK(container.isAliveAndOK());
        answer.setEnsembleServer(container.isEnsembleServer());
        answer.setManaged(container.isManaged());
        answer.setProvisioningComplete(container.isProvisioningComplete());
        answer.setProvisioningPending(container.isProvisioningPending());
        answer.setRoot(container.isRoot());

        answer.setStartLink(baseApiLink + "/container/" + containerId + "/start");
        return answer;
    }
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

    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.camel")) {
          CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(r.getConnection()));
          CamelContextsNode camel = new CamelContextsNode(r, facade);
          return new Object[]{camel};
        }
      }
    } else if (parentElement instanceof NodeSupport) {
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

    if( parentElement instanceof IConnectionWrapper ) {
      IConnectionWrapper w = (IConnectionWrapper)parentElement;
      Root r = w.getRoot();
      if( r != null ) {
        if (r.containsDomain("org.apache.camel")) {
          CamelFacade facade = new JmxTemplateCamelFacade(new JmxPluginJmxTemplate(r.getConnection()));
          CamelContextsNode camel = new CamelContextsNode(r, facade);
          return new Object[]{camel};
        }
      }
    } else if (parentElement instanceof NodeSupport) {
View Full Code Here

  @Override
  public List<IExchange> browseExchanges() {
    List<IExchange> answer = new ArrayList<IExchange>();
    if (endpointMBean instanceof CamelBrowsableEndpointMBean) {
      CamelBrowsableEndpointMBean browsable = (CamelBrowsableEndpointMBean) endpointMBean;
      long size = browsable.queueSize();
      try {
        for (int i = 0; i < size; i++) {
          String xml = browsable.browseMessageAsXml(i, true);
          if (xml != null) {
            Exchange exchange = Exchanges.unmarshalNoNamespaceXmlString(xml);
            if (exchange != null) {
              IMessage in = exchange.getIn();
              if (in != null) {
View Full Code Here

TOP

Related Classes of io.fabric8.api.jmx.ContainerDTO

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.