use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.
the class FabricManager method setProfileProperties.
@Override
public boolean setProfileProperties(String versionId, String profileId, String pid, Map<String, String> properties) {
boolean answer = false;
Version version = profileService.getVersion(versionId);
if (version != null) {
Profile profile = profileService.getRequiredProfile(versionId, profileId);
ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
Map<String, String> existingConfiguration = builder.getConfiguration(pid);
for (Iterator<String> iterator = existingConfiguration.keySet().iterator(); iterator.hasNext(); ) {
String key = iterator.next();
if (!properties.containsKey(key)) {
iterator.remove();
}
}
existingConfiguration.putAll(properties);
builder.addConfiguration(pid, existingConfiguration);
profileService.updateProfile(builder.getProfile());
answer = true;
}
return answer;
}
use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.
the class FabricManager method setProfileOverrides.
@Override
public void setProfileOverrides(String versionId, String profileId, List<String> overrides) {
Profile profile = profileService.getRequiredProfile(versionId, profileId);
ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
builder.setOverrides(overrides);
profileService.updateProfile(builder.getProfile());
}
use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.
the class FabricManager method setProfileFeatures.
@Override
public void setProfileFeatures(String versionId, String profileId, List<String> features) {
Profile profile = profileService.getRequiredProfile(versionId, profileId);
ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
builder.setFeatures(features);
profileService.updateProfile(builder.getProfile());
}
use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.
the class FabricManager method setProfileBundles.
@Override
public void setProfileBundles(String versionId, String profileId, List<String> bundles) {
Profile profile = profileService.getRequiredProfile(versionId, profileId);
ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
builder.setBundles(bundles);
profileService.updateProfile(builder.getProfile());
}
use of io.fabric8.api.ProfileBuilder in project fabric8 by jboss-fuse.
the class FabricManager method setProfileOptionals.
@Override
public void setProfileOptionals(String versionId, String profileId, List<String> optionals) {
Profile profile = profileService.getRequiredProfile(versionId, profileId);
ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
builder.setOptionals(optionals);
profileService.updateProfile(builder.getProfile());
}
Aggregations