Package io.fabric8.api

Examples of io.fabric8.api.Version


        return createVersion(getLatestVersion().getId(), version);
    }

    @Override
    public Map<String, Object> createVersion() {
        Version latestVersion = getLatestVersion();
        VersionSequence sequence = new VersionSequence(latestVersion.getId());
        return createVersion(sequence.next().getName());
    }
View Full Code Here


        throw new IllegalStateException(String.format("Container %s not found.", name));
    }

    @Override
    public void applyVersionToContainers(String version, List<String> containers) {
        Version v = profileService.getVersion(version);
        for (String container : containers) {
            fabricService.getContainer(container).setVersion(v);
        }
    }
View Full Code Here

    }

    @Override
    public Map<String, String> getProfileProperties(String versionId, String profileId, String pid) {
        Map<String, String> answer = null;
        Version version = profileService.getVersion(versionId);
        if (version != null) {
            Profile profile = version.getRequiredProfile(profileId);
            if (profile != null) {
                answer = profile.getConfiguration(pid);
            }
        }
        return answer;
View Full Code Here

    }

    @Override
    public Map<String, String> getOverlayProfileProperties(String versionId, String profileId, String pid) {
        Map<String, String> answer = null;
        Version version = profileService.getVersion(versionId);
        if (version != null) {
            Profile profile = version.getRequiredProfile(profileId);
            if (profile != null) {
                Profile overlayProfile = profileService.getOverlayProfile(profile);
                answer = overlayProfile.getConfiguration(pid);
            }
        }
View Full Code Here

    @Override
    public void setVersionId(String versionId) {
        String currentId = getVersionId();
        if (versionId.compareTo(currentId) != 0) {
            ProfileService profileService = fabricService.adapt(ProfileService.class);
            Version version = profileService.getRequiredVersion(versionId);
            setVersion(version);
        }
    }
View Full Code Here

    }

    @Override
    public boolean setProfileProperties(String versionId, String profileId, String pid, Map<String, String> properties) {
        boolean answer = false;
        Version version = profileService.getVersion(versionId);
        if (version != null) {
            Profile profile = profileService.getRequiredProfile(versionId, profileId);
            ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
            builder.addConfiguration(pid, properties);
            profileService.updateProfile(builder.getProfile());
View Full Code Here

        return dataStore.getContainerProfiles(id);
    }

    @Override
    public Profile[] getProfiles() {
        Version version = getVersion();
        List<String> profileIds = dataStore.getContainerProfiles(id);
        List<Profile> profiles = new ArrayList<Profile>();
        for (String profileId : profileIds) {
            profiles.add(version.getRequiredProfile(profileId));
        }
        if (profiles.isEmpty() && version != null) {
            Profile defaultProfile = version.getProfile(ZkDefs.DEFAULT_PROFILE);
            if (defaultProfile != null) {
                profiles.add(defaultProfile);
            }
        }
        return profiles.toArray(new Profile[profiles.size()]);
View Full Code Here

        profileService.updateProfile(builder.getProfile());
    }

    @Override
    public void setProfileSystemProperties(String versionId, String profileId, Map<String, String> systemProperties) {
        Version version = profileService.getVersion(versionId);
        Profile profile = version.getRequiredProfile(profileId);
        Map<String, String> profileProperties = getProfileProperties(versionId, profileId, Constants.AGENT_PID);
        if (profileProperties == null) {
            // is it necessary?
            profileProperties = new HashMap<String, String>();
        }
View Full Code Here

        return fabricService;
    }

    @Override
    protected Object doExecute() throws Exception {
        Version version = versionId != null ? profileService.getRequiredVersion(versionId) : fabricService.getRequiredDefaultVersion();
        Profile profile = version.getRequiredProfile(profileId);
       
        // we can only change parents to existing profiles
        Profile[] parents = FabricCommand.getExistingProfiles(fabricService, version, parentIds);
        ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
        for (Profile parent : parents) {
View Full Code Here

        return containersForProfile(versionId, profileId, BeanUtils.getFields(Container.class));
    }

    @Override
    public List<Map<String, Object>> containersForProfile(String versionId, String profileId, List<String> fields) {
        Version version = profileService.getVersion(versionId);
        Profile profile = version != null ? version.getRequiredProfile(profileId) : null;
        List<Map<String, Object>> answer = new ArrayList<Map<String, Object>>();
        if (profile != null) {
            for (Container c : fabricService.getContainers()) {
                for (Profile p : c.getProfiles()) {
                    if (p.equals(profile)) {
View Full Code Here

TOP

Related Classes of io.fabric8.api.Version

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.