Examples of ModelDescription


Examples of org.openengsb.core.api.model.ModelDescription

        Object provider = loadTestModelProvider();
        return (Class<?>) provider.getClass().getMethod("loadSubModel").invoke(provider);
    }

    protected ModelDescription getPrimitivePropertyModelDescription() {
        return new ModelDescription(PrimitivePropertyModel.class.getName(), providerVersion);
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

    public void testInstallBundleWithTransformations_shouldRegisterTransformations() throws Exception {
        Bundle providerBundle = getBundleContext()
                .installBundle("test://testlocation/test.provider.transformation.jar", providerTinyBundle.build());
        providerBundle.start();
        assertTrue("transformation is not possible", transformationEngine.isTransformationPossible(
                new ModelDescription(ExampleResponseModel.class.getName(), getOsgiProjectVersion()),
                new ModelDescription(ExampleRequestModel.class.getName(), getOsgiProjectVersion()))
        );
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

        providerBundle.start();
        providerBundle.stop();
        providerBundle.uninstall();
        assertFalse("transformation still possible. It has not been removed",
                transformationEngine.isTransformationPossible(
                        new ModelDescription(ExampleResponseModel.class.getName(), getOsgiProjectVersion()),
                        new ModelDescription(ExampleRequestModel.class.getName(), getOsgiProjectVersion()))
        );
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

        providerTinyBundle.removeResource("test.transformation");
        providerBundle.update(providerTinyBundle.build());
        providerBundle.start();
        assertFalse("transformation still possible. It has not been removed",
                transformationEngine.isTransformationPossible(
                        new ModelDescription(ExampleResponseModel.class.getName(), getOsgiProjectVersion()),
                        new ModelDescription(ExampleRequestModel.class.getName(), getOsgiProjectVersion()))
        );
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

            return null;
        }
        if (!(isModel(arg) && isModel(targetType))) {
            return arg;
        }
        ModelDescription sourceModel = new ModelDescription(arg.getClass());
        ModelDescription targetModel = new ModelDescription(targetType);
        return transformationEngine.performTransformation(sourceModel, targetModel, arg);
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

        initialized = true;
        ContextHolder.get().setCurrentContextId("testcontext");
    }

    private ModelDescription getSourceModelADescription() {
        return new ModelDescription(SourceModelA.class, exampleDomainVersion.toString());
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

    private ModelDescription getSourceModelADescription() {
        return new ModelDescription(SourceModelA.class, exampleDomainVersion.toString());
    }

    private ModelDescription getSourceModelBDescription() {
        return new ModelDescription(SourceModelB.class, exampleDomainVersion.toString());
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

     * Returns the model description for the model class of the EDBModelObject
     */
    public ModelDescription getModelDescription() {
        String modelType = object.getString(EDBConstants.MODEL_TYPE);
        String version = object.getString(EDBConstants.MODEL_TYPE_VERSION);
        return new ModelDescription(modelType, version);
    }
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

    /**
     * Returns the corresponding model object for the EDBModelObject
     */
    public OpenEngSBModel getCorrespondingModel() throws EKBException {
        ModelDescription description = getModelDescription();
        try {
            Class<?> modelClass = modelRegistry.loadModel(description);
            return (OpenEngSBModel) edbConverter.convertEDBObjectToModel(modelClass, object);
        } catch (ClassNotFoundException e) {
            throw new EKBException(String.format("Unable to load model of type %s", description), e);
View Full Code Here

Examples of org.openengsb.core.api.model.ModelDescription

     * Updates an Engineering Object given as EDBObject based on the update on the given model which is referenced by
     * the given Engineering Object.
     */
    private AdvancedModelWrapper updateEOByUpdatedModel(EDBModelObject reference, AdvancedModelWrapper model,
            Map<Object, AdvancedModelWrapper> updated) {
        ModelDescription source = model.getModelDescription();
        ModelDescription description = reference.getModelDescription();
        AdvancedModelWrapper wrapper = updated.get(reference.getOID());
        Object ref = null;
        if (wrapper == null) {
            ref = reference.getCorrespondingModel();
        } else {
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.