Search in sources :

Example 36 with ProfileBuilder

use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.

the class FabricManager method deleteConfigurationFiles.

@Override
public void deleteConfigurationFiles(String versionId, List<String> profileIds, List<String> fileNames) {
    if (profileIds.size() != fileNames.size()) {
        throw new FabricException("Lists of profile IDs and filenames should be the same size");
    }
    for (int i = 0; i < profileIds.size(); i++) {
        String profileId = profileIds.get(i);
        String fileName = fileNames.get(i);
        Profile profile = profileService.getRequiredProfile(versionId, profileId);
        ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
        builder.deleteFileConfiguration(fileName);
        profileService.updateProfile(builder.getProfile());
    }
}
Also used : FabricException(io.fabric8.api.FabricException) ProfileBuilder(io.fabric8.api.ProfileBuilder) Profile(io.fabric8.api.Profile)

Example 37 with ProfileBuilder

use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.

the class FabricManager method setProfileRepositories.

@Override
public void setProfileRepositories(String versionId, String profileId, List<String> repositories) {
    Profile profile = profileService.getRequiredProfile(versionId, profileId);
    ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
    builder.setRepositories(repositories);
    profileService.updateProfile(builder.getProfile());
}
Also used : ProfileBuilder(io.fabric8.api.ProfileBuilder) Profile(io.fabric8.api.Profile)

Example 38 with ProfileBuilder

use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.

the class FabricManager method setProfileFabs.

@Override
public void setProfileFabs(String versionId, String profileId, List<String> fabs) {
    Profile profile = profileService.getRequiredProfile(versionId, profileId);
    ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
    builder.setFabs(fabs);
    profileService.updateProfile(builder.getProfile());
}
Also used : ProfileBuilder(io.fabric8.api.ProfileBuilder) Profile(io.fabric8.api.Profile)

Aggregations

ProfileBuilder (io.fabric8.api.ProfileBuilder)35 Profile (io.fabric8.api.Profile)33 Version (io.fabric8.api.Version)12 ProfileService (io.fabric8.api.ProfileService)4 GitVersion (io.fabric8.api.commands.GitVersion)3 Test (org.junit.Test)3 VersionBuilder (io.fabric8.api.VersionBuilder)2 ProjectRequirements (io.fabric8.deployer.dto.ProjectRequirements)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 DownloadManager (io.fabric8.agent.download.DownloadManager)1 Feature (io.fabric8.agent.model.Feature)1 FabricException (io.fabric8.api.FabricException)1 FabricRequirements (io.fabric8.api.FabricRequirements)1 FabricService (io.fabric8.api.FabricService)1 LockHandle (io.fabric8.api.LockHandle)1 ProfileRegistry (io.fabric8.api.ProfileRegistry)1 ProfileRequirements (io.fabric8.api.ProfileRequirements)1 ProfileState (io.fabric8.api.mxbean.ProfileState)1