Package org.openengsb.core.api.model

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


    private static ModelDescription getModelBDescription() {
        return new ModelDescription(ModelB.class, new Version(1, 0, 0).toString());
    }

    private static ModelDescription getModelCDescription() {
        return new ModelDescription(ModelC.class, new Version(1, 0, 0).toString());
    }
View Full Code Here


     */
    public static Class getClassOfOpenEngSBModel(String clazz,
            String version,
            OsgiUtilsService serviceFinder) throws ClassNotFoundException {
        ModelRegistry registry = serviceFinder.getService(ModelRegistry.class);
        ModelDescription modelDescription = new ModelDescription(clazz, version);
        Class clazzObject = registry.loadModel(modelDescription);  
        return clazzObject;
    }
View Full Code Here

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

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

        XLinkConnectorRegistration registration = xLinkRegistrations.get(connectorId);
        Collection<XLinkConnectorRegistration> registrations = hostOnly
                ? getXLinkRegistrations(registration.getHostId())
                : xLinkRegistrations.values();

        ModelDescription modelDescription = ModelWrapper.wrap(modelObject).getModelDescription();
        List<XLinkObject> xLinkObjects = new ArrayList<>();
        for (XLinkConnectorRegistration r : registrations) {
            xLinkObjects.addAll(collectXLinkObjects(modelObject, modelDescription, r));
        }
        if (!xLinkObjects.isEmpty()) {
View Full Code Here

    @Override
    public String generateXLink(String connectorId, String context, Object modelObject) {
        StringBuilder sb = new StringBuilder(xLinkBaseUrl);
        appendXLinkProperty(sb, '?', XLinkConstants.XLINK_CONTEXTID_KEY, context);

        ModelDescription modelDescription = ModelWrapper.wrap(modelObject).getModelDescription();
        appendXLinkProperty(sb, '&', XLinkConstants.XLINK_MODELCLASS_KEY, modelDescription.getModelClassName());
        appendXLinkProperty(sb, '&', XLinkConstants.XLINK_VERSION_KEY, modelDescription.getVersionString());

        ObjectMapper mapper = new ObjectMapper();
        String objectString = null;
        try {
            objectString = mapper.writeValueAsString(modelObject);
View Full Code Here

            String id = attributes.getValue("id");
           
            String[] split = source.split(";");
            String className = split[0];
            String version = split.length > 1 ? split[1] : "1.0.0";
            ModelDescription sourceModel = new ModelDescription(className, version);
           
            split = target.split(";");
            className = split[0];
            version = split.length > 1 ? split[1] : "1.0.0";
            ModelDescription targetModel = new ModelDescription(className, version);
           
            activeDescription = new TransformationDescription(sourceModel, targetModel, id);
            activeDescription.setFileName(fileName);
        } else if (localName.equals("source-field")) {
            activeSourceField = true;
View Full Code Here

     * Converts an EDBObject instance into a model. For this, the method need to retrieve the model class to be able to
     * instantiate the corresponding model objects. If the conversion fails, null is returned.
     */
    private Object createModelOfEDBObject(EDBObject object, Map<ModelDescription, Class<?>> cache) {
        try {
            ModelDescription description = getDescriptionFromObject(object);
            Class<?> modelClass;
            if (cache.containsKey(description)) {
                modelClass = cache.get(description);
            } else {
                modelClass = modelRegistry.loadModel(description);
View Full Code Here

        String modelName = obj.getString(EDBConstants.MODEL_TYPE);
        String modelVersion = obj.getString(EDBConstants.MODEL_TYPE_VERSION);
        if (modelName == null || modelVersion == null) {
            throw new IllegalArgumentException("The object " + obj.getOID() + " contains no model information");
        }
        return new ModelDescription(modelName, modelVersion);
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.model.ModelDescription

Copyright © 2018 www.massapicom. 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.