Package io.fabric8.api

Examples of io.fabric8.api.ProfileService


     * Returns the overlay (effective) profile
     */
    @Path("overlay")
    public ProfileResource overlay() {
        if (!profile.isOverlay()) {
            ProfileService profileService = getProfileService();
            if (profileService != null) {
                Profile overlay = profileService.getOverlayProfile(profile);
                return new ProfileResource(this, overlay);
            }
        }
        return null;
    }
View Full Code Here


        LOG.warn("No FabricService available!");
    }

    protected ProfileService getProfileService() {
        FabricService fabricService = getFabricService();
        ProfileService profileService = null;
        if (fabricService != null) {
            profileService = fabricService.adapt(ProfileService.class);
        }
        return profileService;
    }
View Full Code Here

    protected void findMetadataForProfile(String versionId, String profileId, MetadataHandler handler) throws Exception {
        FabricService service = fabricService.get();
        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);

        Set<String> pids = new HashSet<>();
        Map<String, File> fileMap = AgentUtils.downloadProfileArtifacts(service, downloadManager, profile);
        Set<Map.Entry<String, File>> entries = fileMap.entrySet();
        for (Map.Entry<String, File> entry : entries) {
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

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

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

  }

  @Override
  public INodeStatistics getNodeStats(String nodeId) {
    if (nodeId != null) {
      CamelProcessorMBean processorMBean = camelContextNode.getProcessorMBean(nodeId);
      if (processorMBean != null) {
        return new ProcessorNodeStatistics(processorMBean);
      }
    }
    return null;
View Full Code Here

TOP

Related Classes of io.fabric8.api.ProfileService

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.