Package io.fabric8.api

Examples of io.fabric8.api.Profile


            Set<ContainerProxy> containers = ContainerBuilder.create(fabricProxy, 2).withName("child").withProfiles("default").assertProvisioningResult().build();
            try {
                LinkedList<Container> containerList = new LinkedList<Container>(containers);
                Container broker = containerList.removeLast();

                Profile brokerProfile = broker.getVersion().getRequiredProfile("mq-broker-default.mq");
                broker.setProfiles(new Profile[]{brokerProfile});

                Provision.provisioningSuccess(Arrays.asList(broker), PROVISION_TIMEOUT);

                waitForBroker("default");

                final BrokerViewMBean bean = (BrokerViewMBean)Provision.getMBean(broker, new ObjectName("org.apache.activemq:type=Broker,brokerName=mq"), BrokerViewMBean.class, 120000);
                Assert.assertNotNull("Cannot get BrokerViewMBean from JMX", bean);

                System.out.println(executeCommand("container-list"));

                for (Container c : containerList) {
                    Profile exampleProfile = broker.getVersion().getRequiredProfile("example-mq");
                    c.setProfiles(new Profile[]{exampleProfile});
                }

                Provision.provisioningSuccess(containers, PROVISION_TIMEOUT);
View Full Code Here


            try {
                LinkedList<Container> containerList = new LinkedList<Container>(containers);
                Container eastBroker = containerList.removeLast();
                Container westBroker = containerList.removeLast();

                Profile eastBrokerProfile = eastBroker.getVersion().getRequiredProfile("mq-broker-us-east.us-east");
                eastBroker.setProfiles(new Profile[]{eastBrokerProfile});

                Profile westBrokerProfile = eastBroker.getVersion().getRequiredProfile("mq-broker-us-west.us-west");
                westBroker.setProfiles(new Profile[]{westBrokerProfile});

                Provision.provisioningSuccess(Arrays.asList(westBroker, eastBroker), PROVISION_TIMEOUT);

                waitForBroker("us-east");
View Full Code Here

        // TODO check that the installation is the same
        uninstallProcess(requirements);

        //String id = requirements.getId();
        InstallOptions installOptions = requirements.createInstallOptions();
        Profile processProfile = getProcessProfile(requirements, true);
        Profile deployProcessProfile = getProcessProfile(requirements, false);
        Map<String, String> configuration = ProcessUtils.getProcessLayout(fabricService, processProfile, requirements.getLayout());

        //DownloadManager downloadManager = DownloadManagers.createDownloadManager(fabricService, executorService);
        InstallTask applyConfiguration = new ApplyConfigurationTask(configuration, installOptions.getProperties());
        List<Profile> profiles = new ArrayList<Profile>();
View Full Code Here

    }

    protected Profile getProcessProfile(ProcessRequirements requirements, boolean includeController) {
        Container container = fabricService.getCurrentContainer();
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        Profile processProfile = getProcessProfile(requirements, includeController, container);
        return Profiles.getEffectiveProfile(fabricService, profileService.getOverlayProfile(processProfile));
    }
View Full Code Here

          List<Profile> profiles = new LinkedList<Profile>();
          if (includeContainerProfile) {
              profiles.add(container.getOverlayProfile());
          }
          for (String parent : parents) {
              Profile p = container.getVersion().getRequiredProfile(parent);
              profiles.add(p);
          }
          List<String> result = new ArrayList<>();
          for (Profile p : profiles) {
              result.add(p.getId());
          }
          return result;
      }
View Full Code Here

            }
        });
    }

    protected synchronized void updateInternal() {
        Profile effectiveProfile;
        try {
            Profile overlayProfile = fabricService.get().getCurrentContainer().getOverlayProfile();
            effectiveProfile = Profiles.getEffectiveProfile(fabricService.get(), overlayProfile);
        } catch (Exception ex) {
            LOGGER.warn("Failed to read container profile. This exception will be ignored..", ex);
            return;
        }
View Full Code Here

                answer.put(field, Ids.getId(container.getVersion()));

            } else if (field.equalsIgnoreCase("overlayProfile")) {

                Profile overlayProfile = container.getOverlayProfile();
                Profile effectiveProfile = Profiles.getEffectiveProfile(fabricService, overlayProfile);
                answer.put(field, convertProfileToMap(fabricService, effectiveProfile, getFields(Profile.class)));

            } else {
                addProperty(container, field, answer);
            }
View Full Code Here

  @Override
  protected Object doExecute() throws Exception {
        ProfileService profileService = fabricService.adapt(ProfileService.class);
    Version version = versionId != null ? profileService.getRequiredVersion(versionId) : fabricService.getRequiredDefaultVersion();
    Profile profile = version.getProfile(profileName);
        if (profile != null) {
            Profiles.refreshProfile(fabricService, profile);
        } else {
            System.out.println("Profile " + profileName + " not found.");
        }
View Full Code Here

                            Container container = this.getContainer(containerName);
                            Profile[] profiles = container.getProfiles();
                            int profileCount = 0;

                            while (!dependencyFound && profileCount < profiles.length) {
                                Profile profile = profiles[profileCount];
                                if (config.getProfileWildcards() != null) {
                                    for (String profileWildcard : config.getProfileWildcards()) {
                                        if (profile.getId().contains(profileWildcard)) {
                                            dependencyFound = true;
                                            break;
                                        }
                                    }
                                }

                                if (!dependencyFound && config.getProfileTags() != null) {
                                    List<String> profileTags = profile.getTags();
                                    int foundTags = 0;

                                    for (String configProfileTag : config.getProfileTags()) {
                                        if (profileTags.contains(configProfileTag)) {
                                            foundTags++;
View Full Code Here

        //Also this is required for the integration with the IDE.
        try {
            if (curator.get().getZookeeperClient().isConnected()) {
                Version defaultVersion = getDefaultVersion();
                if (defaultVersion != null) {
                    Profile profile = defaultVersion.getRequiredProfile("default");
                    if (profile != null) {
                        Map<String, String> zookeeperConfig = profile.getConfiguration(Constants.ZOOKEEPER_CLIENT_PID);
                        if (zookeeperConfig != null) {
                            zooKeeperUrl = getSubstitutedData(curator.get(), zookeeperConfig.get(name));
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of io.fabric8.api.Profile

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.