Package io.fabric8.agent.download

Examples of io.fabric8.agent.download.DownloadManager


    // For each profile and version return the map of bundle locations to parsers
    private Map<ProfileVersionKey, Map<String, Parser>> findProfileArifacts() throws Exception {
        Map<ProfileVersionKey, Map<String, Parser>> profileArtifacts = new HashMap<ProfileVersionKey, Map<String, Parser>>();
        ProfileService profileService = fabricService.get().adapt(ProfileService.class);
        DownloadManager downloadManager = DownloadManagers.createDownloadManager(fabricService.get(), executorService);
        Container[] containers = fabricService.get().getContainers();
        for (Container container : containers) {
            Profile[] profiles = container.getProfiles();
            boolean javaOrProcessContainer = ChildContainers.isJavaOrProcessContainer(fabricService.get(), container);
                // TODO allow filter on a profile here?
View Full Code Here


        Objects.notNull(service, "FabricService");

        ProfileService profileService = service.adapt(ProfileService.class);
        Objects.notNull(profileService, "ProfileService");

        DownloadManager downloadManager = DownloadManagers.createDownloadManager(service, executorService);
        Objects.notNull(downloadManager, "DownloadManager");

        Profile immediateProfile = profileService.getProfile(versionId, profileId);
        Objects.notNull(immediateProfile, "Profile for versionId: " + versionId + ", profileId: " + profileId);
        Profile profile = profileService.getOverlayProfile(immediateProfile);
View Full Code Here

  @Override
  public void update(ViewerCell cell) {
    Object element = cell.getElement();
    ContainerViewBean bean = ContainerViewBean.toContainerViewBean(element);
    if (bean != null) {
      Container container = bean.container();
      boolean managed = container.isManaged();
      String image = "yellow-dot.png";
      String status = bean.getStatus();
      Fabric8JMXPlugin.getLogger().debug(
          "Container: " + container.getId() + " alive: "
              + container.isAlive() + " managed: "
              + container.isManaged() + " pending: "
              + container.isProvisioningPending() + " complete: "
              + container.isProvisioningComplete() + " status: "
              + container.getProvisionStatus());
      if (!bean.isAlive()) {
        image = "gray-dot.png";
      }
      if (container.isProvisioningPending()) {
        // image = "pending.gif";
        image = "yellow-dot.png";
        managed = true;
      } else if (status != null) {
        String lowerStatus = status.toLowerCase();
View Full Code Here

            .getImageDescriptor("terminal_view.gif")) {
      @Override
      public void run() {
        List<Container> selectedContainers = getSelectedContainers();
        if (selectedContainers.size() > 0) {
          Container container = selectedContainers.get(0);
          if (container != null) {
            System.err.println("TODO: open terminal");
//            ContainerNode.openTerminal(getFabric(), container, null);
          }
        }
View Full Code Here

      public void run() {
        ContainersNode containersNode = fabric.getContainersNode();
        if (containersNode != null) {
          List<Container> selectedContainers = getSelectedContainers();
          if (!selectedContainers.isEmpty()) {
            Container container = selectedContainers.get(0);
            ContainerNode containerNode = containersNode.getContainerNode(container.getId());
            if (containerNode != null) {
              Selections.setSingleSelection(
                  fabric.getRefreshableUI(), containerNode);
            }
          }
View Full Code Here

    IStructuredSelection selection = getSelection();
    if (selection != null) {
      boolean changed = false;
      Iterator iterator = selection.iterator();
      while (iterator.hasNext()) {
        Container container = ContainerNode.toContainer(iterator.next());
        if (container != null) {
          containers.add(container);
        }
      }
    }
View Full Code Here

          public boolean apply(Container container) {
            return container != null && container.isRoot();
          }
        }));
    if (rootContainers.size() == 1 && fabric != null) {
      Container rootContainer = rootContainers.get(0);
      ContainersNode containersNode = fabric.getContainersNode();
      if (containersNode != null) {
        return containersNode.getContainerNode(rootContainer.getId());
      }
    }
    return null;
  }
View Full Code Here

            .getImageDescriptor("terminal_view.gif")) {
      @Override
      public void run() {
        List<Container> selectedContainers = getSelectedContainers();
        if (selectedContainers.size() > 0) {
          Container container = selectedContainers.get(0);
          if (container != null) {
            System.err.println("TODO: open terminal");
//            ContainerNode
//                .openTerminal(getFabric(), container, null);
          }
        }
      }
    };
    startAction = new ActionSupport(Messages.StartAgentAction,
        Messages.StartAgentActionToolTip, Fabric8JMXPlugin.getDefault()
            .getImageDescriptor("start_task.gif")) {
      @Override
      public void run() {
        start();
      }

      @Override
      public boolean isEnabled() {
        List<Container> selectedContainers = getSelectedContainers();
        if (selectedContainers.size() > 0) {
          Container container = selectedContainers.get(0);
          if (container != null && container.isRoot()) {
            return false;
          }
        }
        return true;
      }
    };
    stopAction = new ActionSupport(Messages.StopAgentAction,
        Messages.StopAgentActionToolTip, Fabric8JMXPlugin.getDefault()
            .getImageDescriptor("stop_task.gif")) {
      @Override
      public void run() {
        stop();
      }

      @Override
      public boolean isEnabled() {
        List<Container> selectedContainers = getSelectedContainers();
        if (selectedContainers.size() > 0) {
          Container container = selectedContainers.get(0);
          if (container != null && container.isRoot()) {
            return false;
          }
        }
        return true;
      }
    };
    destroyAction = new ActionSupport(Messages.DestroyContainerAction,
        Messages.DestroyContainerActionToolTip, Fabric8JMXPlugin
            .getDefault().getImageDescriptor("delete.gif")) {
      @Override
      public void run() {
        destroy();
      }

      @Override
      public boolean isEnabled() {
        List<Container> selectedContainers = getSelectedContainers();
        if (selectedContainers.size() > 0) {
          Container container = selectedContainers.get(0);
          if (container != null && container.isRoot()) {
            return false;
          }
        }
        return true;
      }
View Full Code Here

        }
        ContainersNode containersNode = fabric.getContainersNode();
        if (containersNode != null) {
          List<Container> selectedContainers = getSelectedContainers();
          if (!selectedContainers.isEmpty()) {
            Container container = selectedContainers.get(0);
            ContainerNode containerNode = containersNode
                .getContainerNode(container.getId());
            if (containerNode != null) {
              Selections.setSingleSelection(
                  fabric.getRefreshableUI(), containerNode);
            }
          }
View Full Code Here

    IStructuredSelection selection = getSelection();
    if (selection != null) {
      boolean changed = false;
      Iterator iterator = selection.iterator();
      while (iterator.hasNext()) {
        Container container = ContainerNode
            .toContainer(iterator.next());
        if (container != null) {
          containers.add(container);
        }
      }
View Full Code Here

TOP

Related Classes of io.fabric8.agent.download.DownloadManager

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.