Examples of TransformationDescription


Examples of org.jboss.as.controller.transform.description.TransformationDescription

        //Versions < 3.0.0 is not able to handle commit-markable-resource
        subsystemRoot200.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE);

        final ModelVersion version200 = ModelVersion.create(2, 0, 0);
        final TransformationDescription description200 = subsystemRoot200.build();
        TransformationDescription.Tools.register(description200, subsystem, version200);



        final ResourceTransformationDescriptionBuilder subsystemRoot = TransformationDescriptionBuilder.Factory.createSubsystemInstance();

        //Versions < 1.3.0 assume 'true' for the hornetq-store-enable-async-io attribute (in which case it will look for the native libs
        //and enable async io if found. The default value if not defined is 'false' though. This should only be rejected if use-hornetq-store is not false.
        subsystemRoot.getAttributeBuilder()
                .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(false, false, new ModelNode(true)),
                        TransactionSubsystemRootResourceDefinition.HORNETQ_STORE_ENABLE_ASYNC_IO)
                .addRejectCheck(RejectHornetQStoreAsyncIOChecker.INSTANCE, TransactionSubsystemRootResourceDefinition.HORNETQ_STORE_ENABLE_ASYNC_IO)
                // Legacy name for enabling/disabling statistics
                .addRename(TransactionSubsystemRootResourceDefinition.STATISTICS_ENABLED, CommonAttributes.ENABLE_STATISTICS)
                //Before 2.0.0 this value was not nillable in practise. Set it to 'false' if undefined.
                .setValueConverter(ProcessIdUuidConverter.INSTANCE, TransactionSubsystemRootResourceDefinition.PROCESS_ID_UUID);

        subsystemRoot.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE);

        final ModelVersion version120 = ModelVersion.create(1, 2, 0);
        final TransformationDescription description120 = subsystemRoot.build();
        TransformationDescription.Tools.register(description120, subsystem, version120);

        subsystemRoot.getAttributeBuilder()
                .setDiscard(UnneededJDBCStoreChecker.INSTANCE, TransactionSubsystemRootResourceDefinition.attributes_1_2)
                .addRejectCheck(RejectAttributeChecker.DEFINED, TransactionSubsystemRootResourceDefinition.attributes_1_2);

        // Transformations to the 1.1.1 Model:
        // 1) Remove JDBC store attributes if not used
        // 2) Fail if new attributes are set (and not removed by step 1)

        // Reuse the builder and add reject expression for 1.1.1
        subsystemRoot.getAttributeBuilder()
                .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, TransactionSubsystemRootResourceDefinition.ATTRIBUTES_WITH_EXPRESSIONS_AFTER_1_1_1);

        subsystemRoot.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE);
        final ModelVersion version111 = ModelVersion.create(1, 1, 1);
        final TransformationDescription description111 = subsystemRoot.build();
        TransformationDescription.Tools.register(description111, subsystem, version111);

        // Transformations to the 1.1.0 Model:
        // 1) Remove JDBC store attributes if not used
        // 2) Fail if new attributes are set (and not removed by step 1)
        // 3) Reject expressions
        final ModelVersion version110 = ModelVersion.create(1, 1, 0);

        subsystemRoot.getAttributeBuilder()
                .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, TransactionSubsystemRootResourceDefinition.ATTRIBUTES_WITH_EXPRESSIONS_AFTER_1_1_0);

        final TransformationDescription description110 = subsystemRoot.build();
        TransformationDescription.Tools.register(description110, subsystem, version110);
    }
View Full Code Here

