Package io.fabric8.api

Examples of io.fabric8.api.Profile


    @Override
    public Profile getRequiredProfile(final String versionId, final String profileId) {
        IllegalStateAssertion.assertNotNull(versionId, "versionId");
        IllegalStateAssertion.assertNotNull(profileId, "profileId");
        Profile profile = getProfileFromCache(versionId, profileId);
        IllegalStateAssertion.assertNotNull(profile, "Profile does not exist: " + versionId + "/" + profileId);
        return profile;
    }
View Full Code Here


        if (!profiles.contains(profileId)) {
           
            // Process parents first
            for (String parentId : profile.getParentIds()) {
                Profile parent = getProfileFromCache(profile.getVersion(), parentId);
                IllegalStateAssertion.assertNotNull(parent, "Parent profile does not exist: " + parentId);
            }
           
            if (lastProfile == null) {
                LOGGER.debug("Create {}", Profiles.getProfileInfo(profile));
View Full Code Here

            if (bundle != null) {
                if (bundle.contains("$")) {
                    // use similar logic as io.fabric8.agent.utils.AgentUtils.getProfileArtifacts method
                    // as we need to substitute version placeholders
                    ProfileService profileService = fabricService.adapt(ProfileService.class);
                    Profile overlay = profileService.getOverlayProfile(profile);
                    bundle = VersionPropertyPointerResolver.replaceVersions(fabricService, overlay.getConfigurations(), bundle);
                }
                bundles.add(bundle);
            }
        }
    }
View Full Code Here

        PatchServiceImpl.PatchDescriptor test1 = getPatchDescriptor("test1.patch");
        PatchServiceImpl.PatchDescriptor test3 = getPatchDescriptor("test3.patch");
        Version version =
                buildVersion("1.1").withProfiles("karaf", "default", "patch-test3").done();

        Profile profile = PatchServiceImpl.getPatchProfile(version, test3);
        assertNotNull("test3 patch profile should be found", profile);
        assertEquals("patch-test3", profile.getId());

        assertNull("test1 patch profile should not be found", PatchServiceImpl.getPatchProfile(version, test1));
    }
View Full Code Here

            expect(mock.getProfiles()).andReturn(profiles).anyTimes();
        }

        private VersionBuilder withProfiles(String... names) {
            for (String name : names) {
                Profile profile = createNiceMock(Profile.class);
                expect(profile.getId()).andReturn(name).anyTimes();
                replay(profile);

                expect(mock.getProfile(name)).andReturn(profile).anyTimes();
                profiles.add(profile);
            }
View Full Code Here

        @Override
        public InputStream getInputStream() throws IOException {
            assertValid();
            String path = url.getPath();
            Container container = fabricService.get().getCurrentContainer();
            Profile overlayProfile = container.getOverlayProfile();
            byte[] bytes = overlayProfile.getFileConfiguration(path);
            IllegalStateAssertion.assertNotNull(bytes, "Resource " + path + " does not exist in the profile overlay.");
            return new ByteArrayInputStream(bytes);
        }
View Full Code Here

                // ignore if we don't have any requirements or instances as it could be profiles such
                // as the out of the box mq-default / mq-amq etc
              String versionId = profile.getVersion();
              String profileId = profile.getId();
                if (requirements.hasMinimumInstances(profileId) || fabricService.getAssociatedContainers(versionId, profileId).length > 0) {
                    Profile overlay = profileService.getOverlayProfile(profile);
                    Map<String, Map<String, String>> configurations = overlay.getConfigurations();
                    Set<Map.Entry<String, Map<String, String>>> entries = configurations.entrySet();
                    for (Map.Entry<String, Map<String, String>> entry : entries) {
                        String key = entry.getKey();
                        if (isBrokerConfigPid(key)) {
                            answer.add(overlay);
View Full Code Here

        Integer minInstances = dto.getMinimumInstances();
        if (minInstances != null) {
            configuration.put(MINIMUM_INSTANCES, minInstances.toString());
        }

        Profile profile = mqService.createOrUpdateMQProfile(version, profileName, brokerName, configuration, dto.kind().equals(BrokerKind.Replicated));
        String profileId = profile.getId();
        ProfileRequirements profileRequirement = requirements.getOrCreateProfileRequirement(profileId);
        Integer minimumInstances = profileRequirement.getMinimumInstances();

        // lets reload the DTO as we may have inherited some values from the parent profile
        List<MQBrokerConfigDTO> list = createConfigDTOs(mqService, profile);
View Full Code Here

        getProfileManager().deleteVersion(versionId);
    }

    @Override
    public ProfileState createProfile(ProfileState profileState) {
        Profile profile = getProfileManager().createProfile(profileState.toProfile());
        return new ProfileState(profile);
    }
View Full Code Here

        return new ProfileState(profile);
    }

    @Override
    public ProfileState getProfile(String versionId, String profileId) {
        Profile profile = getProfileManager().getProfile(versionId, profileId);
        return profile != null ? new ProfileState(profile) : null;
    }
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.