Package io.fabric8.api

Examples of io.fabric8.api.ProfileService


     * created and returned in the list.
     *
     * @see #getExistingProfiles(io.fabric8.api.FabricService, String, java.util.List)
     */
    public static Profile[] getProfiles(FabricService fabricService, String version, List<String> names) {
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        return getProfiles(fabricService, profileService.getVersion(version), names);
    }
View Full Code Here


                    break;
                }
            }
            if (profile == null) {
                ProfileBuilder builder = ProfileBuilder.Factory.create(version.getId(), profileId);
                ProfileService profileService = fabricService.adapt(ProfileService.class);
                profile = profileService.createProfile(builder.getProfile());
            }
            profiles.add(profile);
        }
        return profiles.toArray(new Profile[profiles.size()]);
    }
View Full Code Here

     * Gets all the existing profiles for the given names.
     *
     * @throws IllegalArgumentException if a profile with the given name does not exists
     */
    public static Profile[] getExistingProfiles(FabricService fabricService, String version, List<String> names) {
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        return getExistingProfiles(fabricService, profileService.getVersion(version), names);
    }
View Full Code Here

        }
        return answer;
    }

    public static Map<String, String> getProcessLayout(FabricService fabricService, Profile profile, String layoutPath) {
        ProfileService profileService = fabricService.adapt(ProfileService.class);
        Profile overlay = profileService.getOverlayProfile(profile);
        return ByteToStringValues.INSTANCE.apply(Maps.filterKeys(overlay.getFileConfigurations(), new LayOutPredicate(layoutPath)));
    }
View Full Code Here

    @POST
    public Response createProfile(ProfileDTO profileDTO) throws URISyntaxException {
        Objects.notNull(profileDTO, "profileDTO");
        FabricService fabricService = getFabricService();
        Objects.notNull(fabricService, "fabricService");
        ProfileService profileService = getProfileService();
        Objects.notNull(profileService, "profileService");
        String id = profileDTO.getId();
        if (Strings.isNullOrBlank(id)) {
            return Response.status(Response.Status.BAD_REQUEST).entity("No id specified for the profile to be created").build();
        }

        URI location = new URI(getBaseUri() + "profile/" + id);

        // lets check it doesn't already exist
        String versionId = version.getId();
        if (profileService.hasProfile(versionId, id)) {
            return Response.seeOther(location).entity("Profile already exists for id: " + id).build();
        }

        // lets override whatever the version is set to
        profileDTO.setVersion(versionId);

        // create the profile
        ProfileBuilder builder = ProfileBuilder.Factory.create(versionId, id);
        profileDTO.populateBuilder(fabricService, profileService, builder);
        Profile profile = builder.getProfile();
        profileService.createProfile(profile);
        return Response.created(location).build();
    }
View Full Code Here

    @GET
    @Path("versions")
    public Map<String,String> versions() {
        FabricService fabricService = getFabricService();
        if (fabricService != null) {
            ProfileService profileService = fabricService.adapt(ProfileService.class);
            List<String> versionIds = profileService.getVersions();
            return mapToLinks(versionIds, "/version/");
        } else {
            noFabricService();
        }
        return Collections.emptyMap();
View Full Code Here

     */
    @Path("version/{versionId}")
    public VersionResource version(@PathParam("versionId") String versionId) {
        FabricService fabricService = getFabricService();
        if (fabricService != null && Strings.isNotBlank(versionId)) {
            ProfileService profileService = fabricService.adapt(ProfileService.class);
            Version version = profileService.getRequiredVersion(versionId);
            if (version != null) {
                return new VersionResource(this, version);
            } else {
                LOG.warn("No version found for: {}", version);
            }
View Full Code Here

        int oldCounter = -1;
        SortedSet<String> oldActiveProfiles = null;
        Map<File, Long> localChecksums = new HashMap<File, Long>();
        Map<File, Long> localModified = new HashMap<File, Long>();
        Set<Profile> refreshProfiles = new HashSet<Profile>();
        ProfileService profileService = fabricService.get().adapt(ProfileService.class);
        while (running.get() && watchURLs.size() > 0) {
            SortedSet<String> currentActiveProfiles = getCurrentActiveProfileVersions();
            if (profileArtifacts == null || oldCounter != counter.get() ||
                    oldActiveProfiles == null || !oldActiveProfiles.equals(currentActiveProfiles)) {
                oldCounter = counter.get();
View Full Code Here

    }

    // For each profile and version return the map of bundle locations to parsers
    private Map<ProfileVersionKey, Map<String, Parser>> findProfileArifacts() throws Exception {
        Map<ProfileVersionKey, Map<String, Parser>> profileArtifacts = new HashMap<ProfileVersionKey, Map<String, Parser>>();
        ProfileService profileService = fabricService.get().adapt(ProfileService.class);
        DownloadManager downloadManager = DownloadManagers.createDownloadManager(fabricService.get(), executorService);
        Container[] containers = fabricService.get().getContainers();
        for (Container container : containers) {
            Profile[] profiles = container.getProfiles();
            boolean javaOrProcessContainer = ChildContainers.isJavaOrProcessContainer(fabricService.get(), container);
                // TODO allow filter on a profile here?
                for (Profile profile : profiles) {
                    Profile overlay = profileService.getOverlayProfile(profile);
                    ProfileVersionKey key = new ProfileVersionKey(profile);
                    //if (!profileArtifacts.containsKey(key)) {
                        Map<String, Parser> artifacts = null;
                        if (javaOrProcessContainer) {
                            List<Profile> singletonList = Collections.singletonList(profile);
View Full Code Here

    @DELETE
    public void deleteProfile() {
        FabricService fabricService = getFabricService();
        Objects.notNull(fabricService, "fabricService");
        ProfileService profileService = getProfileService();
        Objects.notNull(profileService, "profileService");
        profileService.deleteProfile(fabricService, profile.getVersion(), profile.getId(), true);
    }
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.