Examples of org.jboss.as.controller.transform.description.TransformationDescription

        // Reuse the builder and add reject expression for 1.1.1
        subsystemRoot.getAttributeBuilder()
                .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, TransactionSubsystemRootResourceDefinition.ATTRIBUTES_WITH_EXPRESSIONS_AFTER_1_1_1);

        final ModelVersion version111 = ModelVersion.create(1, 1, 1);
        final TransformationDescription description111 = subsystemRoot.build();
        TransformationDescription.Tools.register(description111, subsystem, version111);

        // Transformations to the 1.1.0 Model:
        // 1) Remove JDBC store attributes if not used
        // 2) Fail if new attributes are set (and not removed by step 1)
        // 3) Reject expressions
        final ModelVersion version110 = ModelVersion.create(1, 1, 0);

        subsystemRoot.getAttributeBuilder()
                .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, TransactionSubsystemRootResourceDefinition.ATTRIBUTES_WITH_EXPRESSIONS_AFTER_1_1_0);

        final TransformationDescription description110 = subsystemRoot.build();
        TransformationDescription.Tools.register(description110, subsystem, version110);
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

            List<TransformationDescription> result = graphDb.getTransformationPath(sourceModel, targetModel, ids);
            if (result == null || result.isEmpty()) {
                return source;
            }
            for (int i = 0; i < result.size(); i++) {
                TransformationDescription step = result.get(i);
                if (i != result.size() - 1) {
                    TransformationPerformer performer = new TransformationPerformer(modelRegistry, operationLoader);
                    source = performer.transformObject(step, source);
                } else {
                    TransformationPerformer performer = new TransformationPerformer(modelRegistry, operationLoader);
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        graph.addModel(getModelCDescription());
        service.setOperationLoader(new TestTransformationOperationLoader());
    }

    private TransformationDescription getDescriptionForModelAToModelB() {
        return new TransformationDescription(getModelADescription(), getModelBDescription());
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

    private TransformationDescription getDescriptionForModelAToModelB() {
        return new TransformationDescription(getModelADescription(), getModelBDescription());
    }

    private TransformationDescription getDescriptionForModelBToModelA() {
        return new TransformationDescription(getModelBDescription(), getModelADescription());
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        return (ModelA) service.performTransformation(getModelBDescription(), getModelADescription(), model);
    }

    @Test
    public void testIfTransformationDescriptionsBuiltCorrectly_shouldWork() throws Exception {
        TransformationDescription desc1 = getDescriptionForModelAToModelB();
        desc1.setId("aTob");
        desc1.forwardField("bla", "blub");

        TransformationDescription desc2 = getDescriptionForModelBToModelA();
        desc2.setId("bToa");

        assertThat(desc1.getId(), is("aTob"));
        assertThat(desc1.getTransformingSteps().size(), is(1));
        assertThat(desc2.getId(), is("bToa"));
        assertThat(desc2.getSourceModel(), is(getModelBDescription()));
        assertThat(desc2.getTargetModel(), is(getModelADescription()));
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(desc2.getTargetModel(), is(getModelADescription()));
    }

    @Test
    public void testSimpleForwardTransformations_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.forwardField("testA", "testB");
        desc.forwardField("blubA", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
        model.setTestA("test2");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getBlubB(), is("test3"));
    }

    @Test
    public void testForwardTransformationsWithTemporaryField_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.forwardField("testA", "testB");
        desc.forwardField("blubA", "#test");
        desc.forwardField("#test", "blubB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
        model.setTestA("test2");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getBlubB(), is("test3"));
    }

    @Test
    public void testMixedForwardTransformations_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "testB");
        desc.forwardField("testA", "blubB");
        desc.forwardField("blubA", "idB");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
        model.setTestA("test2");
View Full Code Here

Examples of org.openengsb.core.ekb.api.transformation.TransformationDescription

        assertThat(result.getBlubB(), is("test2"));
    }

    @Test
    public void testConcatTransformation_shouldWork() throws Exception {
        TransformationDescription desc = getDescriptionForModelAToModelB();
        desc.forwardField("idA", "idB");
        desc.forwardField("testA", "testB");
        desc.concatField("blubB", "#", "blubA", "blaA");
        installTransformation(desc);

        ModelA model = new ModelA();
        model.setIdA("test1");
        model.setTestA("test2");
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.