Package com.gainmatrix.lib.business.exception

Examples of com.gainmatrix.lib.business.exception.MissingEntityException


    @Override
    public int rollGroupIndex(long clusterGroupId) {
        ClusterGroup clusterGroup = businessEntityDao.lockById(ClusterGroup.class, clusterGroupId);
        if (clusterGroup == null) {
            throw new MissingEntityException(ClusterGroup.class, clusterGroupId);
        }

        int currentIndex = clusterGroup.getRollingIndex();

        for (int i = currentIndex + 1, size = clusterGroup.getNodes().size(); i < size; i++) {
View Full Code Here


    @Override
    public ClusterNode createNode(long clusterGroupId, String address, String comment, boolean activity) {
        ClusterGroup clusterGroup = businessEntityDao.lockById(ClusterGroup.class, clusterGroupId);
        if (clusterGroup == null) {
            throw new MissingEntityException(ClusterGroup.class, clusterGroupId);
        }

        ClusterNode clusterNode = new ClusterNode();
        clusterNode.setEnabled(activity);
        clusterNode.setAddress(address);
View Full Code Here

    @Override
    public void deleteNode(long clusterNodeId) {
        ClusterNode clusterNode = businessEntityDao.findById(ClusterNode.class, clusterNodeId);
        if (clusterNode == null) {
            throw new MissingEntityException(ClusterNode.class, clusterNodeId);
        }

        ClusterGroup clusterGroup = clusterNode.getGroup();

        businessEntityDao.lock(clusterGroup);
View Full Code Here

    @Override
    public ClusterNode modifyNode(long clusterNodeId, String domain, String comment, boolean activity) {
        ClusterNode clusterNode = businessEntityDao.lockById(ClusterNode.class, clusterNodeId);
        if (clusterNode == null) {
            throw new MissingEntityException(ClusterNode.class, clusterNodeId);
        }

        clusterNode.setAddress(domain);
        clusterNode.setDescription(comment);
        clusterNode.setEnabled(activity);
View Full Code Here

        Date now = chronometer.getCurrentMoment();

        // Select job by id
        ScheduleJob scheduleJob = businessEntityDao.lockById(ScheduleJob.class, scheduleJobId);
        if (scheduleJob == null) {
            throw new MissingEntityException(ScheduleJob.class, scheduleJobId);
        }

        // Action
        ScheduleAction scheduleAction = scheduleJob.getAction();
        scheduleAction.setUsedDate(now);
View Full Code Here

    @Override
    public ScheduleExecutionResult startExecutionResult(long scheduleExecutionNodeId) throws AbstractServiceException {
        ScheduleExecutionNode node = businessEntityDao.findById(ScheduleExecutionNode.class, scheduleExecutionNodeId);
        if (node == null) {
            throw new MissingEntityException(ScheduleExecutionNode.class, scheduleExecutionNodeId);
        }

        ScheduleExecution scheduleExecution = node.getExecution();

        if (scheduleExecution.getFinished() != null) {
View Full Code Here

    {
        ScheduleExecutionResult result =
            businessEntityDao.findById(ScheduleExecutionResult.class, scheduleExecutionResultId);

        if (result == null) {
            throw new MissingEntityException(ScheduleExecutionResult.class, scheduleExecutionResultId);
        }

        if (result.getFinished() != null) {
            throw new ResultAlreadyFinishedException(result.getId());
        }
View Full Code Here

    {
        Preconditions.checkNotNull(status);

        ScheduleExecution scheduleExecution = businessEntityDao.lockById(ScheduleExecution.class, scheduleExecutionId);
        if (scheduleExecution == null) {
            throw new MissingEntityException(ScheduleExecution.class, scheduleExecutionId);
        }

        if (scheduleExecution.getFinished() != null) {
            throw new ExecutionAlreadyFinishedException(scheduleExecution.getId());
        }
View Full Code Here

    @Override
    public ScheduleExecution cancelExecution(long scheduleExecutionId) throws AbstractServiceException {
        ScheduleExecution scheduleExecution = businessEntityDao.lockById(ScheduleExecution.class, scheduleExecutionId);
        if (scheduleExecution == null) {
            throw new MissingEntityException(ScheduleExecution.class, scheduleExecutionId);
        }

        if (scheduleExecution.getFinished() != null) {
            throw new ExecutionAlreadyFinishedException(scheduleExecutionId);
        }
View Full Code Here

TOP

Related Classes of com.gainmatrix.lib.business.exception.MissingEntityException

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.