Search in sources :

Example 11 with ProfileBuilder

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

the class FabricManager method changeProfileParents.

@Override
public Map<String, Object> changeProfileParents(String versionId, String profileId, List<String> parents) {
    Profile profile = profileService.getRequiredProfile(versionId, profileId);
    ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile).setParents(parents);
    profile = profileService.updateProfile(builder.getProfile());
    return getProfile(versionId, profile.getId());
}
Also used : ProfileBuilder(io.fabric8.api.ProfileBuilder) Profile(io.fabric8.api.Profile)

Example 12 with ProfileBuilder

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

the class FabricManager method createProfile.

@Override
// Creates a profile with empty content. Is this meaningful?
@Deprecated
public Map<String, Object> createProfile(String versionId, String profileId) {
    ProfileBuilder builder = ProfileBuilder.Factory.create(versionId, profileId);
    Profile profile = profileService.createProfile(builder.getProfile());
    return getProfile(versionId, profile.getId());
}
Also used : ProfileBuilder(io.fabric8.api.ProfileBuilder) Profile(io.fabric8.api.Profile)

Example 13 with ProfileBuilder

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

the class FabricManager method setProfileAttribute.

@Override
public void setProfileAttribute(String versionId, String profileId, String attributeId, String value) {
    Profile profile = profileService.getRequiredProfile(versionId, profileId);
    ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
    builder.addAttribute(attributeId, value);
    profileService.updateProfile(builder.getProfile());
}
Also used : ProfileBuilder(io.fabric8.api.ProfileBuilder) Profile(io.fabric8.api.Profile)

Example 14 with ProfileBuilder

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

the class FabricManager method deleteConfigurationFile.

@Override
public void deleteConfigurationFile(String versionId, String profileId, String fileName) {
    Profile profile = profileService.getRequiredProfile(versionId, profileId);
    ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
    builder.deleteFileConfiguration(fileName);
    profileService.updateProfile(builder.getProfile());
}
Also used : ProfileBuilder(io.fabric8.api.ProfileBuilder) Profile(io.fabric8.api.Profile)

Example 15 with ProfileBuilder

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

the class FabricManager method createProfile.

@Override
public Map<String, Object> createProfile(String versionId, String profileId, List<String> parents) {
    ProfileBuilder builder = ProfileBuilder.Factory.create(versionId, profileId).addParents(parents);
    Profile profile = profileService.createProfile(builder.getProfile());
    return getProfile(versionId, profile.getId());
}
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