Package io.fabric8.api

Examples of io.fabric8.api.Version


    private ModuleStatus getBlueprintStatus() {
        return Enum.valueOf(ModuleStatus.class, getOptionalAttribute(DataStore.ContainerAttribute.BlueprintStatus, ModuleStatus.STARTED.name()));
    }

  private Profile getContainerProfile() {
    Version version = getVersion();
    String profileId = "#container-" + getId();
    ProfileBuilder builder = ProfileBuilder.Factory.create(profileId).version(version.getId());
    ContainerProfileOptions optionsProvider = new ContainerProfileOptions(getId(), version, dataStore);
    return builder.addOptions(optionsProvider).getProfile();
  }
View Full Code Here


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

    @Override
    public List<Map<String, Object>> containersForVersion(String versionId, List<String> fields) {
        Version version = profileService.getVersion(versionId);
        List<Map<String, Object>> answer = new ArrayList<Map<String, Object>>();
        if (version != null) {
            for (Container c : fabricService.getContainers()) {
                if (c.getVersion().equals(version)) {
                    answer.add(BeanUtils.convertContainerToMap(fabricService, c, fields));
View Full Code Here

    public Map<String, Object> getProfile(String versionId, String profileId, List<String> fields) {
        return doGetProfile(versionId, profileId, BeanUtils.getFields(Profile.class), true);
    }

    Map<String, Object> doGetProfile(String versionId, String profileId, List<String> fields, boolean mandatory) {
        Version version = profileService.getVersion(versionId);

        Profile profile;
        if (mandatory) {
            profile = version.getRequiredProfile(profileId);
        } else {
            profile = version.getProfile(profileId);
        }
        if (profile == null) {
            return null;
        }
View Full Code Here

        return Base64.encodeBase64String(profileService.getVersion(versionId).getRequiredProfile(profileId).getFileConfigurations().get(fileName));
    }

    @Override
    public List<String> getConfigurationFileNames(String versionId, String profileId) {
        Version version = profileService.getVersion(versionId);
        Profile profile = version.getProfile(profileId);
        if (profile != null) {
            ArrayList<String> fileNames = new ArrayList<>(profile.getConfigurationFileNames());
            return Collections.unmodifiableList(fileNames);
        } else {
            return Collections.emptyList();
View Full Code Here

    @Override
    public Map<String, Object> getConfigurationFiles(String versionId, List<String> profileIds, String filename) {
        Pattern pattern = Pattern.compile(filename);
        Map<String, Object> answer = new TreeMap<String, Object>();
        Version version = profileService.getVersion(versionId);
        for (String profileId : profileIds) {
            Profile profile = version.getRequiredProfile(profileId);
            if (profile != null) {
                Map<String, String> files = new TreeMap<String, String>();
                Map<String, byte[]> configs = profile.getFileConfigurations();

                for (Map.Entry<String, byte[]> configEntry : configs.entrySet()) {
View Full Code Here

        return answer;
    }
   
    @Override
    public void copyProfile(String versionId, String sourceId, String targetId, boolean force) {
        Version v = profileService.getVersion(versionId);
        if (v != null) {
            Profiles.copyProfile(fabricService, versionId, sourceId, targetId, force);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void renameProfile(String versionId, String profileId, String newId, boolean force) {
        Version v = profileService.getVersion(versionId);
        if (v != null) {
            Profiles.renameProfile(fabricService, versionId, profileId, newId, force);
        }
    }
View Full Code Here

            Profiles.renameProfile(fabricService, versionId, profileId, newId, force);
        }
    }

    public void refreshProfile(String versionId, String profileId) {
        Version version = profileService.getVersion(versionId);
        if (version != null) {
            Profile profile = version.getRequiredProfile(profileId);
            if (profile != null) {
                Profiles.refreshProfile(fabricService, profile);
            }
        }
    }
View Full Code Here

        table.columns("version", "default", "# containers", "description");

        // they are sorted in the correct order by default
        for (String versionId : versions) {
            boolean isDefault = versionId.equals(defaultVersionId);
            Version version = profileService.getRequiredVersion(versionId);
            int active = countContainersByVersion(containers, version);
            String description = version.getAttributes().get(Version.DESCRIPTION);
            table.row(version.getId(), (isDefault ? "true" : ""), activeContainerCountText(active), description);
        }
        table.print();
    }
View Full Code Here

            LOG.warn("No valid patches to apply");
            throw new FabricException("No valid patches to apply");
        }

        if (targetId == null || targetId.equals("")) {
            Version latestVersion = getLatestVersion();
            VersionSequence sequence = new VersionSequence(latestVersion.getId());
            targetId = sequence.next().getName();
        }
       
        Version targetVersion = profileService.createVersionFrom(sourceId, targetId, null);

        File currentPatchFile = null;
        try {
            for (File file : patchFiles) {
                currentPatchFile = file;
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.