Package io.fabric8.api

Examples of io.fabric8.api.ProfileService


        return answer;
    }

    public static List<String> fetchChildIds(FabricService fabricService, Profile self) {
        List<String> ids = new ArrayList<String>();
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        for (Profile p : profileService.getRequiredVersion(self.getVersion()).getProfiles()) {
            for (String parentId : p.getParentIds()) {
                if (parentId.equals(self.getId())) {
                    ids.add(p.getId());
                    break;
                }
View Full Code Here


        this.fabricService = fabricService;
    }

  @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

    /**
     * Validates that the requirements are valid; to ensure the profiles exist etc
     */
    public static void validateRequirements(FabricService fabricService, FabricRequirements requirements) {
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        String versionId = requirements.getVersion();
        Version version;
        if (!Strings.isNullOrEmpty(versionId)) {
            version = profileService.getRequiredVersion(versionId);
        } else {
            version = fabricService.getDefaultVersion();
        }
        Set<String> profileIds = new HashSet<String>(Profiles.profileIds(version.getProfiles()));
        List<ProfileRequirements> profileRequirements = requirements.getProfileRequirements();
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 Version getVersion() {
        String versionId = dataStore.getContainerVersion(id);
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        return versionId != null ? profileService.getVersion(versionId) : null;
    }
View Full Code Here

        List<Profile> updatedProfileList = new LinkedList<Profile>();
        for (Profile p : getProfiles()) {
            updatedProfileList.add(p);
        }

        ProfileService profileService = fabricService.adapt(ProfileService.class);
        for (Profile addedProfile : addedProfiles) {
          String versionId = addedProfile.getVersion();
            String profileId = addedProfile.getId();
            if (!profileService.hasProfile(versionId, profileId)) {
        throw new IllegalArgumentException("Profile " + profileId + " doesn't exist.");
            } else if (!updatedProfileList.contains(addedProfile)) {
                updatedProfileList.add(addedProfile);
            }
        }
View Full Code Here

        }
        setProfiles(updatedProfileList.toArray(new Profile[updatedProfileList.size()]));
    }

    public Profile getOverlayProfile() {
    ProfileService profileService = fabricService.adapt(ProfileService.class);
    return profileService.getOverlayProfile(getContainerProfile());
    }
View Full Code Here

    @Override
    public Version createVersion(Version version) {
        Permit<ProfileService> permit = permitManager.get().aquirePermit(ProfileService.PERMIT, false);
        try {
            ProfileService service = permit.getInstance();
            return service.createVersion(version);
        } finally {
            permit.release();
        }
    }
View Full Code Here

    @Override
    public Version createVersionFrom(String sourceId, String targetId, Map<String, String> attributes) {
        Permit<ProfileService> permit = permitManager.get().aquirePermit(ProfileService.PERMIT, false);
        try {
            ProfileService service = permit.getInstance();
            return service.createVersionFrom(sourceId, targetId, attributes);
        } finally {
            permit.release();
        }
    }
View Full Code Here

    @Override
    public List<String> getVersions() {
        Permit<ProfileService> permit = permitManager.get().aquirePermit(ProfileService.PERMIT, false);
        try {
            ProfileService service = permit.getInstance();
            return service.getVersions();
        } finally {
            permit.release();
        }
    }
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.