Examples of EKBException


Examples of org.openengsb.core.ekb.api.EKBException

            Class<?> sourceClass = modelRegistry.loadModel(description);
            Object model = edbConverter.convertEDBObjectToModel(sourceClass,
                edbService.getObject(modelKey));
            return new AdvancedModelWrapper((OpenEngSBModel) model);
        } catch (SecurityException e) {
            throw new EKBException(generateErrorMessage(field), e);
        } catch (IllegalArgumentException e) {
            throw new EKBException(generateErrorMessage(field), e);
        } catch (IllegalAccessException e) {
            throw new EKBException(generateErrorMessage(field), e);
        } catch (ClassNotFoundException e) {
            throw new EKBException(generateErrorMessage(field), e);
        }
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.EKBException

        EDBObject object = new EDBObject(oid);
        try {
            fillEDBObjectWithEngineeringObjectInformation(object, model);
        } catch (IllegalAccessException e) {
            LOGGER.warn("Unable to fill completely the EngineeringObjectInformation into the EDBObject", e);
            throw new EKBException("Unable to fill completely the EngineeringObjectInformation into the EDBObject", e);
        }
        for (OpenEngSBModelEntry entry : model.toOpenEngSBModelEntries()) {
            if (entry.getValue() == null) {
                continue;
            } else if (entry.getType().equals(FileWrapper.class)) {
View Full Code Here

Examples of org.openengsb.core.ekb.api.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.ekb.api.EKBException

            }
            runEKBPreCommitHooks(commit);
            if (check) {
                performSanityChecks(commit);
            }
            EKBException exception = null;
            ConvertedCommit converted = edbConverter.convertEKBCommit(commit);
            try {
                performPersisting(converted, commit);
                runEKBPostCommitHooks(commit);
            } catch (EKBException e) {
View Full Code Here

Examples of org.openengsb.core.ekb.api.EKBException

            }
            newCommit.setComment(String.format("revert [%s] %s", commit.getRevisionNumber().toString(),
                commit.getComment() != null ? commit.getComment() : ""));
            edbService.commit(newCommit);
        } catch (EDBException e) {
            throw new EKBException("Unable to revert to the given revision " + revision, e);
        } finally {
            releaseContext(contextId);
        }
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.EKBException

    private void runEKBPreCommitHooks(EKBCommit commit) throws EKBException {
        for (EKBPreCommitHook hook : preCommitHooks) {
            try {
                hook.onPreCommit(commit);
            } catch (EKBException e) {
                throw new EKBException("EDBException is thrown in a pre commit hook.", e);
            } catch (Exception e) {
                LOGGER.warn("An exception is thrown in a EKB pre commit hook.", e);
            }
        }
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.EKBException

            source.setParentRevisionNumber(ci.getParentRevisionNumber());
        } catch (EDBCheckException e) {
            throw new ModelPersistException(convertEDBObjectList(e.getFailedInserts()),
                convertEDBObjectList(e.getFailedUpdates()), e.getFailedDeletes(), e);
        } catch (EDBException e) {
            throw new EKBException("Error while commiting EKBCommit", e);
        }
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.EKBException

    }

    @Override
    public void deleteCommit(UUID revision, String contextId) throws EKBException {
        if (revision == null || contextId == null) {
            throw new EKBException("null revision or context not allowed");
        }
        try {
            lockContext(contextId);
            checkForContextHeadRevision(contextId, revision);
            edbService.deleteCommit(revision);
        } catch (EDBException e) {
            throw new EKBException("Error reverting commit with revision " + revision, e);
        } finally {
            releaseContext(contextId);
        }
    }
View Full Code Here

Examples of org.openengsb.core.ekb.api.EKBException

        boolean valuesChanged = diff.isValueChanged();
        // TODO: OPENENGSB-3358, Make it possible to change references and values at the same time. Should be
        // no too big deal since we already know at this point which values of the model have been changed and
        // what the old and the new value for the changed properties are
        if (referencesChanged && valuesChanged) {
            throw new EKBException("Engineering Objects may be updated only at "
                    + "references or at values not both in the same commit");
        }
        if (referencesChanged) {
            reloadReferencesAndUpdateEO(diff, model);
        } else {
View Full Code Here

Examples of org.openengsb.core.ekb.api.EKBException

                    FieldUtils.writeDeclaredField(target, fieldName, value, true);
                }
            }
            return target;
        } catch (Exception e) {
            throw new EKBException("Unable to perform test transformation", e);
        }
    }
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.