Examples of ProfileBuilder


Examples of io.fabric8.api.ProfileBuilder

    public void testCreateVersion() throws Exception {
       
        // [FABRIC-1172] Jolokia exec operations fail on WildFly
        Assume.assumeFalse(getRuntimeType() == RuntimeType.WILDFLY);
       
        ProfileBuilder pbA11 = ProfileBuilder.Factory.create("1.1", "prfA");
        Profile prfA = pbA11.addConfiguration("pidA", Collections.singletonMap("keyA", "valA")).getProfile();
        VersionBuilder vb11 = VersionBuilder.Factory.create("1.1").addProfile(prfA);
        VersionState v11 = getProxy().createVersion(new VersionState(vb11.getVersion()));
        try {
            Assert.assertEquals("1.1", v11.getId());
            Assert.assertTrue(v11.getAttributes().isEmpty());
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    public void testCreateUpdateDeleteProfile() throws Exception {
       
        // [FABRIC-1172] Jolokia exec operations fail on WildFly
        Assume.assumeFalse(getRuntimeType() == RuntimeType.WILDFLY);
       
        ProfileBuilder pbA10 = ProfileBuilder.Factory.create("1.0", "prfA");
        pbA10.addConfiguration("pidA", Collections.singletonMap("keyA", "valA"));
        ProfileState prfA = getProxy().createProfile(new ProfileState(pbA10.getProfile()));
        try {
            Assert.assertEquals("prfA", prfA.getId());
            Assert.assertEquals("1.0", prfA.getVersion());
            Assert.assertTrue(prfA.getAttributes().isEmpty());
            Assert.assertEquals("valA", prfA.getConfiguration("pidA").get("keyA"));
           
            // getProfile
            Assert.assertEquals(prfA, getProxy().getProfile("1.0", "prfA"));

            // updateProfile
            prfA = getProxy().getProfile("1.0", "prfA");
            pbA10 = ProfileBuilder.Factory.createFrom(prfA.toProfile());
            pbA10.addConfiguration("pidB", "keyB", "valB");
            prfA = getProxy().updateProfile(new ProfileState(pbA10.getProfile()));
            Assert.assertEquals("prfA", prfA.getId());
            Assert.assertEquals("1.0", prfA.getVersion());
            Assert.assertTrue(prfA.getAttributes().isEmpty());
            Assert.assertEquals("valA", prfA.getConfiguration("pidA").get("keyA"));
            Assert.assertEquals("valB", prfA.getConfiguration("pidB").get("keyB"));
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    }

    @Override
    @Deprecated // Creates a profile with empty content. Is this meaningful?
    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());
    }
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

        return getProfile(versionId, profile.getId());
    }

    @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());
    }
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    }

    @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());
    }
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    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);
            builder.addConfiguration(pid, properties);
            profileService.updateProfile(builder.getProfile());
            answer = true;
        }
        return answer;
    }
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    }

    @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());
    }
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    }

    @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());
    }
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    }

    @Override
    public void setConfigurationFile(String versionId, String profileId, String fileName, String data) {
        Profile profile = profileService.getRequiredProfile(versionId, profileId);
        ProfileBuilder builder = ProfileBuilder.Factory.createFrom(profile);
        builder.addFileConfiguration(fileName, Base64.decodeBase64(data));
        profileService.updateProfile(builder.getProfile());
    }
View Full Code Here

Examples of io.fabric8.api.ProfileBuilder

    }

    @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());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.